]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/20.12'
authorNate Graham <nate@kde.org>
Tue, 24 Nov 2020 20:53:33 +0000 (13:53 -0700)
committerNate Graham <nate@kde.org>
Tue, 24 Nov 2020 20:53:33 +0000 (13:53 -0700)
.gitlab-ci.yml [new file with mode: 0644]
CMakeLists.txt
org.kde.dolphin.FileManager1.service.in [deleted file]
plasma-dolphin.service.in [new file with mode: 0644]
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/dolphinmainwindow.cpp
src/dolphinnavigatorswidgetaction.cpp
src/views/dolphinviewactionhandler.cpp

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..5dd9a93
--- /dev/null
@@ -0,0 +1,3 @@
+include:
+  - https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-before.yml
+  - https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-applications-linux.yml
index 5b76214fd614c74095a1034b54a9bc99876ddaba..dc682e2fbf2dbfe3acce9ef65d7f90ae125d6e25 100644 (file)
@@ -1,14 +1,14 @@
 cmake_minimum_required(VERSION 3.0)
 
 # KDE Application Version, managed by release script
-set (RELEASE_SERVICE_VERSION_MAJOR "20")
-set (RELEASE_SERVICE_VERSION_MINOR "11")
-set (RELEASE_SERVICE_VERSION_MICRO "80")
+set (RELEASE_SERVICE_VERSION_MAJOR "21")
+set (RELEASE_SERVICE_VERSION_MINOR "03")
+set (RELEASE_SERVICE_VERSION_MICRO "70")
 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
 project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
 
 set(QT_MIN_VERSION "5.14.0")
-set(KF5_MIN_VERSION "5.73.0")
+set(KF5_MIN_VERSION "5.77.0")
 
 # ECM setup
 find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
@@ -16,6 +16,8 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
 
 include(ECMSetupVersion)
 include(ECMGenerateHeaders)
+include(ECMGenerateDBusServiceFile)
+include(ECMConfiguredInstall)
 include(CMakePackageConfigHelpers)
 include(GenerateExportHeader)
 include(FeatureSummary)
@@ -166,10 +168,16 @@ install(FILES
     COMPONENT Devel
 )
 
-configure_file(org.kde.dolphin.FileManager1.service.in
-               ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service
-        DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
+ecm_generate_dbus_service_file(
+   NAME org.freedesktop.FileManager1
+   EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
+   SYSTEMD_SERVICE plasma-dolphin.service
+   DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
+   RENAME org.kde.dolphin.FileManager1.service
+)
+
+ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})
+
 install(FILES dolphin.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
 
 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/org.kde.dolphin.FileManager1.service.in b/org.kde.dolphin.FileManager1.service.in
deleted file mode 100644 (file)
index c1258bb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.FileManager1
-Exec=@CMAKE_INSTALL_PREFIX@/bin/dolphin --daemon
diff --git a/plasma-dolphin.service.in b/plasma-dolphin.service.in
new file mode 100644 (file)
index 0000000..d4cdd69
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Dolphin file manager
+PartOf=graphical-session.target
+
+[Service]
+ExecStart=@KDE_INSTALL_FULL_BINDIR@/dolphin --daemon
+BusName=org.freedesktop.FileManager1
+Slice=background.slice
index dcf4b9b45f789cc3ffc4ffe4ddd344f64701ca33..0c192de38a99e8db232246372e2b310aa5c99277 100644 (file)
@@ -61,6 +61,8 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
     // or the items itself. To increase the performance both lists are cached.
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
     m_selectedItems = view->selectedItems();
+
+    installEventFilter(this);
 }
 
 DolphinContextMenu::~DolphinContextMenu()
@@ -110,20 +112,28 @@ DolphinContextMenu::Command DolphinContextMenu::open()
     return m_command;
 }
 
