]> cloud.milkyroute.net Git - dolphin.git/commitdiff
avoid need for activities lib
authorChristoph Cullmann <christoph@cullmann.io>
Wed, 3 Jul 2024 16:56:16 +0000 (18:56 +0200)
committerChristoph Cullmann <christoph@cullmann.io>
Thu, 4 Jul 2024 11:31:29 +0000 (11:31 +0000)
use KRecentFilesAction like Kate and others to signal used
files/dirs

could later be used to plug-in a recently used menu, too,
if ever wanted

avoids that this dependency could be missed and the functionality
is not there, too

CMakeLists.txt
src/CMakeLists.txt
src/config-dolphin.h.cmake
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinviewcontainer.cpp

index d7f1cb57af8497ca4103bb275ae774bb0cc9fd98..6a17bf6ee9ca548f66a7d37120c30796fc7e8a93 100644 (file)
@@ -91,12 +91,6 @@ endif()
 find_package(KF6 ${KF6_MIN_VERSION} OPTIONAL_COMPONENTS
     DocTools
 )
-find_package(PlasmaActivities)
-set_package_properties(PlasmaActivities PROPERTIES DESCRIPTION "PlasmaActivities libraries"
-                       URL "https://www.kde.org"
-                       TYPE OPTIONAL
-                       PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
-                      )
 
 find_package(Phonon4Qt6 CONFIG REQUIRED)
 
@@ -130,10 +124,6 @@ set_package_properties(KF6FileMetaData PROPERTIES
                        PURPOSE "For accessing file metadata labels"
                       )
 
-if (PlasmaActivities_FOUND)
-    set(HAVE_PLASMA_ACTIVITIES TRUE)
-endif()
-
 if (KF6Baloo_FOUND AND KF6BalooWidgets_FOUND AND KF6FileMetaData_FOUND)
     message(STATUS "Baloo packages are found")
     set(HAVE_BALOO TRUE)
index fe9ac1f45149d78dae4b35bbc17fd4bed4e977ad..6b1d9c7b062931822d0d4e7af543fff58f6783a4 100644 (file)
@@ -455,13 +455,6 @@ target_link_libraries(dolphinstatic
     Phonon::phonon4qt6
 )
 
-if (HAVE_PLASMA_ACTIVITIES)
-    target_link_libraries(
-        dolphinstatic
-        Plasma::Activities
-    )
-endif()
-
 if(HAVE_PACKAGEKIT)
     target_link_libraries(
         dolphinstatic
index 903b7e7db96ad678ff0a1f04c11d7ea3ff385991..05ae7d2f97f5f6eff8c4be5338ad14892207bb98 100644 (file)
@@ -1,6 +1,5 @@
 /** Set whether to build Dolphin with support for these technologies or not. */
 #cmakedefine01 HAVE_BALOO
-#cmakedefine01 HAVE_PLASMA_ACTIVITIES
 #cmakedefine01 HAVE_KUSERFEEDBACK
 #cmakedefine01 HAVE_PACKAGEKIT
 #cmakedefine01 HAVE_TERMINAL
index bc88d643ec88a20570b3be3a937f71740db1d683..8bc066455ea1a2cd7d2ddb1e6001737e7461c9e8 100644 (file)
@@ -53,6 +53,7 @@
 #include <KMessageBox>
 #include <KProtocolInfo>
 #include <KProtocolManager>
+#include <KRecentFilesAction>
 #include <KShell>
 #include <KShortcutsDialog>
 #include <KStandardAction>
@@ -365,6 +366,9 @@ void DolphinMainWindow::changeUrl(const QUrl &url)
     updateViewActions();
     updateGoActions();
 
+    // will signal used urls to activities manager, too
+    m_recentFiles->addUrl(url);
+
     Q_EMIT urlChanged(url);
 }
 
@@ -2157,6 +2161,8 @@ void DolphinMainWindow::setupActions()
     connect(openInSplitViewAction, &QAction::triggered, this, [this]() {
         openInSplitView(QUrl());
     });
+
+    m_recentFiles = new KRecentFilesAction(this);
 }
 
 void DolphinMainWindow::setupDockWidgets()
index 5f96ca3b621fbb04ea7cabbd870513c6f39df468..5f2ed20ca6547c5e78ba6412a1172178e8bba8cc 100644 (file)
@@ -42,6 +42,7 @@ class KFileItem;
 class KFileItemList;
 class KJob;
 class KNewFileMenu;
+class KRecentFilesAction;
 class KToolBarPopupAction;
 class QToolButton;
 class PlacesPanel;
@@ -759,6 +760,8 @@ private:
 
     KIO::CommandLauncherJob *m_job;
 
+    KRecentFilesAction *m_recentFiles = nullptr;
+
     friend class DolphinMainWindowTest;
 };
 
index fbad258ace5fd26067b0e22e71dd28b2d6e7b0b8..ce91dbfe85a52cc5f337d3660628bfcdda4e812b 100644 (file)
@@ -21,9 +21,6 @@
 #include "statusbar/dolphinstatusbar.h"
 
 #include <KActionCollection>
-#if HAVE_PLASMA_ACTIVITIES
-#include <PlasmaActivities/ResourceInstance>
-#endif
 #include <KApplicationTrader>
 #include <KFileItemActions>
 #include <KFilePlacesModel>
@@ -570,10 +567,6 @@ void DolphinViewContainer::setUrl(const QUrl &newUrl)
     if (newUrl != m_urlNavigator->locationUrl()) {
         m_urlNavigator->setLocationUrl(newUrl);
     }
-
-#if HAVE_PLASMA_ACTIVITIES
-    KActivities::ResourceInstance::notifyAccessed(newUrl);
-#endif
 }
 
 void DolphinViewContainer::setFilterBarVisible(bool visible)