diff options
| author | Christoph Cullmann <[email protected]> | 2024-07-03 18:56:16 +0200 |
|---|---|---|
| committer | Christoph Cullmann <[email protected]> | 2024-07-04 11:31:29 +0000 |
| commit | 638a0663a1a79230a870717e37cb48b9cb61062c (patch) | |
| tree | 1439d1a873b3322fb7b329e55904edea2d6d1a0e /src | |
| parent | 76c07954582032bcf714e543b590deda72b28612 (diff) | |
avoid need for activities lib
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | src/config-dolphin.h.cmake | 1 | ||||
| -rw-r--r-- | src/dolphinmainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/dolphinmainwindow.h | 3 | ||||
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 7 |
5 files changed, 9 insertions, 15 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe9ac1f45..6b1d9c7b0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/config-dolphin.h.cmake b/src/config-dolphin.h.cmake index 903b7e7db..05ae7d2f9 100644 --- a/src/config-dolphin.h.cmake +++ b/src/config-dolphin.h.cmake @@ -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 diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index bc88d643e..8bc066455 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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() diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 5f96ca3b6..5f2ed20ca 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -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; }; diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index fbad258ac..ce91dbfe8 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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) |
