Changeset View
Changeset View
Standalone View
Standalone View
krfb/main.cpp
Show All 36 Lines | |||||
37 | #include <QCommandLineOption> | 37 | #include <QCommandLineOption> | ||
38 | 38 | | |||
39 | 39 | | |||
40 | static const char description[] = I18N_NOOP("VNC-compatible server to share " | 40 | static const char description[] = I18N_NOOP("VNC-compatible server to share " | ||
41 | "desktops"); | 41 | "desktops"); | ||
42 | 42 | | |||
43 | static bool checkX11Capabilities() | 43 | static bool checkX11Capabilities() | ||
44 | { | 44 | { | ||
45 | int bp1, bp2, majorv, minorv; | 45 | int bp1, bp2, majorv, minorv; | ||
pino: looking at similar checks in other applications, shouldn't this be `QX11Info::isPlatformX11()`? | |||||
46 | Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2, | 46 | Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2, | ||
pino: then most probably only the platform name check should be enough, shouldn't it? | |||||
alexeymin: Yeah, probably platform name check should be enough. | |||||
47 | &majorv, &minorv); | 47 | &majorv, &minorv); | ||
48 | 48 | | |||
49 | if ((!r) || (((majorv * 1000) + minorv) < 2002)) { | 49 | if ((!r) || (((majorv * 1000) + minorv) < 2002)) { | ||
50 | KMessageBox::error(nullptr, | 50 | KMessageBox::error(nullptr, | ||
51 | i18n("Your X11 Server does not support the required XTest extension " | 51 | i18n("Your X11 Server does not support the required XTest extension " | ||
please no exclamation marks in error messages, as they "increase the tone" of the message itself. pino: please no exclamation marks in error messages, as they "increase the tone" of the message… | |||||
alexeymin: Okay | |||||
52 | "version 2.2. Sharing your desktop is not possible."), | 52 | "version 2.2. Sharing your desktop is not possible."), | ||
53 | i18n("Desktop Sharing Error")); | 53 | i18n("Desktop Sharing Error")); | ||
54 | return false; | 54 | return false; | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | return true; | 57 | return true; | ||
58 | } | 58 | } | ||
59 | 59 | | |||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 76 | { | |||
116 | 116 | | |||
117 | parser.process(app); | 117 | parser.process(app); | ||
118 | aboutData.processCommandLine(&parser); | 118 | aboutData.processCommandLine(&parser); | ||
119 | 119 | | |||
120 | KDBusService service(KDBusService::Unique, &app); | 120 | KDBusService service(KDBusService::Unique, &app); | ||
121 | 121 | | |||
122 | app.setQuitOnLastWindowClosed(false); | 122 | app.setQuitOnLastWindowClosed(false); | ||
123 | 123 | | |||
124 | if (QX11Info::isPlatformX11()) { | ||||
124 | if (!checkX11Capabilities()) { | 125 | if (!checkX11Capabilities()) { | ||
125 | return 1; | 126 | return 1; | ||
126 | } | 127 | } | ||
127 | 128 | | |||
128 | // upgrade the configuration | 129 | // upgrade the configuration | ||
129 | checkOldX11PluginConfig(); | 130 | checkOldX11PluginConfig(); | ||
131 | } else { | ||||
132 | KMessageBox::error(nullptr, | ||||
133 | i18n("Desktop Sharing is not running under an X11 Server. " | ||||
134 | "Other display servers are currently not supported."), | ||||
135 | i18n("Desktop Sharing Error")); | ||||
136 | return 1; | ||||
137 | } | ||||
130 | 138 | | |||
131 | //init the core | 139 | //init the core | ||
132 | InvitationsRfbServer::init(); | 140 | InvitationsRfbServer::init(); | ||
133 | 141 | | |||
134 | //init the GUI | 142 | //init the GUI | ||
135 | MainWindow mainWindow; | 143 | MainWindow mainWindow; | ||
136 | TrayIcon trayicon(&mainWindow); | 144 | TrayIcon trayicon(&mainWindow); | ||
137 | 145 | | |||
Show All 15 Lines |
looking at similar checks in other applications, shouldn't this be QX11Info::isPlatformX11()?