Changeset View
Changeset View
Standalone View
Standalone View
src/wrapper.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
57 | 57 | | |||
58 | // adapted from kdeinit/kinit.cpp | 58 | // adapted from kdeinit/kinit.cpp | ||
59 | // WARNING, if you change the socket name, adjust kinit.cpp too | 59 | // WARNING, if you change the socket name, adjust kinit.cpp too | ||
60 | static const QString generate_socket_file_name() | 60 | static const QString generate_socket_file_name() | ||
61 | { | 61 | { | ||
62 | 62 | | |||
63 | #if HAVE_X11 || HAVE_XCB // qt5: see displayEnvVarName_c() | 63 | #if HAVE_X11 || HAVE_XCB // qt5: see displayEnvVarName_c() | ||
64 | QByteArray display = qgetenv(displayEnvVarName_c()); | 64 | QByteArray display = qgetenv(displayEnvVarName_c()); | ||
65 | if (display.isEmpty()) { | | |||
66 | fprintf(stderr, "Error: could not determine $%s.\n", displayEnvVarName_c()); | | |||
67 | return QString(); | | |||
68 | } | | |||
69 | int i; | 65 | int i; | ||
70 | if ((i = display.lastIndexOf('.')) > display.lastIndexOf(':') && i >= 0) { | 66 | if ((i = display.lastIndexOf('.')) > display.lastIndexOf(':') && i >= 0) { | ||
71 | display.truncate(i); | 67 | display.truncate(i); | ||
72 | } | 68 | } | ||
73 | 69 | | |||
74 | display.replace(':', '_'); | 70 | display.replace(':', '_'); | ||
75 | #ifdef __APPLE__ | 71 | #ifdef __APPLE__ | ||
76 | // not entirely impossible, so let's leave it | 72 | // not entirely impossible, so let's leave it | ||
▲ Show 20 Lines • Show All 416 Lines • Show Last 20 Lines |