]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.h
Modernize: Use override where possible
[dolphin.git] / src / dolphincontextmenu.h
index 160f088040190ee3a2db4ebdb5957eee9f12fc6b..558115fb045587fb0ffcc5f158d25f11812c4512 100644 (file)
 #define DOLPHINCONTEXTMENU_H
 
 #include <KFileItem>
-#include <KService>
-#include <KUrl>
-#include <konq_copytomenu.h>
-#include <KMenu>
+#include <QUrl>
+#include <KFileCopyToMenu>
+#include <QMenu>
 
-#include <QObject>
 
-#include <QVector>
 
-#include <QScopedPointer>
 
 class QAction;
 class DolphinMainWindow;
@@ -50,7 +46,7 @@ class DolphinRemoveAction;
  * - 'Actions':   Contains all actions which can be applied to the
  *                given item.
  */
-class DolphinContextMenu : public KMenu
+class DolphinContextMenu : public QMenu
 {
     Q_OBJECT
 
@@ -58,6 +54,7 @@ public:
     enum Command
     {
         None,
+        OpenParentFolder,
         OpenParentFolderInNewWindow,
         OpenParentFolderInNewTab
     };
@@ -75,9 +72,9 @@ public:
     DolphinContextMenu(DolphinMainWindow* parent,
                        const QPoint& pos,
                        const KFileItem& fileInfo,
-                       const KUrl& baseUrl);
+                       const QUrl& baseUrl);
 
-    virtual ~DolphinContextMenu();
+    ~DolphinContextMenu() override;
 
     void setCustomActions(const QList<QAction*>& actions);
 
@@ -92,8 +89,8 @@ public:
     Command open();
 
 protected:
-    virtual void keyPressEvent(QKeyEvent *ev);
-    virtual void keyReleaseEvent(QKeyEvent *ev);
+    void keyPressEvent(QKeyEvent *ev) override;
+    void keyReleaseEvent(QKeyEvent *ev) override;
 
 private:
     void openTrashContextMenu();
@@ -101,7 +98,7 @@ private:
     void openItemContextMenu();
     void openViewportContextMenu();
 
-    void insertDefaultItemActions();
+    void insertDefaultItemActions(const KFileItemListProperties&);
 
     /**
      * Adds the "Show menubar" action to the menu if the
@@ -109,7 +106,7 @@ private:
      */
     void addShowMenuBarAction();
 
-    bool placeExists(const KUrl& url) const;
+    bool placeExists(const QUrl& url) const;
 
     QAction* createPasteAction();
 
@@ -126,11 +123,6 @@ private:
      */
     void addServiceActions(KFileItemActions& fileItemActions);
 
-    /**
-     * Adds actions that are provided by a KFileItemActionPlugin.
-     */
-    void addFileItemPluginActions();
-
     /**
      * Adds actions that are provided by a KVersionControlPlugin.
      */
@@ -165,14 +157,14 @@ private:
 
     KFileItem m_fileInfo;
 
-    KUrl m_baseUrl;
+    QUrl m_baseUrl;
     KFileItem* m_baseFileItem;  /// File item for m_baseUrl
 
     KFileItemList m_selectedItems;
     mutable KFileItemListProperties* m_selectedItemsProperties;
 
     int m_context;
-    KonqCopyToMenu m_copyToMenu;
+    KFileCopyToMenu m_copyToMenu;
     QList<QAction*> m_customActions;
 
     Command m_command;