Bug 158843 - Implement proper drag and drop support for KUrlComboBox
Summary: Implement proper drag and drop support for KUrlComboBox
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-06 08:12 UTC by Viesturs Zarins
Modified: 2010-10-27 17:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Viesturs Zarins 2008-03-06 08:12:38 UTC
Version:            (using KDE 4.0.2)
Installed from:    Ubuntu Packages

Currently you can drag and drop files to the url text box.And if the text box is empty then all works as exepected. But if there is some text, the url is inserted in the existing text at the cursor position.

I would expect that the dropped URL replaces the existing text instead of inserting into it.
Comment 1 Viesturs Zarins 2008-03-06 08:13:58 UTC
For a simple test you can run kompare - it has a startup dialog with two KUrlComboBox fields.
Comment 2 David Faure 2010-10-05 01:09:11 UTC
Well, that's what the clear button is for, actually...
Comment 3 Viesturs Zarins 2010-10-05 08:29:41 UTC
(In reply to comment #2)
> Well, that's what the clear button is for, actually...

Yes, the Clear button helps, but it's just a workaround.

The drag and drop feature should NOT introduce invalid URLs, but it does, by inserting the dropped URL at the cursor position.

Also an URL field can contain only a single URL, so the obvious drop behavior is to replace the existing URL.
Comment 4 David Faure 2010-10-07 18:29:18 UTC
OK, I agree, when dragging full URLs (text/uri-list) we can handle the drop by replacing the existing URL. This won't affect drops of plain-text-only, e.g. selecting a url or part of a url in konqueror's location bar.
Comment 5 Viesturs Zarins 2010-10-08 09:41:44 UTC
Sure, that is perfectly reasonable.(In reply to comment #4)
> OK, I agree, when dragging full URLs (text/uri-list) we can handle the drop by
> replacing the existing URL. This won't affect drops of plain-text-only, e.g.
> selecting a url or part of a url in konqueror's location bar.

Sure, that makes perfect sense.
Comment 6 Romain Perier 2010-10-27 17:22:56 UTC
Apparently this problem occurs only when the DnD data is text/plain (or equivalent).

typically using firefox (or rekonq) try to DnD the url, it works (at least here), but now try from chrome it fails. I made some tests and finally I found the following (using kDebug() and verbosity from kdelibs) :

- From chrome the DnD data isn't text/uri-list compatible, but text/plain , text/plain?charset=utf8 
- From firefox the DnD data can be converted to text/uri-list, text/plain, text/text/x-moz-url ...

When the DnD data is ONLY text/plain compatible  the drop event isn't handle by KLineEdit (Delegated from kcombobox inherited from KUrlComboBox) but by QLineEdit instead, and the behaviour is different, as well.

I made these tests using KDE 4.5.2 and KDE 4.5.2+kdelibs4.6(trunk).

Could you test it ?
Comment 7 Romain Perier 2010-10-27 17:56:49 UTC
r815275 | ereslibre | 2008-06-01 16:06:17 +0200 (Sun, 01 Jun 2008) | 2 lines
Make it possible to drag from the icon the url. For example, open/save dialogs as well as dolphin benefit from this fix (usability fix).


As I said the behaviour using chrome is normal, and this bug was already fixed in 2008.

-> RESOLVED