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

List:       kde-pim
Subject:    Re: [Kde-pim] email drag & drop
From:       Ingo =?utf-8?q?Kl=C3=B6cker?= <kloecker () kde ! org>
Date:       2004-07-23 20:20:18
Message-ID: 200407232220.24504 () erwin ! ingo-kloecker ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Friday 23 July 2004 01:58, David Faure wrote:
> On Friday 23 July 2004 01:46, Ingo Klöcker wrote:
> > Even if it works with KDE 3.3 (which is hard to believe because
> > kurldrag has absolutely nothing to do with the selection clipboard)
>
> I don't see what makes you think that.
>
> void KHTMLPopupGUIClient::slotCopyLinkLocation()
> {
>   // Set it in both the mouse selection and in the clipboard
>   KURL::List lst;
>   lst.append( d->m_url );
>   QApplication::clipboard()->setSelectionMode(true);
>   QApplication::clipboard()->setData( new KURLDrag( lst ) );
>   QApplication::clipboard()->setSelectionMode(false);
>   QApplication::clipboard()->setData( new KURLDrag( lst ) );
> }
>
> Seems quite obvious to me that a KURLDrag is used when using "copy
> link location", both in selection and normal clipboard.

Well, this just means that it works if one uses KHTML to copy a mailto: 
URL to the clipboard. Can you guarantee that all other applications do 
it the same way? FWIW, KMail uses

  if (mUrl.protocol() == "mailto") {
    // put the url into the mouse selection and the clipboard
    QString address = KMMessage::decodeMailtoUrl( mUrl.path() );
    clip->setSelectionMode( true );
    clip->setText( address );
    clip->setSelectionMode( false );
    clip->setText( address );
    if (mMainWidget)
      mMainWidget->statusMsg( i18n( "Address copied to clipboard." ));
  } else {
    // put the url into the mouse selection and the clipboard
    clip->setSelectionMode( true );
    clip->setText( mUrl.url() );
    clip->setSelectionMode( false );
    clip->setText( mUrl.url() );
    if ( mMainWidget )
      mMainWidget->statusMsg( i18n( "URL copied to clipboard." ));
  }

As you can see KURLDrag is not involved.

> > it doesn't work with KDE 3.2. Since the patch doesn't hurt it
> > should still be applied.
>
> If you want. But a dozen of other combinations will still be broken:
> * drag-n-drop of an email from kmail's readerwin to konsole - or any
> text editor 
> * RMB/"copy link location" in kmail / konqueror, MMB in 
> kmail / kaddressbook / anywhere else. Adding a hack for the "pasting
> to kaddressbook" case doesn't help with all the other places where
> you can paste the data. It's much cleaner to fix the source (the code
> that copies the data) rather than fixing the destination (each and
> every lineedit!).

RMB/"copy link location" in KMail doesn't put a mailto-URL in the 
clipboard (see above). So obviously pasting afterwards will always 
work.

And MMB in KMail's address fields also works because I've fixed 
KPIM::AddresseeLineEdit. Actually I think we should probably use 
KPIM::AddresseeLineEdit in KAddressBook (in EmailEditWidget) instead of 
a simple KLineEdit.

Regards,
Ingo

[Attachment #5 (application/pgp-signature)]

_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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