Changeset View
Changeset View
Standalone View
Standalone View
libkworkspace/kworkspace.cpp
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Line(s) | 248 | if ( check ) { | |||
---|---|---|---|---|---|
255 | t.setCodec( "ISO 8859-1" ); | 255 | t.setCodec( "ISO 8859-1" ); | ||
256 | QString s = t.readLine(); | 256 | QString s = t.readLine(); | ||
257 | f.close(); | 257 | f.close(); | ||
258 | ::setenv( "SESSION_MANAGER", s.toLatin1(), true ); | 258 | ::setenv( "SESSION_MANAGER", s.toLatin1(), true ); | ||
259 | } | 259 | } | ||
260 | #endif | 260 | #endif | ||
261 | } | 261 | } | ||
262 | 262 | | |||
263 | void platformDetection(int argc, char **argv) | ||||
264 | { | ||||
265 | if (qEnvironmentVariableIsSet("QT_QPA_PLATFORM")) { | ||||
266 | return; | ||||
267 | } | ||||
268 | for (int i = 0; i < argc; i++) { | ||||
269 | if (qstrcmp(argv[i], "-platform") == 0 || | ||||
270 | qstrcmp(argv[i], "--platform") == 0 || | ||||
271 | QByteArray(argv[i]).startsWith("-platform=") || | ||||
272 | QByteArray(argv[i]).startsWith("--platform=")) { | ||||
273 | return; | ||||
274 | } | ||||
275 | } | ||||
276 | const QByteArray sessionType = qgetenv("XDG_SESSION_TYPE"); | ||||
277 | if (sessionType.isEmpty()) { | ||||
278 | return; | ||||
279 | } | ||||
280 | if (qstrcmp(sessionType, "wayland") == 0) { | ||||
281 | qputenv("QT_QPA_PLATFORM", "wayland"); | ||||
282 | } else if (qstrcmp(sessionType, "x11") == 0) { | ||||
283 | qputenv("QT_QPA_PLATFORM", "xcb"); | ||||
284 | } | ||||
285 | } | ||||
286 | | ||||
263 | } // end namespace | 287 | } // end namespace | ||
264 | 288 | | |||
265 | 289 | |