diff options
30 files changed, 185 insertions, 71 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 47fe3dc47..33cb98b1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required(VERSION 3.0) # KDE Application Version, managed by release script -set (KDE_APPLICATIONS_VERSION_MAJOR "19") -set (KDE_APPLICATIONS_VERSION_MINOR "11") -set (KDE_APPLICATIONS_VERSION_MICRO "80") +set (KDE_APPLICATIONS_VERSION_MAJOR "20") +set (KDE_APPLICATIONS_VERSION_MINOR "03") +set (KDE_APPLICATIONS_VERSION_MICRO "70") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") project(Dolphin VERSION ${KDE_APPLICATIONS_VERSION}) set(QT_MIN_VERSION "5.11.0") -set(KF5_MIN_VERSION "5.63.0") +set(KF5_MIN_VERSION "5.64.0") # ECM setup find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) @@ -70,7 +70,7 @@ find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Activities ) set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities libraries" - URL "http://www.kde.org" + URL "https://www.kde.org" TYPE OPTIONAL PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop" ) @@ -79,14 +79,14 @@ find_package(Phonon4Qt5 CONFIG REQUIRED) find_package(KF5Baloo ${KF5_MIN_VERSION}) set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries" - URL "http://www.kde.org" + URL "https://www.kde.org" TYPE OPTIONAL PURPOSE "For adding desktop-wide search and tagging support to dolphin" ) find_package(KF5BalooWidgets 19.07.70) set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets" - URL "http://www.kde.org" + URL "https://www.kde.org" TYPE OPTIONAL ) diff --git a/doc/index.docbook b/doc/index.docbook index d2c06c6a0..71ac3cfc2 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -2020,6 +2020,17 @@ for this action.</para></listitem> <varlistentry> <term><menuchoice> +<shortcut> +<keycombo action="simul">&Ctrl;&Shift;<keycap>F</keycap></keycombo> +</shortcut> +<guimenu>Tools</guimenu> +<guimenuitem>Open Preferred Search Tool</guimenuitem> +</menuchoice></term> +<listitem><para><action>Opens preferred search tool in the current folder.</action></para></listitem> +</varlistentry> + +<varlistentry> +<term><menuchoice> <guimenu>Tools</guimenu> <guimenuitem>Compare Files</guimenuitem> </menuchoice></term> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 617d59480..e240f7106 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -301,9 +301,10 @@ ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS}) kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS}) -target_link_libraries(kdeinit_dolphin PRIVATE - dolphinstatic +target_link_libraries(kdeinit_dolphin PUBLIC dolphinprivate + PRIVATE + dolphinstatic KF5::Crash ) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e28b18cd3..e615fbab8 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -57,6 +57,7 @@ #include <KJobWidgets> #include <KLocalizedString> #include <KMessageBox> +#include <KNS3/KMoreToolsMenuFactory> #include <KProtocolInfo> #include <KProtocolManager> #include <KRun> @@ -197,6 +198,8 @@ DolphinMainWindow::DolphinMainWindow() : toolBar()->installEventFilter(middleClickEventFilter); setupWhatsThis(); + + QTimer::singleShot(0, this, &DolphinMainWindow::setupUpdateOpenPreferredSearchToolAction); } DolphinMainWindow::~DolphinMainWindow() @@ -933,23 +936,88 @@ void DolphinMainWindow::toggleShowMenuBar() } } -void DolphinMainWindow::openTerminal() +QString DolphinMainWindow::activeContainerLocalPath() { - QString dir(QDir::homePath()); - - // If the given directory is not local, it can still be the URL of an - // ioslave using UDS_LOCAL_PATH which to be converted first. KIO::StatJob* statJob = KIO::mostLocalUrl(m_activeViewContainer->url()); KJobWidgets::setWindow(statJob, this); statJob->exec(); QUrl url = statJob->mostLocalUrl(); - - //If the URL is local after the above conversion, set the directory. if (url.isLocalFile()) { - dir = url.toLocalFile(); + return url.toLocalFile(); + } + return QDir::homePath(); +} + +QPointer<QAction> DolphinMainWindow::preferredSearchTool() +{ + m_searchTools.clear(); + KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames( + &m_searchTools, { "files-find" }, QUrl::fromLocalFile(activeContainerLocalPath()) + ); + QList<QAction*> actions = m_searchTools.actions(); + if (actions.isEmpty()) { + return nullptr; + } + QAction* action = actions.first(); + if (action->isSeparator()) { + return nullptr; + } + return action; +} + +void DolphinMainWindow::setupUpdateOpenPreferredSearchToolAction() +{ + QAction* openPreferredSearchTool = actionCollection()->action(QStringLiteral("open_preferred_search_tool")); + const QList<QWidget*> widgets = openPreferredSearchTool->associatedWidgets(); + for (QWidget* widget : widgets) { + QMenu* menu = qobject_cast<QMenu*>(widget); + if (menu) { + connect(menu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); + } } - KToolInvocation::invokeTerminal(QString(), dir); + // Update the open_preferred_search_tool action *before* the Configure Shortcuts window is shown, + // since this action is then listed in that window and it should be up-to-date when it is displayed. + // This update is instantaneous if user made no changes to the search tools in the meantime. + // Maybe all KStandardActions should defer calls to their slots, so that we could simply connect() to trigger()? + connect( + actionCollection()->action(KStandardAction::name(KStandardAction::KeyBindings)), &QAction::hovered, + this, &DolphinMainWindow::updateOpenPreferredSearchToolAction + ); + + updateOpenPreferredSearchToolAction(); +} + +void DolphinMainWindow::updateOpenPreferredSearchToolAction() +{ + QAction* openPreferredSearchTool = actionCollection()->action(QStringLiteral("open_preferred_search_tool")); + if (!openPreferredSearchTool) { + return; + } + QPointer<QAction> tool = preferredSearchTool(); + if (tool) { + openPreferredSearchTool->setVisible(true); + openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open %1", tool->text())); + openPreferredSearchTool->setIcon(tool->icon()); + } else { + openPreferredSearchTool->setVisible(false); + // still visible in Shortcuts configuration window + openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open Preferred Search Tool")); + openPreferredSearchTool->setIcon(QIcon::fromTheme(QStringLiteral("search"))); + } +} + +void DolphinMainWindow::openPreferredSearchTool() +{ + QPointer<QAction> tool = preferredSearchTool(); + if (tool) { + tool->trigger(); + } +} + +void DolphinMainWindow::openTerminal() +{ + KToolInvocation::invokeTerminal(QString(), activeContainerLocalPath()); } void DolphinMainWindow::editSettings() @@ -1091,7 +1159,9 @@ void DolphinMainWindow::updateControlMenu() // Add a curated assortment of items from the "Tools" menu addActionToMenu(ac->action(QStringLiteral("show_filter_bar")), menu); + addActionToMenu(ac->action(QStringLiteral("open_preferred_search_tool")), menu); addActionToMenu(ac->action(QStringLiteral("open_terminal")), menu); + connect(menu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); menu->addSeparator(); @@ -1465,6 +1535,15 @@ void DolphinMainWindow::setupActions() compareFiles->setEnabled(false); connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles); + QAction* openPreferredSearchTool = actionCollection()->addAction(QStringLiteral("open_preferred_search_tool")); + openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open Preferred Search Tool")); + openPreferredSearchTool->setWhatsThis(xi18nc("@info:whatsthis", + "<para>This opens a preferred search tool for the viewed location.</para>" + "<para>Use <emphasis>More Search Tools</emphasis> menu to configure it.</para>")); + openPreferredSearchTool->setIcon(QIcon::fromTheme(QStringLiteral("search"))); + actionCollection()->setDefaultShortcut(openPreferredSearchTool, Qt::CTRL + Qt::SHIFT + Qt::Key_F); + connect(openPreferredSearchTool, &QAction::triggered, this, &DolphinMainWindow::openPreferredSearchTool); + #ifdef HAVE_TERMINAL if (KAuthorized::authorize(QStringLiteral("shell_access"))) { QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal")); @@ -2207,6 +2286,8 @@ bool DolphinMainWindow::event(QEvent *event) QWhatsThisClickedEvent* whatsThisEvent = dynamic_cast<QWhatsThisClickedEvent*>(event); QDesktopServices::openUrl(QUrl(whatsThisEvent->href())); return true; + } else if (event->type() == QEvent::WindowActivate) { + updateOpenPreferredSearchToolAction(); } return KXmlGuiWindow::event(event); } diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 3d86340d6..0520e1091 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -30,6 +30,7 @@ #include <QIcon> #include <QList> +#include <QMenu> #include <QPointer> #include <QUrl> #include <QVector> @@ -352,6 +353,15 @@ private slots: */ void toggleShowMenuBar(); + /** Sets up updates for "Open Preferred Search Tool" action. */ + void setupUpdateOpenPreferredSearchToolAction(); + + /** Updates "Open Preferred Search Tool" action. */ + void updateOpenPreferredSearchToolAction(); + + /** Opens preferred search tool for the current location. */ + void openPreferredSearchTool(); + /** Opens a terminal window for the current location. */ void openTerminal(); @@ -597,6 +607,15 @@ private: /** Adds "What's This?" texts to many widgets and StandardActions. */ void setupWhatsThis(); + /** + * Returns the KIO::StatJob::mostLocalUrl() for the active container URL + * if it's a local file. Otherwise returns the user's home path. + */ + QString activeContainerLocalPath(); + + /** Returns preferred search tool as configured in "More Search Tools" menu. */ + QPointer<QAction> preferredSearchTool(); + private: /** * Implements a custom error handling for the undo manager. This @@ -633,6 +652,9 @@ private: KToolBarPopupAction* m_backAction; KToolBarPopupAction* m_forwardAction; + + QMenu m_searchTools; + }; inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 607917f9a..dc083f1a5 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -40,6 +40,7 @@ #include <KLocalizedString> #include <KMessageBox> #include <KMimeTypeEditor> +#include <KNS3/KMoreToolsMenuFactory> #include <KPluginFactory> #include <KRun> #include <KSharedConfig> @@ -553,7 +554,16 @@ void DolphinPart::slotOpenTerminal() void DolphinPart::slotFindFile() { - KRun::run(QStringLiteral("kfind"), {url()}, widget()); + QMenu searchTools; + KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames( + &searchTools, { "files-find" }, QUrl::fromLocalFile(KParts::ReadOnlyPart::localFilePath()) + ); + QList<QAction*> actions = searchTools.actions(); + if (!(actions.isEmpty())) { + actions.first()->trigger(); + } else { + KRun::run(QStringLiteral("kfind"), {url()}, widget()); + } } void DolphinPart::updateNewMenu() diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 864c08344..fe8f2d14e 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -194,7 +194,7 @@ private Q_SLOTS: void slotOpenTerminal(); /** - * Open KFind with the current path. + * Open preferred search tool in the current directory to find files. */ void slotFindFile(); diff --git a/src/dolphinui.rc b/src/dolphinui.rc index dcacc56c4..4de1c609c 100644 --- a/src/dolphinui.rc +++ b/src/dolphinui.rc @@ -1,5 +1,5 @@ <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> -<kpartgui name="dolphin" version="27"> +<kpartgui name="dolphin" version="28"> <MenuBar> <Menu name="file"> <Action name="new_menu" /> @@ -54,6 +54,7 @@ </Menu> <Menu name="tools"> <Action name="show_filter_bar" /> + <Action name="open_preferred_search_tool" /> <Action name="open_terminal" /> <Action name="compare_files" /> <Action name="change_remote_encoding" /> diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 2deba5466..a3cafc838 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistcontainer.h b/src/kitemviews/kitemlistcontainer.h index c5ef85563..9fcb88969 100644 --- a/src/kitemviews/kitemlistcontainer.h +++ b/src/kitemviews/kitemlistcontainer.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index a80869dfc..65c42b547 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -2,8 +2,7 @@ * Copyright (C) 2011 by Peter Penz <[email protected]> * * Copyright (C) 2012 by Frank Reininghaus <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index b21e50735..6d9b2ac6a 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistgroupheader.cpp b/src/kitemviews/kitemlistgroupheader.cpp index 9689180d1..d78088ce7 100644 --- a/src/kitemviews/kitemlistgroupheader.cpp +++ b/src/kitemviews/kitemlistgroupheader.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistselectionmanager.cpp b/src/kitemviews/kitemlistselectionmanager.cpp index 1b4f7db45..6bee19414 100644 --- a/src/kitemviews/kitemlistselectionmanager.cpp +++ b/src/kitemviews/kitemlistselectionmanager.cpp @@ -2,8 +2,7 @@ * Copyright (C) 2011 by Peter Penz <[email protected]> * * Copyright (C) 2011 by Frank Reininghaus <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistselectionmanager.h b/src/kitemviews/kitemlistselectionmanager.h index 6f5710006..6b0435139 100644 --- a/src/kitemviews/kitemlistselectionmanager.h +++ b/src/kitemviews/kitemlistselectionmanager.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 53682461a..5dd21615e 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 9349e5003..982df1c20 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index c33335ae6..c3c54a06c 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemlistwidget.h b/src/kitemviews/kitemlistwidget.h index 433048aa0..66b2da069 100644 --- a/src/kitemviews/kitemlistwidget.h +++ b/src/kitemviews/kitemlistwidget.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemmodelbase.cpp b/src/kitemviews/kitemmodelbase.cpp index 9cbcbf3c0..faabdbe1d 100644 --- a/src/kitemviews/kitemmodelbase.cpp +++ b/src/kitemviews/kitemmodelbase.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemmodelbase.h b/src/kitemviews/kitemmodelbase.h index f1945de06..a6ba3f7c4 100644 --- a/src/kitemviews/kitemmodelbase.h +++ b/src/kitemviews/kitemmodelbase.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kitemrange.h b/src/kitemviews/kitemrange.h index 6453f2154..f62305a39 100644 --- a/src/kitemviews/kitemrange.h +++ b/src/kitemviews/kitemrange.h @@ -2,8 +2,7 @@ * Copyright (C) 2011 by Peter Penz <[email protected]> * * Copyright (C) 2013 by Frank Reininghaus <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/kstandarditemlistgroupheader.cpp b/src/kitemviews/kstandarditemlistgroupheader.cpp index 015362e3f..062b20e90 100644 --- a/src/kitemviews/kstandarditemlistgroupheader.cpp +++ b/src/kitemviews/kstandarditemlistgroupheader.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index 8a2a64b31..0f7100faa 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -81,7 +81,12 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f std::for_each(rangeBegin, rangeEnd, [&list](const entry& s) { list.append(s.second); }); values.insert(role, propertyInfo.formatAsDisplayString(list)); } else { - values.insert(role, propertyInfo.formatAsDisplayString((*rangeBegin).second)); + if (propertyInfo.valueType() == QVariant::DateTime) { + // Let dolphin format later Dates + values.insert(role, (*rangeBegin).second); + } else { + values.insert(role, propertyInfo.formatAsDisplayString((*rangeBegin).second)); + } } rangeBegin = rangeEnd; } diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp index 5256f69ca..1fa6f7a7b 100644 --- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp +++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Tirtha Chatterjee <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.h b/src/kitemviews/private/kitemlistkeyboardsearchmanager.h index 9995c16b0..d0161f927 100644 --- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.h +++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.h @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2011 by Tirtha Chatterjee <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -76,7 +75,7 @@ signals: * current item. */ // TODO: Think about getting rid of the bool parameter - // (see http://doc.qt.nokia.com/qq/qq13-apis.html#thebooleanparametertrap) + // (see https://doc.qt.io/archives/qq/qq13-apis.html#thebooleanparametertrap) void changeCurrentItem(const QString& string, bool searchFromNextItem); private: diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index e6c3bf32a..23e7f1922 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -290,8 +290,8 @@ void InformationPanel::reset() void InformationPanel::slotFileRenamed(const QString& source, const QString& dest) { - if (m_shownUrl == QUrl::fromLocalFile(source)) { - m_shownUrl = QUrl::fromLocalFile(dest); + if (m_shownUrl == QUrl::fromUserInput(source)) { + m_shownUrl = QUrl::fromUserInput(dest); m_fileItem = KFileItem(m_shownUrl); if ((m_selection.count() == 1) && (m_selection[0].url() == QUrl::fromLocalFile(source))) { @@ -308,10 +308,10 @@ void InformationPanel::slotFileRenamed(const QString& source, const QString& des void InformationPanel::slotFilesAdded(const QString& directory) { - if (m_shownUrl == QUrl::fromLocalFile(directory)) { + if (m_shownUrl == QUrl::fromUserInput(directory)) { // If the 'trash' icon changes because the trash has been emptied or got filled, // the signal filesAdded("trash:/") will be emitted. - KFileItem item(QUrl::fromLocalFile(directory)); + KFileItem item(QUrl::fromUserInput(directory)); requestDelayedItemInfo(item); } } @@ -319,7 +319,7 @@ void InformationPanel::slotFilesAdded(const QString& directory) void InformationPanel::slotFilesChanged(const QStringList& files) { for (const QString& fileName : files) { - if (m_shownUrl == QUrl::fromLocalFile(fileName)) { + if (m_shownUrl == QUrl::fromUserInput(fileName)) { showItemInfo(); break; } @@ -329,7 +329,7 @@ void InformationPanel::slotFilesChanged(const QStringList& files) void InformationPanel::slotFilesRemoved(const QStringList& files) { for (const QString& fileName : files) { - if (m_shownUrl == QUrl::fromLocalFile(fileName)) { + if (m_shownUrl == QUrl::fromUserInput(fileName)) { // the currently shown item has been removed, show // the parent directory as fallback markUrlAsInvalid(); @@ -340,15 +340,15 @@ void InformationPanel::slotFilesRemoved(const QStringList& files) void InformationPanel::slotEnteredDirectory(const QString& directory) { - if (m_shownUrl == QUrl::fromLocalFile(directory)) { - KFileItem item(QUrl::fromLocalFile(directory)); + if (m_shownUrl == QUrl::fromUserInput(directory)) { + KFileItem item(QUrl::fromUserInput(directory)); requestDelayedItemInfo(item); } } void InformationPanel::slotLeftDirectory(const QString& directory) { - if (m_shownUrl == QUrl::fromLocalFile(directory)) { + if (m_shownUrl == QUrl::fromUserInput(directory)) { // The signal 'leftDirectory' is also emitted when a media // has been unmounted. In this case no directory change will be // done in Dolphin, but the Information Panel must be updated to diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 417ca709c..5c1b7ae22 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -166,12 +166,13 @@ InformationPanelContent::~InformationPanelContent() void InformationPanelContent::showItem(const KFileItem& item) { - if (item != m_item) { + // compares item entries, comparing items only compares urls + if (m_item.entry() != item.entry()) { m_item = item; - m_preview->stopAnimatedImage(); refreshMetaData(); } + refreshPreview(); } diff --git a/src/panels/places/placesitemlistgroupheader.cpp b/src/panels/places/placesitemlistgroupheader.cpp index 884859d5b..dbd055f36 100644 --- a/src/panels/places/placesitemlistgroupheader.cpp +++ b/src/panels/places/placesitemlistgroupheader.cpp @@ -1,8 +1,7 @@ /*************************************************************************** * Copyright (C) 2012 by Peter Penz <[email protected]> * * * - * Based on the Itemviews NG project from Trolltech Labs: * - * http://qt.gitorious.org/qt-labs/itemviews-ng * + * Based on the Itemviews NG project from Trolltech Labs * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/settings/general/configurepreviewplugindialog.cpp b/src/settings/general/configurepreviewplugindialog.cpp index 60e814c13..bc3cca706 100644 --- a/src/settings/general/configurepreviewplugindialog.cpp +++ b/src/settings/general/configurepreviewplugindialog.cpp @@ -66,7 +66,7 @@ ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& plugin // delete the whole thumbnails directory. previewPlugin->writeConfiguration(configurationWidget); - // http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DIRECTORY + // https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DIRECTORY const QString thumbnailsPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/thumbnails/"); KIO::del(QUrl::fromLocalFile(thumbnailsPath), KIO::HideProgressInfo); }); |