-void DolphinContextMenu::keyPressEvent(QKeyEvent *ev)
+void DolphinContextMenu::childEvent(QChildEvent* event)
 {
-    if (m_removeAction && ev->key() == Qt::Key_Shift) {
-        m_removeAction->update(DolphinRemoveAction::ShiftState::Pressed);
+    if(event->added()) {
+        event->child()->installEventFilter(this);
     }
-    QMenu::keyPressEvent(ev);
+    QMenu::childEvent(event);
 }
 
-void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev)
+bool DolphinContextMenu::eventFilter(QObject* dest, QEvent* event)
 {
-    if (m_removeAction && ev->key() == Qt::Key_Shift) {
-        m_removeAction->update(DolphinRemoveAction::ShiftState::Released);
+    if(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
+        QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
+        if(m_removeAction && keyEvent->key() == Qt::Key_Shift) {
+            if(event->type() == QEvent::KeyPress) {
+                m_removeAction->update(DolphinRemoveAction::ShiftState::Pressed);
+            } else {
+                m_removeAction->update(DolphinRemoveAction::ShiftState::Released);
+            }
+            return true;
+        }
     }
-    QMenu::keyReleaseEvent(ev);
+    return QMenu::eventFilter(dest, event);
 }
 
 void DolphinContextMenu::openTrashContextMenu()
@@ -198,6 +208,7 @@ void DolphinContextMenu::addDirectoryItemContextMenu(KFileItemActions &fileItemA
      QMenu* menu = newFileMenu->menu();
      menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
      menu->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
+     menu->setParent(this, Qt::Popup);
      addMenu(menu);
 
      addSeparator();
@@ -271,21 +282,7 @@ void DolphinContextMenu::openItemContextMenu()
 
     insertDefaultItemActions(selectedItemsProps);
 
-    // insert 'Add to Places' entry if appropriate
-    if (m_selectedItems.count() == 1) {
-        if (m_fileInfo.isDir()) {
-            if (!placeExists(m_fileInfo.url())) {
-                addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
-            }
-        }
-    }
-
-    addSeparator();
-
-    fileItemActions.addServiceActionsTo(this);
-    fileItemActions.addPluginActionsTo(this);
-
-    addVersionControlPluginActions();
+    addAdditionalActions(fileItemActions, selectedItemsProps);
 
     // insert 'Copy To' and 'Move To' sub menus
     if (GeneralSettings::showCopyMoveMenu()) {
@@ -347,14 +344,7 @@ void DolphinContextMenu::openViewportContextMenu()
     addAction(m_mainWindow->actionCollection()->action(QStringLiteral("sort")));
     addAction(m_mainWindow->actionCollection()->action(QStringLiteral("view_mode")));
 
-    addSeparator();
-
-    // Insert service actions
-    fileItemActions.addServiceActionsTo(this);
-    fileItemActions.addPluginActionsTo(this);
-
-    addVersionControlPluginActions();
-
+    addAdditionalActions(fileItemActions, baseUrlProperties);
     addCustomActions();
 
     addSeparator();
@@ -383,11 +373,20 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
     }
     addAction(m_mainWindow->actionCollection()->action(QStringLiteral("duplicate")));
 
-    addSeparator();
-
     // Insert 'Rename'
     addAction(collection->action(KStandardAction::name(KStandardAction::RenameFile)));
 
+    // insert 'Add to Places' entry if appropriate
+    if (m_selectedItems.count() == 1) {
+        if (m_fileInfo.isDir()) {
+            if (!placeExists(m_fileInfo.url())) {
+                addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
+            }
+        }
+    }
+
+    addSeparator();
+
     // Insert 'Move to Trash' and/or 'Delete'
     const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
                                     !properties.isLocal());
@@ -485,8 +484,22 @@ void DolphinContextMenu::addOpenWithActions(KFileItemActions& fileItemActions)
     fileItemActions.addOpenWithActionsTo(this, QStringLiteral("DesktopEntryName != '%1'").arg(qApp->desktopFileName()));
 }
 
