Bug 86494 - Kget Can not support Mozilla/firefox/netscape dropEvent
Summary: Kget Can not support Mozilla/firefox/netscape dropEvent
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-03 13:28 UTC by cjacker
Modified: 2005-07-24 13:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kget mozilla support patch (1.96 KB, patch)
2004-08-04 04:12 UTC, cjacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cjacker 2004-08-03 13:28:38 UTC
Version:            (using KDE KDE 3.2.92)
Installed from:    Compiled From Sources

As we know, KGET can not support Mozilla/firefox/netscape drop in and download。
It can not get URL correctly, and will popup a Error MessageBox。

I had checked the source and tried to fix this problem.

the problem is :
void DropTarget::dropEvent(QDropEvent * event) function.

Modified like this:

void DropTarget::dropEvent(QDropEvent * event)
{
    KURL::List list;
    QString str=NULL;
    QByteArray qb;

    if (KURLDrag::decode(event, list))
    {
        kmain->addTransfers(list);
    }
    else
    {
     qb=event->encodedData("text/plain");
     int url_length=qb.count();
     str = QString(qb).left(url_length);
     kmain->addTransfer(str);
    }
}

then it works.

I found that to  use QString(QByteArry &) to construct a QString can not work correctly, so I calc the size of QByteArray and get the QString use left(url_length).
Comment 1 cjacker 2004-08-04 04:12:45 UTC
Created attachment 6988 [details]
kget mozilla support patch

This patch fix droptarget.cpp, kmainwidget.cpp and docking.cpp

also fix kget droptarget behavior, sometimes the drop window will stay below
other windows and will show a taskbar item.
Comment 2 Lubos Lunak 2004-08-04 15:29:54 UTC
This is a duplicate of bug #71084 (and therefore the QString part of the patch is not a proper solution and should be ignored). I'm leaving this bugreport open only because of the drop window part of the patch.
Comment 3 Urs Wolfer 2005-07-24 13:11:18 UTC
This problem isn't anymore in KDE 3.4.1.