┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-02-08 18:26:23 +0000
committerPeter Penz <[email protected]>2009-02-08 18:26:23 +0000
commit681929dc6743d57138ae1245a8d255e0e5c6bde9 (patch)
treea6e94b6e88ddd36b8ab475347ffc69deec79bedd
parent95f85fb719c5c45f511567d03885fb39cb73b525 (diff)
Allow the view implementations to directly trigger an item without mouse interaction. This is e. g. necessary when the column view wants to implement a custom key handling where a folder should be triggered.
svn path=/trunk/KDE/kdebase/apps/; revision=923417
-rw-r--r--src/dolphincontroller.cpp5
-rw-r--r--src/dolphincontroller.h15
2 files changed, 18 insertions, 2 deletions
diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp
index 980e16059..92110643c 100644
--- a/src/dolphincontroller.cpp
+++ b/src/dolphincontroller.cpp
@@ -160,6 +160,11 @@ void DolphinController::emitHideToolTip()
emit hideToolTip();
}
+void DolphinController::emitItemTriggered(const KFileItem& item)
+{
+ emit itemTriggered(item);
+}
+
KFileItem DolphinController::itemForIndex(const QModelIndex& index) const
{
Q_ASSERT(m_itemView != 0);
diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h
index 3260ab63f..eb5ef9ce7 100644
--- a/src/dolphincontroller.h
+++ b/src/dolphincontroller.h
@@ -211,6 +211,16 @@ public:
void emitHideToolTip();
/**
+ * Emits the signal itemTriggered() for the item \a item.
+ * The method can be used by the view implementations to
+ * trigger an item directly without mouse interaction.
+ * If the item triggering is done by the mouse, it is recommended
+ * to use QAbstractItemView::triggerItem(), as this will check
+ * the used mouse buttons to execute the correct action.
+ */
+ void emitItemTriggered(const KFileItem& item);
+
+ /**
* Returns the file item for the proxy index \a index of the view \a view.
*/
KFileItem itemForIndex(const QModelIndex& index) const;
@@ -220,8 +230,9 @@ public slots:
* Emits the signal itemTriggered() if the file item for the index \a index
* is not null and the left mouse button has been pressed. If the item is
* null, the signal itemEntered() is emitted.
- * The method should be invoked by the controller parent whenever the
- * user has triggered an item.
+ * The method should be invoked by the view implementations whenever the
+ * user has triggered an item with the mouse (see
+ * QAbstractItemView::clicked() or QAbstractItemView::doubleClicked()).
*/
void triggerItem(const QModelIndex& index);