]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.h
dolphinui: Set view_mode action to low priority
[dolphin.git] / src / dolphincontextmenu.h
index 627a6e3b84838e87011c66742f6a6847010b0cc6..f60be558e8a087274bcd8ade34ad8c8464801774 100644 (file)
@@ -16,7 +16,6 @@
 
 class QAction;
 class DolphinMainWindow;
-class KFileItemActions;
 class KFileItemListProperties;
 class DolphinRemoveAction;
 
@@ -48,16 +47,16 @@ public:
      * @baseUrl       Base URL of the viewport where the context menu
      *                should be opened.
      */
-    DolphinContextMenu(DolphinMainWindowparent,
-                       const KFileItemfileInfo,
+    DolphinContextMenu(DolphinMainWindow *parent,
+                       const KFileItem &fileInfo,
                        const KFileItemList &selectedItems,
-                       const QUrlbaseUrl,
+                       const QUrl &baseUrl,
                        KFileItemActions *fileItemActions);
 
     ~DolphinContextMenu() override;
 
 protected:
-    bool eventFilter(QObject* object, QEvent* event) override;
+    bool eventFilter(QObject *object, QEvent *event) override;
 
 private:
     /**
@@ -72,13 +71,13 @@ private:
     void addItemContextMenu();
     void addViewportContextMenu();
 
-    void insertDefaultItemActions(const KFileItemListProperties&);
+    void insertDefaultItemActions(const KFileItemListProperties &);
 
-    bool placeExists(const QUrlurl) const;
+    bool placeExists(const QUrl &url) const;
 
-    QActioncreatePasteAction();
+    QAction *createPasteAction();
 
-    KFileItemListPropertiesselectedItemsProperties() const;
+    KFileItemListProperties &selectedItemsProperties() const;
 
     /**
      * Returns the file item for m_baseUrl.
@@ -96,42 +95,42 @@ private:
     void addAdditionalActions(const KFileItemListProperties &props);
 
 private:
-    struct Entry
-    {
+    void addDirectoryItemContextMenu();
+    void addOpenParentFolderActions();
+
+    struct Entry {
         int type;
         QString name;
-        QString filePath;     // empty for separator
+        QString filePath; // empty for separator
         QString templatePath; // same as filePath for template
         QString icon;
         QString comment;
     };
 
-    enum ContextType
-    {
+    enum ContextType {
         NoContext = 0,
         ItemContext = 1,
         TrashContext = 2,
         TimelineContext = 4,
         SearchContext = 8,
+        RecentlyUsedContext = 16,
     };
 
-    DolphinMainWindowm_mainWindow;
+    DolphinMainWindow *m_mainWindow;
 
     KFileItem m_fileInfo;
 
     QUrl m_baseUrl;
-    KFileItem* m_baseFileItem;  /// File item for m_baseUrl
+    KFileItem *m_baseFileItem; /// File item for m_baseUrl
 
     KFileItemList m_selectedItems;
-    mutable KFileItemListPropertiesm_selectedItemsProperties;
+    mutable KFileItemListProperties *m_selectedItemsProperties;
 
     int m_context;
     KFileCopyToMenu m_copyToMenu;
 
-    DolphinRemoveAction* m_removeAction; // Action that represents either 'Move To Trash' or 'Delete'
-    void addDirectoryItemContextMenu();
+    DolphinRemoveAction *m_removeAction; // Action that represents either 'Move To Trash' or 'Delete'
     KFileItemActions *m_fileItemActions;
-
 };
 
 #endif