]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Move Safely Remove down in places context menu
authorTigran Gabrielyan <tigrangab@gmail.com>
Sun, 24 Mar 2019 17:30:27 +0000 (11:30 -0600)
committerNate Graham <nate@kde.org>
Sun, 24 Mar 2019 17:31:13 +0000 (11:31 -0600)
Summary: BUG: 405620

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: elvisangelaccio, ngraham, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D19950

src/panels/places/placespanel.cpp

index d0dbcce88b7fb2224e09c2c5adea904eb04424a3..224eb0c64da52337faf41b341cb3e385e72b97a2 100644 (file)
@@ -175,6 +175,22 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
 
     const bool isDevice = !item->udi().isEmpty();
     const bool isTrash = (item->url().scheme() == QLatin1String("trash"));
+    if (isTrash) {
+        emptyTrashAction = menu.addAction(QIcon::fromTheme(QStringLiteral("trash-empty")), i18nc("@action:inmenu", "Empty Trash"));
+        emptyTrashAction->setEnabled(item->icon() == QLatin1String("user-trash-full"));
+        menu.addSeparator();
+    }
+
+    QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@item:inmenu", "Open in New Window"));
+    QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@item:inmenu", "Open in New Tab"));
+    QAction* propertiesAction = nullptr;
+    if (item->url().isLocalFile()) {
+        propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties"));
+    }
+    if (!isDevice && !isTrash) {
+        menu.addSeparator();
+    }
+    
     if (isDevice) {
         ejectAction = m_model->ejectAction(index);
         if (ejectAction) {
@@ -205,22 +221,6 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
         if (teardownAction || ejectAction || mountAction) {
             menu.addSeparator();
         }
-    } else {
-        if (isTrash) {
-            emptyTrashAction = menu.addAction(QIcon::fromTheme(QStringLiteral("trash-empty")), i18nc("@action:inmenu", "Empty Trash"));
-            emptyTrashAction->setEnabled(item->icon() == QLatin1String("user-trash-full"));
-            menu.addSeparator();
-        }
-    }
-
-    QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@item:inmenu", "Open in New Window"));
-    QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@item:inmenu", "Open in New Tab"));
-    QAction* propertiesAction = nullptr;
-    if (item->url().isLocalFile()) {
-        propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties"));
-    }
-    if (!isDevice && !isTrash) {
-        menu.addSeparator();
     }
 
     if (!isDevice) {