#include "dolphindebug.h"
#include "dolphinmainwindow.h"
#include "global.h"
+#include "config-kuserfeedback.h"
+#ifdef HAVE_KUSERFEEDBACK
+#include "userfeedback/dolphinfeedbackprovider.h"
+#endif
#include <KAboutData>
#include <KCrash>
#include <QDBusInterface>
#include <QDBusAbstractInterface>
#include <QDBusConnectionInterface>
+#include <QSessionManager>
#ifndef Q_OS_WIN
#include <unistd.h>
#endif
#include <iostream>
-extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
+int main(int argc, char **argv)
{
#ifndef Q_OS_WIN
// Prohibit using sudo or kdesu (but allow using the root user directly)
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();
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;
}