Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
Show All 29 Lines | |||||
30 | #include <KCrash> | 30 | #include <KCrash> | ||
31 | #include <KDBusService> | 31 | #include <KDBusService> | ||
32 | #include <KLocalizedString> | 32 | #include <KLocalizedString> | ||
33 | #include <Kdelibs4ConfigMigrator> | 33 | #include <Kdelibs4ConfigMigrator> | ||
34 | 34 | | |||
35 | #include <QApplication> | 35 | #include <QApplication> | ||
36 | #include <QCommandLineParser> | 36 | #include <QCommandLineParser> | ||
37 | 37 | | |||
38 | #ifndef Q_OS_WIN | | |||
39 | #include <unistd.h> | | |||
40 | #endif | | |||
41 | #include <iostream> | | |||
42 | | ||||
43 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) | 38 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) | ||
44 | { | 39 | { | ||
45 | #ifndef Q_OS_WIN | | |||
46 | // Check whether we are running as root | | |||
47 | if (getuid() == 0) { | | |||
48 | std::cout << "Executing Dolphin as root is not possible." << std::endl; | | |||
49 | return EXIT_FAILURE; | | |||
50 | } | | |||
51 | #endif | | |||
52 | | ||||
53 | QApplication app(argc, argv); | 40 | QApplication app(argc, argv); | ||
54 | app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); | 41 | app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); | ||
55 | app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon())); | 42 | app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon())); | ||
56 | 43 | | |||
57 | KCrash::initialize(); | 44 | KCrash::initialize(); | ||
58 | 45 | | |||
59 | Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin")); | 46 | Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin")); | ||
60 | migrate.setConfigFiles(QStringList() << QStringLiteral("dolphinrc")); | 47 | migrate.setConfigFiles(QStringList() << QStringLiteral("dolphinrc")); | ||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |