]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.h
Clean obsolete ifdefs since dolphin requires KF 5.101+
[dolphin.git] / src / views / dolphinview.h
index 8cf23c298018cf87a81ec5ae9f1e2f6a28203422..f851724c238a8bccda45dd703dcb90f798e51d8c 100644 (file)
@@ -225,8 +225,6 @@ public:
     /** Returns the additional information which should be shown for the items. */
     QList<QByteArray> visibleRoles() const;
 
-    void reload();
-
     /**
      * Refreshes the view to get synchronized with the settings (e.g. icons size,
      * font, ...).
@@ -335,7 +333,21 @@ public:
      */
     void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
 
+    /**
+     * Check if the space key should be handled as a normal key, even if it's
+     * used as a keyboard shortcut.
+     *
+     * See BUG 465489
+     */
+    bool handleSpaceAsNormalKey() const;
+
+    /** Activates the view if the item list container gets focus. */
+    bool eventFilter(QObject *watched, QEvent *event) override;
+
 public Q_SLOTS:
+
+    void reload();
+
     /**
      * Changes the directory to \a url. If the current directory is equal to
      * \a url, nothing will be done (use DolphinView::reload() instead).
@@ -426,9 +438,6 @@ public Q_SLOTS:
      */
     void updateViewState();
 
-    /** Activates the view if the item list container gets focus. */
-    bool eventFilter(QObject *watched, QEvent *event) override;
-
 Q_SIGNALS:
     /**
      * Is emitted if the view has been activated by e. g. a mouse click.
@@ -443,6 +452,12 @@ Q_SIGNALS:
      */
     void itemActivated(const KFileItem &item);
 
+    /**
+     * Is emitted when clicking on a file with the middle mouse button.
+     * @note: This will not be emitted for folders or file archives that will/can be opened like folders.
+     */
+    void fileMiddleClickActivated(const KFileItem &item);
+
     /**
      * Is emitted when multiple items have been activated by e. g.
      * context menu open with.
@@ -666,7 +681,7 @@ private Q_SLOTS:
     void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
     void slotRenameDialogRenamingFinished(const QList<QUrl> &urls);
     void slotSelectedItemTextPressed(int index);
-    void slotCopyingDone(KIO::Job *, const QUrl &, const QUrl &to);
+    void slotItemCreatedFromJob(KIO::Job *, const QUrl &, const QUrl &to);
     void slotIncreaseZoom();
     void slotDecreaseZoom();
     void slotSwipeUp();
@@ -796,6 +811,11 @@ private Q_SLOTS:
      */
     void observeCreatedItem(const QUrl &url);
 
+    /**
+     * Selects the next item after prev selection deleted/trashed
+     */
+    void selectNextItem();
+
     /**
      * Called when a redirection happens.
      * Testcase: fish://localhost
@@ -881,7 +901,7 @@ private:
 
     void updatePlaceholderLabel();
 
-    void tryShowNameToolTip(QHelpEvent *event);
+    bool tryShowNameToolTip(QHelpEvent *event);
 
 private:
     void updatePalette();
@@ -893,6 +913,7 @@ private:
     bool m_isFolderWritable;
     bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
                      // tooltip may be shown when hovering an item.
+    bool m_selectNextItem;
 
     enum class LoadingState { Idle, Loading, Canceled, Completed };
     LoadingState m_loadingState = LoadingState::Idle;
@@ -918,9 +939,15 @@ private:
     bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
     QPoint m_restoredContentsPosition;
 
-    QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
+    // Used for tracking the accumulated scroll amount (for zooming with high
+    // resolution scroll wheels)
+    int m_controlWheelAccumulatedDelta;
+
+    QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5 and file operations
     bool m_clearSelectionBeforeSelectingNewItems;
     bool m_markFirstNewlySelectedItemAsCurrent;
+    /// Decides whether items created by jobs should automatically be selected.
+    bool m_selectJobCreatedItems;
 
     VersionControlObserver *m_versionControlObserver;
 
@@ -929,6 +956,9 @@ private:
     QLabel *m_placeholderLabel;
     QTimer *m_showLoadingPlaceholderTimer;
 
+    /// The information roleIndex of the list column header currently hovered
+    std::optional<int> m_hoveredColumnHeaderIndex;
+
     /// Used for selection mode. @see setSelectionMode()
     std::unique_ptr<QProxyStyle> m_proxyStyle;
 
@@ -937,6 +967,7 @@ private:
     friend class DolphinDetailsViewTest;
     friend class DolphinMainWindowTest;
     friend class DolphinPart; // Accesses m_model
+    void updateSelectionState();
 };
 
 /// Allow using DolphinView::Mode in QVariant