]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/20.04'
authorAlexander Lohnau <alexander.lohnau@gmx.de>
Tue, 21 Apr 2020 19:32:46 +0000 (21:32 +0200)
committerAlexander Lohnau <alexander.lohnau@gmx.de>
Tue, 21 Apr 2020 19:32:46 +0000 (21:32 +0200)
22 files changed:
.gitignore
CMakeLists.txt
src/CMakeLists.txt
src/dbusinterface.h
src/dolphinbookmarkhandler.cpp
src/dolphinmainwindow.cpp
src/dolphinpart.cpp
src/dolphintabwidget.cpp
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/global.cpp
src/kitemviews/kitemlistcontroller.cpp
src/org.kde.dolphin.appdata.xml
src/panels/information/informationpanel.cpp
src/panels/information/informationpanelcontent.cpp
src/panels/terminal/org.kde.KIOFuse.VFS.xml [new file with mode: 0644]
src/panels/terminal/terminalpanel.cpp
src/panels/terminal/terminalpanel.h
src/search/dolphinsearchbox.cpp
src/search/dolphinsearchbox.h
src/views/dolphinview.cpp
src/views/dolphinviewactionhandler.cpp

index c48f92390db5edc685e822fdc67e9900d4765815..6c1df4de47c08cbf08b9eb3526c4e24e5cdd105b 100644 (file)
@@ -4,3 +4,4 @@ CMakeLists.txt.user
 .directory
 *.kdev4
 /build*/
+.cmake/
index 68ca540867d1eba456cf8045df1de78391642448..3a30b69836ecea5199bc78e9ab62332ad807bf90 100644 (file)
@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.0)
 
 # KDE Application Version, managed by release script
 set (RELEASE_SERVICE_VERSION_MAJOR "20")
-set (RELEASE_SERVICE_VERSION_MINOR "04")
-set (RELEASE_SERVICE_VERSION_MICRO "0")
+set (RELEASE_SERVICE_VERSION_MINOR "07")
+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.11.0")
-set(KF5_MIN_VERSION "5.67.0")
+set(KF5_MIN_VERSION "5.70.0")
 
 # ECM setup
 find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
index 02a43a2094270a53c572b2dc5bddf70862cbe4bf..fc7b33cbd4a78bd4881e213341c5cea4ff92c724 100644 (file)
@@ -272,6 +272,7 @@ qt5_add_resources(dolphinstatic_SRCS dolphin.qrc)
 qt5_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dolphinmainwindow.h org.kde.DolphinMainWindow.xml)
 qt5_add_dbus_adaptor(dolphinstatic_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindow.h DolphinMainWindow)
 qt5_add_dbus_interface(dolphinstatic_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindowinterface)
+qt5_add_dbus_interface(dolphinstatic_SRCS panels/terminal/org.kde.KIOFuse.VFS.xml kiofuse_interface)
 
 add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
 
index 391916d6271998150ed9566aa27bc12eeec6b708..c1029ea23c516a5dd3f92ed615224813a6c16964 100644 (file)
@@ -34,12 +34,12 @@ public:
     Q_SCRIPTABLE void ShowItemProperties(const QStringList& uriList, const QString& startUpId);
 
     /**
-     * Set whether this interface has been created by dolphin --deamon.
+     * Set whether this interface has been created by dolphin --daemon.
      */
     void setAsDaemon();
 
     /**
-     * @return Whether this interface has been created by dolphin --deamon.
+     * @return Whether this interface has been created by dolphin --daemon.
      */
     bool isDaemon() const;
 
index ded83d6bb9c87967a95980e1403be1825166201e..0d31b8984d56a76af46840027a8f70fb427f7593 100644 (file)
@@ -21,6 +21,7 @@
 #include "dolphinmainwindow.h"
 #include "dolphinviewcontainer.h"
 #include "global.h"
+#include <KActionCollection>
 #include <KBookmarkMenu>
 #include <KIO/Global>
 #include <QDebug>
