]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/21.08'
authorNate Graham <nate@kde.org>
Mon, 2 Aug 2021 16:32:31 +0000 (10:32 -0600)
committerNate Graham <nate@kde.org>
Mon, 2 Aug 2021 16:32:31 +0000 (10:32 -0600)
1  2 
src/dolphinmainwindow.cpp
src/main.cpp

index 9712b99bc3f2d20fc4f97b4ac488c399730a7742,52b3e8d6abe86b2ca9550b6f20c44a81caddfdc4..0b1ebe76560e5a32975b31e22df4d667d995bba2
@@@ -211,9 -211,11 +211,9 @@@ DolphinMainWindow::DolphinMainWindow() 
      QTimer::singleShot(0, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction);
  
      m_fileItemActions.setParentWidget(this);
 -#if KIO_VERSION >= QT_VERSION_CHECK(5, 82, 0)
      connect(&m_fileItemActions, &KFileItemActions::error, this, [this](const QString &errorMessage) {
          showErrorMessage(errorMessage);
      });
 -#endif
  }
  
  DolphinMainWindow::~DolphinMainWindow()
@@@ -237,20 -239,6 +237,6 @@@ QVector<DolphinViewContainer*> DolphinM
      return viewContainers;
  }
  
- void DolphinMainWindow::setViewsWithInvalidPathsToHome()
- {
-     const QVector<DolphinViewContainer*> theViewContainers = viewContainers();
-     for (DolphinViewContainer *viewContainer : theViewContainers) {
-         // Only consider local dirs, not remote locations and abstract protocols
-         if (viewContainer->url().isLocalFile()) {
-             if (!QFileInfo::exists(viewContainer->url().toLocalFile())) {
-                 viewContainer->setUrl(QUrl::fromLocalFile(QDir::homePath()));
-             }
-         }
-     }
- }
  void DolphinMainWindow::openDirectories(const QList<QUrl>& dirs, bool splitView)
  {
      m_tabWidget->openDirectories(dirs, splitView);
@@@ -1541,8 -1529,7 +1527,8 @@@ 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(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
 +    QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface();
 +    stashSplit->setVisible(sessionInterface && sessionInterface->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
      connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash);
  
      KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection());
diff --combined src/main.cpp
index ba894ec38c2944633fe3b78243c02bb000249566,6e9ef0b2a6dce729aecb29f5a641618aa7f950c5..779690c1c5de280c9742f2d432e0a3c395156986
@@@ -23,7 -23,6 +23,7 @@@
  #include <KLocalizedString>
  #include <Kdelibs4ConfigMigrator>
  #include <KConfigGui>
 +#include <KIO/PreviewJob>
  
  #include <QApplication>
  #include <QCommandLineParser>
@@@ -62,8 -61,6 +62,8 @@@ int main(int argc, char **argv
      QApplication app(argc, argv);
      app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
  
 +    KIO::PreviewJob::setDefaultDevicePixelRatio(app.devicePixelRatio());
 +
      KCrash::initialize();
  
      Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin"));
  
      mainWindow->show();
  
 -    KDBusService dolphinDBusService;
 +    // Allow starting Dolphin on a system that is not running DBus:
 +    KDBusService::StartupOptions serviceOptions = KDBusService::Multiple;
 +    if (!QDBusConnection::sessionBus().isConnected()) {
 +        serviceOptions |= KDBusService::NoExitOnFailure;
 +    }
 +    KDBusService dolphinDBusService(serviceOptions);
      DBusInterface interface;
  
      if (!app.isSessionRestored()) {
                  // If the user passed any URLs to Dolphin, open those in the
                  // window after session-restoring it
                  if (startedWithURLs) {
-                     mainWindow->openDirectories(urls, splitView);
+                     if (openFiles) {
+                         mainWindow->openFiles(urls, splitView);
+                     } else {
+                         mainWindow->openDirectories(urls, splitView);
+                     }
                  }
-                 // Now handle invalid locations in the set of active views to
-                 // avoid issues like https://bugs.kde.org/show_bug.cgi?id=427619
-                 mainWindow->setViewsWithInvalidPathsToHome();
              } else {
                  qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";
              }