]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Use a faster way to determine kio-stash isn't installed
[dolphin.git] / src / dolphinmainwindow.cpp
index beec95c6c6ef3adc3df528e770088f3d01da8d0e..096429f732a04eea28b0afaf0f9940d52a65fc13 100644 (file)
@@ -134,10 +134,9 @@ DolphinMainWindow::DolphinMainWindow() :
     connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished,
             this, &DolphinMainWindow::showCommand);
 
-    GeneralSettings* generalSettings = GeneralSettings::self();
-    const bool firstRun = (generalSettings->version() < 200);
+    const bool firstRun = (GeneralSettings::version() < 200);
     if (firstRun) {
-        generalSettings->setViewPropsTimestamp(QDateTime::currentDateTime());
+        GeneralSettings::setViewPropsTimestamp(QDateTime::currentDateTime());
     }
 
     setAcceptDrops(true);
@@ -174,7 +173,7 @@ DolphinMainWindow::DolphinMainWindow() :
             this, &DolphinMainWindow::updatePasteAction);
 
     QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
-    toggleFilterBarAction->setChecked(generalSettings->filterBar());
+    toggleFilterBarAction->setChecked(GeneralSettings::filterBar());
 
     if (firstRun) {
         menuBar()->setVisible(false);
@@ -1092,7 +1091,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
     } else {
         m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
         m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
-        m_lastHandleUrlOpenJob->setRunExecutables(true);
+        m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
 
         connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this,
                 [this, url](const QString &mimetype) {
@@ -1524,7 +1523,7 @@ void DolphinMainWindow::setupActions()
     stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window"));
     stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-stash")));
     stashSplit->setCheckable(false);
-    stashSplit->setVisible(KProtocolInfo::isKnownProtocol("stash"));
+    stashSplit->setVisible(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
     connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash);
 
     KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection());