X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4937992e93088bb572cda971bb899aed0e812aa3..9abe299c77a7bd194d781bba0e6a3d037c0431d1:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 0a252bc77..ef2905d77 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,10 @@ #include "dolphindebug.h" #include "dolphinmainwindow.h" #include "global.h" +#include "config-kuserfeedback.h" +#ifdef HAVE_KUSERFEEDBACK +#include "userfeedback/dolphinfeedbackprovider.h" +#endif #include #include @@ -26,6 +30,7 @@ #include #include #include +#include #ifndef Q_OS_WIN #include @@ -132,6 +137,14 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) if (parser.isSet(QStringLiteral("daemon"))) { + // Disable session management for the daemonized version + // See https://bugs.kde.org/show_bug.cgi?id=417219 + auto disableSessionManagement = [](QSessionManager &sm) { + sm.setRestartHint(QSessionManager::RestartNever); + }; + QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); + QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); + KDBusService dolphinDBusService; DBusInterface interface; interface.setAsDaemon(); @@ -191,11 +204,20 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) if (startedWithURLs) { 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!"; } } } +#ifdef HAVE_KUSERFEEDBACK + auto feedbackProvider = DolphinFeedbackProvider::instance(); + Q_UNUSED(feedbackProvider) +#endif + return app.exec(); // krazy:exclude=crash; }