@@ -47,7 +48,11 @@ DolphinBookmarkHandler::DolphinBookmarkHandler(DolphinMainWindow *mainWindow,
     }
     m_bookmarkManager = KBookmarkManager::managerForFile(bookmarksFile, QStringLiteral("dolphin"));
     m_bookmarkManager->setUpdate(true);
-    m_bookmarkMenu.reset(new KBookmarkMenu(m_bookmarkManager, this, menu, collection));
+    m_bookmarkMenu.reset(new KBookmarkMenu(m_bookmarkManager, this, menu));
+
+    collection->addAction(QStringLiteral("add_bookmark"), m_bookmarkMenu->addBookmarkAction());
+    collection->addAction(QStringLiteral("edit_bookmarks"), m_bookmarkMenu->editBookmarksAction());
+    collection->addAction(QStringLiteral("add_bookmarks_list"), m_bookmarkMenu->bookmarkTabsAsFolderAction());
 }
 
 DolphinBookmarkHandler::~DolphinBookmarkHandler()
index f88bc3f44f1ac2a4e24fb5b96b3a48c6ad82192a..37f6bb8e461f43a6e686e23e74e105f8af5f9f9c 100644 (file)
@@ -53,6 +53,7 @@
 #include <KDualAction>
 #include <KFileItemListProperties>
 #include <KHelpMenu>
+#include <KIO/CommandLauncherJob>
 #include <KIO/JobUiDelegate>
 #include <KIO/OpenFileManagerWindowJob>
 #include <KJobWidgets>
@@ -926,7 +927,10 @@ void DolphinMainWindow::compareFiles()
     command.append("\" \"");
     command.append(urlB.toDisplayString(QUrl::PreferLocalFile));
     command.append('\"');
-    KRun::runCommand(command, QStringLiteral("Kompare"), QStringLiteral("kompare"), this);
+
+    KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(command, this);
+    job->setDesktopName(QStringLiteral("org.kde.kompare"));
+    job->start();
 }
 
 void DolphinMainWindow::toggleShowMenuBar()
@@ -1265,7 +1269,7 @@ void DolphinMainWindow::tabCountChanged(int count)
 
 void DolphinMainWindow::updateWindowTitle()
 {
-    const QString newTitle = m_activeViewContainer->caption();
+    const QString newTitle = m_activeViewContainer->captionWindowTitle();
     if (windowTitle() != newTitle) {
         setWindowTitle(newTitle);
     }
index 7e7425121ca81105c7016630a2b6d9289550d5d6..0c41b2becaeecab1fac93cde86fc143978818ac1 100644 (file)
@@ -34,6 +34,7 @@
 #include <KActionCollection>
 #include <KAuthorized>
 #include <KConfigGroup>
+#include <KDialogJobUiDelegate>
 #include <KFileItemListProperties>
 #include <KIconLoader>
 #include <KJobWidgets>
@@ -42,7 +43,7 @@
 #include <KMimeTypeEditor>
 #include <KNS3/KMoreToolsMenuFactory>
 #include <KPluginFactory>
-#include <KRun>
+#include <KIO/CommandLauncherJob>
 #include <KSharedConfig>
 #include <KToolInvocation>
 
@@ -546,7 +547,10 @@ void DolphinPart::slotFindFile()
     if (!(actions.isEmpty())) {
         actions.first()->trigger();
     } else {
-        KRun::run(QStringLiteral("kfind"), {url()}, widget());
+        KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kfind"), {url().toString()}, this);
+        job->setDesktopName(QStringLiteral("org.kde.kfind"));
+        job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
+        job->start();
     }
 }
 
index 89c54baf54b421611318eba1283ef513eeae9fa1..fba6fe084992dc50a7b20f8ce21d984b2afc4bc3 100644 (file)
@@ -25,9 +25,9 @@
 #include "dolphinviewcontainer.h"
 
 #include <KConfigGroup>
-#include <KRun>
 #include <KShell>
 #include <kio/global.h>
+#include <KIO/CommandLauncherJob>
 #include <KAcceleratorManager>
 
 #include <QApplication>
@@ -334,8 +334,9 @@ void DolphinTabWidget::detachTab(int index)
     }
     args << QStringLiteral("--new-window");
 
-    const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args));
-    KRun::runCommand(command, this);
+    KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob("dolphin", args, this);
+    job->setDesktopName(QStringLiteral("org.kde.dolphin"));
+    job->start();
 
     closeTab(index);
 }
index 3a17805ab8916667d15752c942c699fdcccc1b24..60d3374ad46cce67469ab5844aba3bb642cdd402 100644 (file)
@@ -119,7 +119,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate);
     connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox);
     connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching);
-    connect(m_searchBox, &DolphinSearchBox::returnPressed, this, &DolphinViewContainer::requestFocus);
+    connect(m_searchBox, &DolphinSearchBox::focusViewRequest, this, &DolphinViewContainer::requestFocus);
     m_searchBox->setWhatsThis(xi18nc("@info:whatsthis findbar",
         "<para>This helps you find files and folders. Enter a <emphasis>"
         "search term</emphasis> and specify search settings with the "
@@ -449,6 +449,18 @@ void DolphinViewContainer::reload()
     m_messageWidget->hide();
 }
 
+QString DolphinViewContainer::captionWindowTitle() const
+{
+    if (GeneralSettings::showFullPathInTitlebar() && !isSearchModeEnabled()) {
+        if (!url().isLocalFile()) {
+            return url().adjusted(QUrl::StripTrailingSlash).toString();
+        }
+        return url().adjusted(QUrl::StripTrailingSlash).path();
+    } else {
+        return DolphinViewContainer::caption();
+    }
+}
+
 QString DolphinViewContainer::caption() const
 {
     if (isSearchModeEnabled()) {
@@ -459,13 +471,6 @@ QString DolphinViewContainer::caption() const
         }
     }
 
-    if (GeneralSettings::showFullPathInTitlebar()) {
-        if (!url().isLocalFile()) {
-            return url().adjusted(QUrl::StripTrailingSlash).toString();
-        }
-        return url().adjusted(QUrl::StripTrailingSlash).path();
-    }
-
     KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
     const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp);
 
index 5207d2d35d47cf39572d156916d8ce504d65809f..52e63cbe04f34e9e670c8c39232c0854fe45fbf5 100644 (file)
@@ -133,6 +133,13 @@ public:
      */
     void reload();
 
