X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6c19e733673e24684707836fb2c9e0f45d1ac3f9..9eb780a2884351f26cef451df104f8f0e9cdef00:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 9da0c6fe8..611e3631c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,14 @@ #include #include +#if HAVE_X11 +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else +#include +#endif +#endif + #ifndef Q_OS_WIN #include #endif @@ -46,15 +54,11 @@ int main(int argc, char **argv) // Prohibit using sudo or kdesu (but allow using the root user directly) if (getuid() == 0) { if (!qEnvironmentVariableIsEmpty("SUDO_USER")) { - std::cout << "Running Dolphin with sudo can cause bugs and expose you to security vulnerabilities. " - "Instead use Dolphin normally and you will be prompted for elevated privileges when " - "performing file operations that require them." + std::cout << "Running Dolphin with sudo can cause bugs and expose you to security vulnerabilities." << std::endl; return EXIT_FAILURE; } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) { - std::cout << "Running Dolphin with kdesu can cause bugs and expose you to security vulnerabilities. " - "Instead use Dolphin normally and you will be prompted for elevated privileges when " - "performing file operations that require them." + std::cout << "Running Dolphin with kdesu can cause bugs and expose you to security vulnerabilities." << std::endl; return EXIT_FAILURE; } @@ -142,7 +146,7 @@ int main(int argc, char **argv) "will be selected."))); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("split"), i18nc("@info:shell", "Dolphin will get started with a split view."))); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("new-window"), i18nc("@info:shell", "Dolphin will explicitly open in a new window."))); - parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface)"))); + parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface)."))); parser.addPositionalArgument(QStringLiteral("+[Url]"), i18nc("@info:shell", "Document to open")); parser.process(app); @@ -181,6 +185,10 @@ int main(int argc, char **argv) if (KWindowSystem::isPlatformWayland()) { token = qEnvironmentVariable("XDG_ACTIVATION_TOKEN"); qunsetenv("XDG_ACTIVATION_TOKEN"); + } else if (KWindowSystem::isPlatformX11()) { +#if HAVE_X11 + token = QX11Info::nextStartupId(); +#endif } if (Dolphin::attachToExistingInstance(urls, openFiles, splitView, QString(), token)) {