[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    URI drags
From:       Adriaan de Groot <adridg () sci ! kun ! nl>
Date:       2000-12-27 20:16:06
[Download RAW message or body]

Hi,

Dragging an email address from a displayed message (ie. from the From: 
header) to the composer's To: field puts an encoded URI (ie. 
adridg%34cs.kun.nl) into the To: field, instead of the decoded URI. Is there 
anyone working on fixing this? 


I've got a solution (add virtual void dropEvent to KMLineEdit) but it seems 
like a little hack to me and I'm not sure about just what *is* in a uri-list.
/* virtual */ void KMLineEdit::dropEvent(QDropEvent *e)
{
 
        if (e->provides("text/uri-list"))
        {
                char t[3];
                t[1]=0;
                QByteArray a = e->encodedData("text/uri-list");
                const char *s = a.data();
                KURL u(s);
 
                if (u.protocol() == QString("mailto"))
                {
                        QString ct = text();
                        if (!ct.isEmpty())
                        {
                                ct.append(", ");
                        }
                        ct.append(u.path());
                        setText(ct);
                        e->accept(true);
                        return;
                }
        }
 
        QLineEdit::dropEvent(e);
}

-- 
[ade] at home: adridg@sci.kun.nl
Probably hacking at KDE2.
_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic