]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Allow the view implementations to directly trigger an item without mouse interaction...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 8 Feb 2009 18:26:23 +0000 (18:26 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 8 Feb 2009 18:26:23 +0000 (18:26 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=923417

src/dolphincontroller.cpp
src/dolphincontroller.h

index 980e160590611fce3dbb4e8f8d969d7bce29a57c..92110643cd66e7eb08062cb9bd6b80f8715e2050 100644 (file)
@@ -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);
index 3260ab63fdce61fdfdc6db745a0a246d87597836..eb5ef9ce7f214a4f7385f31e49da9886bd359269 100644 (file)
@@ -210,6 +210,16 @@ public:
     /** Emits the signal hideToolTip(). */
     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.
      */
@@ -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);