X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ea7d4f059d5cb81b51053e7fec6492a727a968c2..4b224516f4c646b81a1d7842bcedf1c8fbbfc15f:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 76b482688..779690c1c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -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")); @@ -178,7 +181,12 @@ int main(int argc, char **argv) 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()) { @@ -202,7 +210,11 @@ int main(int argc, char **argv) // 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); + } } } else { qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";