Merge lp://qastaging/~osomon/unity-2d/dnd2 into lp://qastaging/unity-2d/3.0
Proposed by
Olivier Tilloy
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Florian Boucault | ||||
Approved revision: | 406 | ||||
Merged at revision: | 391 | ||||
Proposed branch: | lp://qastaging/~osomon/unity-2d/dnd2 | ||||
Merge into: | lp://qastaging/unity-2d/3.0 | ||||
Diff against target: |
643 lines (+389/-48) 16 files modified
launcher/CMakeLists.txt (+4/-0) launcher/Launcher.qml (+5/-0) launcher/LauncherItem.qml (+4/-0) launcher/UnityApplications/launcheritem.cpp (+15/-0) launcher/UnityApplications/launcheritem.h (+8/-0) launcher/UnityApplications/trash.cpp (+26/-0) launcher/UnityApplications/trash.h (+6/-0) launcher/app/launcherview.cpp (+97/-43) launcher/app/launcherview.h (+19/-5) libunity-2d-private/Unity2d/CMakeLists.txt (+2/-0) libunity-2d-private/Unity2d/plugin.cpp (+7/-0) libunity-2d-private/src/CMakeLists.txt (+2/-0) libunity-2d-private/src/dragdropevent.cpp (+56/-0) libunity-2d-private/src/dragdropevent.h (+59/-0) libunity-2d-private/src/mimedata.cpp (+31/-0) libunity-2d-private/src/mimedata.h (+48/-0) |
||||
To merge this branch: | bzr merge lp://qastaging/~osomon/unity-2d/dnd2 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Florian Boucault (community) | functional code | Needs Fixing | |
Aurélien Gâteau (community) | Approve | ||
Review via email:
|
Commit message
[launcher] Support dragging files to the trash.
This changeset also implements the generic infrastructure needed to delegate drag’n’drop events’ handling to launcher items.
To post a comment you must log in.
# Functional
It works well, but the cursor behavior is a bit weird. If I drag a file from Dolphin to the trash, I get the correct "Move" cursor, but if I drag it from Nautilus I get the "Copy" action. Not sure what is wrong here. Maybe Nautilus does not put "Move" in the proposed actions?
# Code
90 + DropEvent* , but because bugreports. qt.nokia. com/browse/ QTBUG-13047 they need to be QObject* event);
91 +public Q_SLOTS:
92 + /* Default implementation of drag’n’drop handling, should be overridden in
93 + subclasses to implement custom behaviours. */
94 + /* The 'event' parameters should be DeclarativeDrag
95 + of http://
96 + passed around from QML to C++ as QObject*. This is fixed in Qt 4.7.1. */
97 + virtual void onDragEnter(
98 + virtual void onDrop(QObject* event);
We ship Qt 4.7.1 in Natty, so you should already be able to use DeclarativeDrag DropEvent* instead of QObject*.
I think you don't need to call setAccepted() in drop methods (onDrop() or dropEvent()). It only matters in drag methods (onDragEnter(), dragEnterEvent(), ondragMove(), dragMoveEvent()).
From what I understand, the dnd events are received in the C++ side, then forwarded to the QML side, which forwards them again back to C++. Which raise a question: is it necessary at all to go through QML?
Usual nitpick: "}\nelse {" => "} else {" :)