-void DolphinContextMenu::addVersionControlPluginActions()
+void DolphinContextMenu::addCustomActions()
 {
+    addActions(m_customActions);
+}
+
+void DolphinContextMenu::addAdditionalActions(KFileItemActions &fileItemActions, const KFileItemListProperties &props)
+{
+    addSeparator();
+
+    QList<QAction *> additionalActions;
+    if (props.isDirectory() && props.isLocal()) {
+        additionalActions << m_mainWindow->actionCollection()->action(QStringLiteral("open_terminal"));
+    }
+    fileItemActions.addServiceActionsTo(this, additionalActions);
+    fileItemActions.addPluginActionsTo(this);
+
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
     const QList<QAction*> versionControlActions = view->versionControlActions(m_selectedItems);
     if (!versionControlActions.isEmpty()) {
@@ -495,8 +508,3 @@ void DolphinContextMenu::addVersionControlPluginActions()
     }
 }
 
-void DolphinContextMenu::addCustomActions()
-{
-    addActions(m_customActions);
-}
-
index b93df2b612db8bacd4b95b4bb4b165a5a38ac45d..7f0b6988a682e25a265f0e3ef40621a440f48e41 100644 (file)
@@ -74,8 +74,8 @@ public:
     Command open();
 
 protected:
-    void keyPressEvent(QKeyEvent *ev) override;
-    void keyReleaseEvent(QKeyEvent *ev) override;
+    void childEvent(QChildEvent* event) override;
+    bool eventFilter(QObject* dest, QEvent* event) override;
 
 private:
     void openTrashContextMenu();
@@ -107,11 +107,6 @@ private:
      */
     void addOpenWithActions(KFileItemActions& fileItemActions);
 
-    /**
-     * Adds actions that are provided by a KVersionControlPlugin.
-     */
-    void addVersionControlPluginActions();
-
     /**
      * Adds custom actions e.g. like the "[x] Expandable Folders"-action
      * provided in the details view.
@@ -119,6 +114,11 @@ private:
     void addCustomActions();
 
 private:
+    /**
+     * Add services, custom actions, plugins and version control items to the menu
+     */
+    void addAdditionalActions(KFileItemActions &fileItemActions, const KFileItemListProperties &props);
+
     struct Entry
     {
         int type;
index b72f2eb90ced1460776083c148219163b9c1abd3..64268542d7af5606aa2cad3160f02c375245f997 100644 (file)
@@ -1628,7 +1628,7 @@ void DolphinMainWindow::setupActions()
         openTerminal->setWhatsThis(xi18nc("@info:whatsthis",
             "<para>This opens a <emphasis>terminal</emphasis> application for the viewed location.</para>"
             "<para>To learn more about terminals use the help in the terminal application.</para>"));
-        openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("dialog-scripts")));
+        openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal")));
         actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT + Qt::Key_F4);
         connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal);
 
index b8c77c69b1ab7c94a803aeba933b867fe9b954b9..cabeac4ed2cdc05439fe883b19750e82b5135494 100644 (file)
@@ -266,5 +266,5 @@ void DolphinNavigatorsWidgetAction::updateText()
 {
     const int urlNavigatorsAmount = m_splitter->count() > 1 && m_splitter->widget(1)->isVisible() ?
                                     2 : 1;
-    setText(i18ncp("@action:inmenu", "Url Navigator", "Url Navigators", urlNavigatorsAmount));
+    setText(i18ncp("@action:inmenu", "Location Bar", "Location Bars", urlNavigatorsAmount));
 }
index a2cb89a585f2458502ee967c06b81bca69c8089c..610b768c1366acc015994b2d91d5146e59592e47 100644 (file)
@@ -11,6 +11,7 @@
 #include "kitemviews/kfileitemmodel.h"
 #include "settings/viewpropertiesdialog.h"
 #include "views/zoomlevelinfo.h"
+#include "kconfig_version.h"
 
 #ifdef HAVE_BALOO
 #include <Baloo/IndexerConfig>
@@ -78,7 +79,7 @@ void DolphinViewActionHandler::createActions()
     // KNewFileMenu takes care of the GUI stuff.
     QAction* newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir"));
     newDirAction->setText(i18nc("@action", "Create Folder..."));
-    m_actionCollection->setDefaultShortcut(newDirAction, Qt::Key_F10);
+    m_actionCollection->setDefaultShortcuts(newDirAction, KStandardShortcut::createFolder());
     newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
     newDirAction->setEnabled(false);    // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
     connect(newDirAction, &QAction::triggered, this, &DolphinViewActionHandler::createDirectoryTriggered);