+    /**
+     * @return Returns a Caption suitable for display in the window title.
+     * It is calculated depending on GeneralSettings::showFullPathInTitlebar().
+     * If it's false, it calls caption().
+     */
+    QString captionWindowTitle() const;
+
     /**
      * @return Returns a Caption suitable for display to the user. It is
      * calculated depending on settings, if a search is active and other
index 5236fa4d102a9086367bfa61d62dd9eaafff3331..19f43e06b04c5dcac9bfad6e755c579b57da4f55 100644 (file)
@@ -23,7 +23,9 @@
 #include "dolphindebug.h"
 #include "dolphinmainwindowinterface.h"
 
-#include <KRun>
+#include <KDialogJobUiDelegate>
+#include <KIO/ApplicationLauncherJob>
+#include <KService>
 #include <KWindowSystem>
 
 #include <QApplication>
@@ -60,13 +62,11 @@ void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const Open
     if (!urls.isEmpty()) {
         command.append(QLatin1String(" %U"));
     }
-    KRun::run(
-        command,
-        urls,
-        window,
-        QApplication::applicationDisplayName(),
-        QApplication::windowIcon().name()
-    );
+    KService::Ptr service(new KService(QApplication::applicationDisplayName(), command, QApplication::windowIcon().name()));
+    auto *job = new KIO::ApplicationLauncherJob(service, window);
+    job->setUrls(urls);
+    job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, window));
+    job->start();
 }
 
 bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService)
index 5ddf52e5f193dc84671c3248696d74f2bbeb8bf3..0c25ebb8b9ace0f2703ffcb4dffdf64172cc21d5 100644 (file)
@@ -1219,7 +1219,7 @@ void KItemListController::startDragging()
     const QPoint hotSpot((pixmap.width() / pixmap.devicePixelRatio()) / 2, 0);
     drag->setHotSpot(hotSpot);
 
-    drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction);
+    drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::MoveAction);
 
     QAccessibleEvent accessibilityEvent(view(), QAccessible::DragDropStart);
     QAccessible::updateAccessibility(&accessibilityEvent);
index c3d2c7fc0dd369a1911ab60b358770dee6900121..05228bdbbc5434e6c106499d01af214f84592e29 100644 (file)
       <caption xml:lang="pt-BR">Gerenciamento de arquivos no Dolphin</caption>
       <caption xml:lang="ru">Управление файлами</caption>
       <caption xml:lang="sk">Správa súborov v Dolphin</caption>
+      <caption xml:lang="sl">Upravljanje datotek v Dolphinu</caption>
       <caption xml:lang="sv">Filhantering i Dolphin</caption>
       <caption xml:lang="uk">Керування файлами у Dolphin</caption>
       <caption xml:lang="x-test">xxFile management in Dolphinxx</caption>
index 23e7f1922b0b0625d719a60c26781d39721f509c..4f0e4e5eb80ff51e784f559f3a69991b66dd055d 100644 (file)
@@ -248,7 +248,7 @@ void InformationPanel::showItemInfo()
         if (item.isNull()) {
             // No item is hovered and no selection has been done: provide
             // an item for the currently shown directory.
-            m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
+            m_folderStatJob = KIO::statDetails(url(), KIO::StatJob::SourceSide, KIO::StatDefaultDetails | KIO::StatRecursiveSize, KIO::HideProgressInfo);
             if (m_folderStatJob->uiDelegate()) {
                 KJobWidgets::setWindow(m_folderStatJob, this);
             }
index 5c7c7c3f158936286b187716e9a2a4e688e3ff0e..6cbdd4b3bdef37c1563981e4dfc472f255493eaa 100644 (file)
@@ -233,7 +233,7 @@ void InformationPanelContent::refreshPreview()
             // in the case of a search-URL the URL is not readable for humans
             // (at least not useful to show in the Information Panel)
             m_preview->setPixmap(
-                QIcon::fromTheme(QStringLiteral("baloo")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous)
+                QIcon::fromTheme(QStringLiteral("baloo")).pixmap(m_preview->height(), m_preview->width())
             );
         } else {
 
@@ -314,7 +314,7 @@ void InformationPanelContent::showItems(const KFileItemList& items)
     m_preview->stopAnimatedImage();
 
     m_preview->setPixmap(
-        QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous)
+        QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(m_preview->height(), m_preview->width())
     );
     setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));
 
@@ -358,7 +358,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
 void InformationPanelContent::showIcon(const KFileItem& item)
 {
     m_outdatedPreviewTimer->stop();
-    QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous);
+    QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(m_preview->height(), m_preview->width());
     KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop);
     m_preview->setPixmap(pixmap);
 }
diff --git a/src/panels/terminal/org.kde.KIOFuse.VFS.xml b/src/panels/terminal/org.kde.KIOFuse.VFS.xml
new file mode 100644 (file)
index 0000000..56f753e
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+  <interface name="org.kde.KIOFuse.VFS">
+    <method name="mountUrl">
+      <arg name="remoteUrl" type="s" direction="in"/>
+      <arg type="s" direction="out"/>
+    </method>
+    <method name="remoteUrl">
+      <arg name="localUrl" type="s" direction="in"/>
+      <arg type="s" direction="out"/>
+    </method>
+  </interface>
+</node>
index 861afebee0330fa2fd5c9ffc4917630a29809f6b..b0aff9a777a6ad8000e7a76ea7cc269ba167fd6b 100644 (file)
@@ -18,6 +18,7 @@
  ***************************************************************************/
 
 #include "terminalpanel.h"
