]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.h
kitemlistview: Port KItemListView::itemAt to std::optional
[dolphin.git] / src / kitemviews / kitemlistcontroller.h
index cdbc5b47042055cc6be30a36f4be5eb5817a5184..5fe195e9f490b7411b592f2cebd01f9c79332c9c 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef KITEMLISTCONTROLLER_H
 #define KITEMLISTCONTROLLER_H
 
+#include <optional>
+
 #include "dolphin_export.h"
 #include "kitemset.h"
 
@@ -126,7 +128,7 @@ public:
 
     bool processEvent(QEvent* event, const QTransform& transform);
 
-signals:
+Q_SIGNALS:
     /**
      * Is emitted if exactly one item has been activated by e.g. a mouse-click
      * or by pressing Return/Enter.
@@ -137,7 +139,7 @@ signals:
      * Is emitted if more than one item has been activated by pressing Return/Enter
      * when having a selection.
      */
-    void itemsActivated(const KItemSetindexes);
+    void itemsActivated(const KItemSet &indexes);
 
     void itemMiddleClicked(int index);
 
@@ -217,10 +219,10 @@ signals:
     void decreaseZoom();
     void swipeUp();
 
-public slots:
+public Q_SLOTS:
     void slotStateChanged(QScroller::State newState);
 
-private slots:
+private Q_SLOTS:
     void slotViewScrollOffsetChanged(qreal current, qreal previous);
 
     /**
@@ -329,7 +331,7 @@ private:
     KItemListView* m_view;
     KItemListSelectionManager* m_selectionManager;
     KItemListKeyboardSearchManager* m_keyboardManager;
-    int m_pressedIndex;
+    std::optional<int> m_pressedIndex;
     QPointF m_pressedMousePos;
 
     QTimer* m_autoActivationTimer;