Changeset View
Changeset View
Standalone View
Standalone View
kate/main.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | #include <QDir> | 46 | #include <QDir> | ||
47 | 47 | | |||
48 | #include "../urlinfo.h" | 48 | #include "../urlinfo.h" | ||
49 | 49 | | |||
50 | #ifdef USE_QT_SINGLE_APP | 50 | #ifdef USE_QT_SINGLE_APP | ||
51 | #include "qtsingleapplication/qtsingleapplication.h" | 51 | #include "qtsingleapplication/qtsingleapplication.h" | ||
52 | #endif | 52 | #endif | ||
53 | 53 | | |||
54 | #ifndef Q_OS_WIN | ||||
55 | #include <unistd.h> | ||||
56 | #endif | ||||
57 | #include <iostream> | ||||
58 | | ||||
54 | 59 | | |||
55 | int main(int argc, char **argv) | 60 | int main(int argc, char **argv) | ||
56 | { | 61 | { | ||
62 | #ifndef Q_OS_WIN | ||||
63 | /** | ||||
64 | * Check whether we are running as root | ||||
65 | **/ | ||||
66 | if (getuid() == 0) { | ||||
67 | std::cout << "Executing Kate as root is not possible. To edit files as root use:" << std::endl; | ||||
68 | std::cout << "SUDO_EDITOR=kate sudoedit <file>" << std::endl; | ||||
69 | return 0; | ||||
70 | } | ||||
71 | #endif | ||||
57 | /** | 72 | /** | ||
58 | * init resources from our static lib | 73 | * init resources from our static lib | ||
59 | */ | 74 | */ | ||
60 | Q_INIT_RESOURCE(kate); | 75 | Q_INIT_RESOURCE(kate); | ||
61 | 76 | | |||
62 | /** | 77 | /** | ||
63 | * Create application first | 78 | * Create application first | ||
64 | */ | 79 | */ | ||
▲ Show 20 Lines • Show All 514 Lines • Show Last 20 Lines |