From: Nate Graham Date: Mon, 2 Aug 2021 16:32:31 +0000 (-0600) Subject: Merge branch 'release/21.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d472cb2a25cef38dbebbd0ec9073e4ec05d65272?hp=-c Merge branch 'release/21.08' --- d472cb2a25cef38dbebbd0ec9073e4ec05d65272 diff --combined src/dolphinmainwindow.cpp index 9712b99bc,52b3e8d6a..0b1ebe765 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -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 DolphinM return viewContainers; } - void DolphinMainWindow::setViewsWithInvalidPathsToHome() - { - const QVector 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& 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 ba894ec38,6e9ef0b2a..779690c1c --- a/src/main.cpp +++ b/src/main.cpp @@@ -23,7 -23,6 +23,7 @@@ #include #include #include +#include #include #include @@@ -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")); @@@ -181,12 -178,7 +181,12 @@@ 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()) { @@@ -210,12 -202,12 +210,12 @@@ // 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!"; }