diff options
| author | Peter Penz <[email protected]> | 2008-02-21 11:56:31 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-02-21 11:56:31 +0000 |
| commit | e287058acb772b55b679a694062361d3fb0e8f89 (patch) | |
| tree | 624ba47b804fbddecd0e3d52a992a0f58223ee58 /src/dolphincontroller.h | |
| parent | c73591380173b52504aaceb74314f617b2e04f6c (diff) | |
Prevent code duplication by moving the duplications into the DolphinController.
Maybe it might be a good idea to let the DolphinController be aware also about his QAbstractItemView -> it might be possible to directly connect signals of the dolphin view implementations with the controller. I'll check this...
(I did not backport this cleanup as I think it has too many changes to be handled as bugfix)
CCMAIL: [email protected]
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=777719
Diffstat (limited to 'src/dolphincontroller.h')
| -rw-r--r-- | src/dolphincontroller.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h index e08e9e490..17e0a4a71 100644 --- a/src/dolphincontroller.h +++ b/src/dolphincontroller.h @@ -25,6 +25,7 @@ #include <QtCore/QObject> #include <libdolphin_export.h> +class QAbstractItemView; class DolphinView; class KUrl; class QBrush; @@ -59,6 +60,7 @@ class QWidget; * - setZoomInPossible() * - setZoomOutPossible() * - triggerItem() + * - handleKeyPressEvent() * - emitItemEntered() * - emitViewportEntered() * @@ -192,17 +194,32 @@ public: void setZoomOutPossible(bool possible); bool isZoomOutPossible() const; + /** + * Should be invoked in each view implementation whenever a key has been + * pressed. If the selection model of \a view is not empty and + * the return key has been pressed, the selected items will get triggered. + */ + void handleKeyPressEvent(QKeyEvent* event, QAbstractItemView* view); + + /** + * Returns the file item for the proxy index \a index of the view \a view. + */ + KFileItem itemForIndex(const QModelIndex& index, QAbstractItemView* view) const; + public slots: /** - * Emits the signal itemTriggered(). The method should be invoked by the - * controller parent whenever the user has triggered an item. */ - void triggerItem(const KFileItem& item); + * Emits the signal itemTriggered() if the file item for the index \a index + * is not null. The method should be invoked by the + * controller parent whenever the user has triggered an item. + */ + void triggerItem(const QModelIndex& index, QAbstractItemView* view); /** - * Emits the signal itemEntered(). The method should be invoked by - * the controller parent whenever the mouse cursor is above an item. + * Emits the signal itemEntered() if the file item for the index \a index + * is not null. The method should be invoked by the controller parent + * whenever the mouse cursor is above an item. */ - void emitItemEntered(const KFileItem& item); + void emitItemEntered(const QModelIndex& index, QAbstractItemView* view); /** * Emits the signal viewportEntered(). The method should be invoked by |