+#include "kiofuse_interface.h"
 
 #include <KIO/DesktopExecParser>
 #include <KIO/Job>
@@ -25,6 +26,7 @@
 #include <KJobWidgets>
 #include <KLocalizedString>
 #include <KMessageWidget>
+#include <KMountPoint>
 #include <KParts/ReadOnlyPart>
 #include <KPluginFactory>
 #include <KPluginLoader>
@@ -50,7 +52,10 @@ TerminalPanel::TerminalPanel(QWidget* parent) :
     m_konsolePartMissingMessage(nullptr),
     m_konsolePart(nullptr),
     m_konsolePartCurrentDirectory(),
-    m_sendCdToTerminalHistory()
+    m_sendCdToTerminalHistory(),
+    m_kiofuseInterface(QStringLiteral("org.kde.KIOFuse"),
+                       QStringLiteral("/org/kde/KIOFuse"),
+                       QDBusConnection::sessionBus())
 {
     m_layout = new QVBoxLayout(this);
     m_layout->setContentsMargins(0, 0, 0, 0);
@@ -244,6 +249,19 @@ void TerminalPanel::slotMostLocalUrlResult(KJob* job)
     const QUrl url = statJob->mostLocalUrl();
     if (url.isLocalFile()) {
         sendCdToTerminal(url.toLocalFile());
+    } else {
+        // URL isn't local, only hope for the terminal to be in sync with the
+        // DolphinView is to mount the remote URL in KIOFuse and point to it.
+        // If we can't do that for any reason, silently fail.
+        auto reply = m_kiofuseInterface.mountUrl(url.toString());
+        QDBusPendingCallWatcher * watcher = new QDBusPendingCallWatcher(reply, this);
+        QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=] (QDBusPendingCallWatcher* watcher) {
+            watcher->deleteLater();
+            if (!reply.isError()) {
+                // Successfully mounted, point to the KIOFuse equivalent path.
+                sendCdToTerminal(reply.value());
+            }
+        });
     }
 
     m_mostLocalUrlJob = nullptr;
@@ -261,8 +279,31 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
         }
     }
 
+    // User may potentially be browsing inside a KIOFuse mount.
+    // If so lets try and change the DolphinView to point to the remote URL equivalent.
+    // instead of into the KIOFuse mount itself (which can cause performance issues!)
     const QUrl url(QUrl::fromLocalFile(dir));
-    emit changeUrl(url);
+
+    KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByPath(m_konsolePartCurrentDirectory);
+    if (mountPoint && mountPoint->mountType() != QStringLiteral("fuse.kio-fuse")) {
+        // Not in KIOFUse mount, so just switch to the corresponding URL.
+        emit changeUrl(url);
+        return;
+    }
+
+    auto reply = m_kiofuseInterface.remoteUrl(m_konsolePartCurrentDirectory);
+    QDBusPendingCallWatcher * watcher = new QDBusPendingCallWatcher(reply, this);
+    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=] (QDBusPendingCallWatcher* watcher) {
+        watcher->deleteLater();
+        if (reply.isError()) {
+            // KIOFuse errored out... just show the normal URL
+            emit changeUrl(url);
+        } else {
+            // Our location happens to be in a KIOFuse mount and is mounted.
+            // Let's change the DolphinView to point to the remote URL equivalent.
+            emit changeUrl(QUrl::fromUserInput(reply.value()));
+        }
+    });
 }
 
 bool TerminalPanel::terminalHasFocus() const
index 6ab205fe32cb01828dff012bdfb49e6b8d59ad5e..661fee4d486d2374b6e9044819e6095cfa19a9d3 100644 (file)
@@ -21,6 +21,7 @@
 #define TERMINALPANEL_H
 
 #include "panels/panel.h"
