Bug 86494

Summary: Kget Can not support Mozilla/firefox/netscape dropEvent
Product: [Applications] kget Reporter: cjacker <cjacker>
Component: generalAssignee: KGet authors <kget>
Status: RESOLVED FIXED    
Severity: normal CC: l.lunak
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: kget mozilla support patch

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.