diff options
| author | Peter Penz <[email protected]> | 2008-11-08 16:22:30 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-11-08 16:22:30 +0000 |
| commit | a7838db28e24e9618a39954524f055dc3335f7a9 (patch) | |
| tree | c4c653405a259e87ac34163efd0d51db07ba242d /src/draganddrophelper.h | |
| parent | d5bc6cfa74e21668788d42721dcdb4818a072366 (diff) | |
* implement the DragAndDropHelper as singleton derived from QObject, so that emitting of signals is possible
* show an information message in the statusbar, if items are dragged into the same directory
TODO: although the signal seems to get connected correctly, the slot DolphinMainWindow::showInformationMessage() is not invoked when the signal is emitted -> will debug this later, it is important that the new string is added before the message freeze
svn path=/trunk/KDE/kdebase/apps/; revision=881627
Diffstat (limited to 'src/draganddrophelper.h')
| -rw-r--r-- | src/draganddrophelper.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/draganddrophelper.h b/src/draganddrophelper.h index 920ff5135..c6abd46c3 100644 --- a/src/draganddrophelper.h +++ b/src/draganddrophelper.h @@ -20,7 +20,7 @@ #ifndef DRAGANDDROPHELPER_H #define DRAGANDDROPHELPER_H -#include <QtCore/Qt> +#include <QObject> class DolphinController; class KFileItem; @@ -39,22 +39,25 @@ class QWidget; * DolphinColumnView and SidebarTreeView to have a consistent * drag and drop behavior between all views. */ -class DragAndDropHelper +class DragAndDropHelper : public QObject { + Q_OBJECT public: + static DragAndDropHelper& instance(); + /** * Returns true, if Dolphin supports the dragging of * the given mime data. */ - static bool isMimeDataSupported(const QMimeData* mimeData); + bool isMimeDataSupported(const QMimeData* mimeData) const; /** * Creates a drag object for the view \a itemView for all selected items. */ - static void startDrag(QAbstractItemView* itemView, - Qt::DropActions supportedActions, - DolphinController* controller = 0); + void startDrag(QAbstractItemView* itemView, + Qt::DropActions supportedActions, + DolphinController* controller = 0); /** * Handles the dropping of URLs to the given @@ -66,10 +69,17 @@ public: * @param event Drop event. * @param widget Source widget where the dragging has been started. */ - static void dropUrls(const KFileItem& destItem, - const KUrl& destPath, - QDropEvent* event, - QWidget* widget); + void dropUrls(const KFileItem& destItem, + const KUrl& destPath, + QDropEvent* event, + QWidget* widget); +signals: + void informationMessage(const QString& msg); + +private: + DragAndDropHelper(); + + friend class DragAndDropHelperSingleton; }; #endif |