+#include "kiofuse_interface.h"
 
 #include <QQueue>
 
@@ -101,6 +102,7 @@ private:
     KParts::ReadOnlyPart* m_konsolePart;
     QString m_konsolePartCurrentDirectory;
     QQueue<QString> m_sendCdToTerminalHistory;
+    org::kde::KIOFuse::VFS m_kiofuseInterface;
 };
 
 #endif // TERMINALPANEL_H
index 23f520de148a3f1ba710cb652828bb2de5830f81..22941104cc95aff67dc8dda92efcdca5b735e9ba 100644 (file)
@@ -219,6 +219,9 @@ void DolphinSearchBox::keyReleaseEvent(QKeyEvent* event)
             m_searchInput->clear();
         }
     }
+    else if (event->key() == Qt::Key_Down) {
+        emit focusViewRequest();
+    }
 }
 
 bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event)
@@ -283,7 +286,7 @@ void DolphinSearchBox::slotSearchTextChanged(const QString& text)
 void DolphinSearchBox::slotReturnPressed()
 {
     emitSearchRequest();
-    emit returnPressed();
+    emit focusViewRequest();
 }
 
 void DolphinSearchBox::slotFacetChanged()
index 5fef4ec5a7bdd5464e27818b762ea1456b754d6c..2bf3ce4b18c0c700a7295b617e9694a394bea1c9 100644 (file)
@@ -118,8 +118,6 @@ signals:
      */
     void searchTextChanged(const QString& text);
 
-    void returnPressed();
-
     /**
      * Emitted as soon as the search box should get closed.
      */
@@ -131,6 +129,7 @@ signals:
      * @see DolphinSearchBox::setActive()
      */
     void activated();
+    void focusViewRequest();
 
 private slots:
     void emitSearchRequest();
index d8f2aab937bc84f33f8e93a95fb5e1ffee80b892..a0dd0327b9ad461530953d6261b74a7c527b0f72 100644 (file)
@@ -1493,13 +1493,27 @@ void DolphinView::calculateItemCount(int& fileCount,
                                      KIO::filesize_t& totalFileSize) const
 {
     const int itemCount = m_model->count();
+
+    bool countFileSize = true;
+
+    // In case we have a precomputed value
+    const auto job = KIO::statDetails(m_model->rootItem().url(), KIO::StatJob::SourceSide, KIO::StatRecursiveSize);
+    job->exec();
+    const auto entry =  job->statResult();
+    if (entry.contains(KIO::UDSEntry::UDS_RECURSIVE_SIZE)) {
+        totalFileSize = static_cast<KIO::filesize_t>(entry.numberValue(KIO::UDSEntry::UDS_RECURSIVE_SIZE));
+        countFileSize = false;
+    }
+
     for (int i = 0; i < itemCount; ++i) {
         const KFileItem item = m_model->fileItem(i);
         if (item.isDir()) {
             ++folderCount;
         } else {
             ++fileCount;
-            totalFileSize += item.size();
+            if (countFileSize) {
+                totalFileSize += item.size();
+            }
         }
     }
 }
index c61e1aaa9f46df99ef418e4059f83cc77a4e9c4a..e89e2e62c2b705e32223dca048334d6c22f7f224 100644 (file)
@@ -283,7 +283,7 @@ void DolphinViewActionHandler::createActions()
         "<para>Hidden items only differ from other ones in that their "
         "name starts with a \".\". In general there is no need for "
         "users to access them which is why they are hidden.</para>"));
-    m_actionCollection->setDefaultShortcuts(showHiddenFiles, {Qt::ALT + Qt::Key_Period, Qt::CTRL + Qt::Key_H, Qt::Key_F8});
+    m_actionCollection->setDefaultShortcuts(showHiddenFiles, KStandardShortcut::showHideHiddenFiles());
     connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles);
 
     QAction* adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties"));