| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/qxcbsessionmanager.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | class QSmSocketReceiver : public QObject | - | ||||||||||||
| 5 | { | - | ||||||||||||
| 6 | public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } | - | ||||||||||||
| 7 | #pragma GCC diagnostic push | - | ||||||||||||
| 8 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||
| 9 | #pragma GCC diagnostic pop | - | ||||||||||||
| 10 | struct QPrivateSignal {}; | - | ||||||||||||
| 11 | public: | - | ||||||||||||
| 12 | QSmSocketReceiver(int socket) | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | QSocketNotifier* sn = new QSocketNotifier(socket, QSocketNotifier::Read, this); | - | ||||||||||||
| 15 | connect(sn, qFlagLocation("2""activated(int)" "\0" __FILE__ ":" "60"), this, qFlagLocation("1""socketActivated(int)" "\0" __FILE__ ":" "60")); | - | ||||||||||||
| 16 | } never executed: end of block | 0 | ||||||||||||
| 17 | - | |||||||||||||
| 18 | public : | - | ||||||||||||
| 19 | void socketActivated(int); | - | ||||||||||||
| 20 | }; | - | ||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | static SmcConn smcConnection = 0; | - | ||||||||||||
| 24 | static bool sm_interactionActive; | - | ||||||||||||
| 25 | static bool sm_smActive; | - | ||||||||||||
| 26 | static int sm_interactStyle; | - | ||||||||||||
| 27 | static int sm_saveType; | - | ||||||||||||
| 28 | static bool sm_cancel; | - | ||||||||||||
| 29 | static bool sm_waitingForInteraction; | - | ||||||||||||
| 30 | static bool sm_isshutdown; | - | ||||||||||||
| 31 | static bool sm_phase2; | - | ||||||||||||
| 32 | static bool sm_in_phase2; | - | ||||||||||||
| 33 | bool qt_sm_blockUserInput = false; | - | ||||||||||||
| 34 | - | |||||||||||||
| 35 | static QSmSocketReceiver* sm_receiver = 0; | - | ||||||||||||
| 36 | - | |||||||||||||
| 37 | static void resetSmState(); | - | ||||||||||||
| 38 | static void sm_setProperty(const char *name, const char *type, | - | ||||||||||||
| 39 | int num_vals, SmPropValue *vals); | - | ||||||||||||
| 40 | static void sm_saveYourselfCallback(SmcConn smcConn, SmPointer clientData, | - | ||||||||||||
| 41 | int saveType, int shutdown , int interactStyle, int fast); | - | ||||||||||||
| 42 | static void sm_saveYourselfPhase2Callback(SmcConn smcConn, SmPointer clientData) ; | - | ||||||||||||
| 43 | static void sm_dieCallback(SmcConn smcConn, SmPointer clientData) ; | - | ||||||||||||
| 44 | static void sm_shutdownCancelledCallback(SmcConn smcConn, SmPointer clientData); | - | ||||||||||||
| 45 | static void sm_saveCompleteCallback(SmcConn smcConn, SmPointer clientData); | - | ||||||||||||
| 46 | static void sm_interactCallback(SmcConn smcConn, SmPointer clientData); | - | ||||||||||||
| 47 | static void sm_performSaveYourself(QXcbSessionManager*); | - | ||||||||||||
| 48 | - | |||||||||||||
| 49 | static void resetSmState() | - | ||||||||||||
| 50 | { | - | ||||||||||||
| 51 | sm_waitingForInteraction = false; | - | ||||||||||||
| 52 | sm_interactionActive = false; | - | ||||||||||||
| 53 | sm_interactStyle = 0; | - | ||||||||||||
| 54 | sm_smActive = false; | - | ||||||||||||
| 55 | qt_sm_blockUserInput = false; | - | ||||||||||||
| 56 | sm_isshutdown = false; | - | ||||||||||||
| 57 | sm_phase2 = false; | - | ||||||||||||
| 58 | sm_in_phase2 = false; | - | ||||||||||||
| 59 | } executed 135 times by 5 tests: end of blockExecuted by:
| 135 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | - | |||||||||||||
| 64 | static void sm_setProperty(const char *name, const char *type, | - | ||||||||||||
| 65 | int num_vals, SmPropValue *vals) | - | ||||||||||||
| 66 | { | - | ||||||||||||
| 67 | if (num_vals
| 0 | ||||||||||||
| 68 | SmProp prop; | - | ||||||||||||
| 69 | prop.name = const_cast<char*>(name); | - | ||||||||||||
| 70 | prop.type = const_cast<char*>(type); | - | ||||||||||||
| 71 | prop.num_vals = num_vals; | - | ||||||||||||
| 72 | prop.vals = vals; | - | ||||||||||||
| 73 | - | |||||||||||||
| 74 | SmProp* props[1]; | - | ||||||||||||
| 75 | props[0] = ∝ | - | ||||||||||||
| 76 | SmcSetProperties(smcConnection, 1, props); | - | ||||||||||||
| 77 | } never executed: else {end of block | 0 | ||||||||||||
| 78 | char* names[1]; | - | ||||||||||||
| 79 | names[0] = const_cast<char*>(name); | - | ||||||||||||
| 80 | SmcDeleteProperties(smcConnection, 1, names); | - | ||||||||||||
| 81 | } never executed: end of block | 0 | ||||||||||||
| 82 | } | - | ||||||||||||
| 83 | - | |||||||||||||
| 84 | static void sm_setProperty(const QString &name, const QString &value) | - | ||||||||||||
| 85 | { | - | ||||||||||||
| 86 | QByteArray v = value.toUtf8(); | - | ||||||||||||
| 87 | SmPropValue prop; | - | ||||||||||||
| 88 | prop.length = v.length(); | - | ||||||||||||
| 89 | prop.value = (SmPointer) const_cast<char *>(v.constData()); | - | ||||||||||||
| 90 | sm_setProperty(name.toLatin1().data(), "ARRAY8", 1, &prop); | - | ||||||||||||
| 91 | } never executed: end of block | 0 | ||||||||||||
| 92 | - | |||||||||||||
| 93 | static void sm_setProperty(const QString &name, const QStringList &value) | - | ||||||||||||
| 94 | { | - | ||||||||||||
| 95 | SmPropValue *prop = new SmPropValue[value.count()]; | - | ||||||||||||
| 96 | int count = 0; | - | ||||||||||||
| 97 | QList<QByteArray> vl; | - | ||||||||||||
| 98 | vl.reserve(value.size()); | - | ||||||||||||
| 99 | for (QStringList::ConstIterator it = value.begin(); it != value.end()
| 0 | ||||||||||||
| 100 | prop[count].length = (*it).length(); | - | ||||||||||||
| 101 | vl.append((*it).toUtf8()); | - | ||||||||||||
| 102 | prop[count].value = (char*)vl.last().data(); | - | ||||||||||||
| 103 | ++count; | - | ||||||||||||
| 104 | } never executed: end of block | 0 | ||||||||||||
| 105 | sm_setProperty(name.toLatin1().data(), "LISTofARRAY8", count, prop); | - | ||||||||||||
| 106 | delete [] prop; | - | ||||||||||||
| 107 | } never executed: end of block | 0 | ||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | - | |||||||||||||
| 111 | struct QT_smcConn { | - | ||||||||||||
| 112 | unsigned int save_yourself_in_progress : 1; | - | ||||||||||||
| 113 | unsigned int shutdown_in_progress : 1; | - | ||||||||||||
| 114 | }; | - | ||||||||||||
| 115 | - | |||||||||||||
| 116 | static void sm_saveYourselfCallback(SmcConn smcConn, SmPointer clientData, | - | ||||||||||||
| 117 | int saveType, int shutdown , int interactStyle, int ) | - | ||||||||||||
| 118 | { | - | ||||||||||||
| 119 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 120 | return; never executed: return; | 0 | ||||||||||||
| 121 | sm_cancel = false; | - | ||||||||||||
| 122 | sm_smActive = true; | - | ||||||||||||
| 123 | sm_isshutdown = shutdown; | - | ||||||||||||
| 124 | sm_saveType = saveType; | - | ||||||||||||
| 125 | sm_interactStyle = interactStyle; | - | ||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | ((QT_smcConn*)smcConn)->save_yourself_in_progress = true; | - | ||||||||||||
| 130 | if (sm_isshutdown
| 0 | ||||||||||||
| 131 | (( never executed: QT_smcConn*)smcConn)->shutdown_in_progress = true;((QT_smcConn*)smcConn)->shutdown_in_progress = true;never executed: ((QT_smcConn*)smcConn)->shutdown_in_progress = true; | 0 | ||||||||||||
| 132 | - | |||||||||||||
| 133 | sm_performSaveYourself((QXcbSessionManager*) clientData); | - | ||||||||||||
| 134 | if (!sm_isshutdown
| 0 | ||||||||||||
| 135 | resetSmState(); never executed: resetSmState(); | 0 | ||||||||||||
| 136 | } never executed: end of block | 0 | ||||||||||||
| 137 | - | |||||||||||||
| 138 | static void sm_performSaveYourself(QXcbSessionManager *sm) | - | ||||||||||||
| 139 | { | - | ||||||||||||
| 140 | if (sm_isshutdown
| 0 | ||||||||||||
| 141 | qt_sm_blockUserInput = true; never executed: qt_sm_blockUserInput = true; | 0 | ||||||||||||
| 142 | - | |||||||||||||
| 143 | - | |||||||||||||
| 144 | timeval tv; | - | ||||||||||||
| 145 | gettimeofday(&tv, 0); | - | ||||||||||||
| 146 | sm->setSessionKey(QString::number(qulonglong(tv.tv_sec)) + | - | ||||||||||||
| 147 | QLatin1Char('_') + | - | ||||||||||||
| 148 | QString::number(qulonglong(tv.tv_usec))); | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | QStringList arguments = QCoreApplication::arguments(); | - | ||||||||||||
| 151 | QString argument0 = arguments.isEmpty()
| 0 | ||||||||||||
| 152 | : arguments.at(0); | - | ||||||||||||
| 153 | - | |||||||||||||
| 154 | - | |||||||||||||
| 155 | sm_setProperty(QString::fromLatin1("Program"), argument0); | - | ||||||||||||
| 156 | - | |||||||||||||
| 157 | struct passwd *entryPtr = 0; | - | ||||||||||||
| 158 | - | |||||||||||||
| 159 | QVarLengthArray<char, 1024> buf(qMax<long>(sysconf(_SC_GETPW_R_SIZE_MAX), 1024L)); | - | ||||||||||||
| 160 | struct passwd entry; | - | ||||||||||||
| 161 | while (getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr) == 34
| 0 | ||||||||||||
| 162 | if (buf.size() >= 32768
| 0 | ||||||||||||
| 163 | - | |||||||||||||
| 164 | static char badusername[] = ""; | - | ||||||||||||
| 165 | entryPtr = &entry; | - | ||||||||||||
| 166 | entry.pw_name = badusername; | - | ||||||||||||
| 167 | break; never executed: break; | 0 | ||||||||||||
| 168 | } | - | ||||||||||||
| 169 | - | |||||||||||||
| 170 | - | |||||||||||||
| 171 | buf.resize(buf.size() * 2); | - | ||||||||||||
| 172 | } never executed: end of block | 0 | ||||||||||||
| 173 | - | |||||||||||||
| 174 | - | |||||||||||||
| 175 | - | |||||||||||||
| 176 | if (entryPtr
| 0 | ||||||||||||
| 177 | sm_setProperty(QString::fromLatin1("UserID"), QString::fromLocal8Bit(entryPtr->pw_name)); never executed: sm_setProperty(QString::fromLatin1("UserID"), QString::fromLocal8Bit(entryPtr->pw_name)); | 0 | ||||||||||||
| 178 | - | |||||||||||||
| 179 | - | |||||||||||||
| 180 | QStringList restart; | - | ||||||||||||
| 181 | restart << argument0 << QLatin1String("-session") | - | ||||||||||||
| 182 | << sm->sessionId() + QLatin1Char('_') + sm->sessionKey(); | - | ||||||||||||
| 183 | - | |||||||||||||
| 184 | QFileInfo fi = QCoreApplication::applicationFilePath(); | - | ||||||||||||
| 185 | if (qAppName().compare(fi.fileName(), Qt::CaseInsensitive) != 0
| 0 | ||||||||||||
| 186 | restart << QLatin1String("-name") << qAppName(); never executed: restart << QLatin1String("-name") << qAppName(); | 0 | ||||||||||||
| 187 | sm->setRestartCommand(restart); | - | ||||||||||||
| 188 | QStringList discard; | - | ||||||||||||
| 189 | sm->setDiscardCommand(discard); | - | ||||||||||||
| 190 | - | |||||||||||||
| 191 | switch (sm_saveType) { | - | ||||||||||||
| 192 | case never executed: 2:case 2:never executed: case 2: | 0 | ||||||||||||
| 193 | sm->appCommitData(); | - | ||||||||||||
| 194 | if (sm_isshutdown
| 0 | ||||||||||||
| 195 | break; never executed: break; | 0 | ||||||||||||
| 196 | - | |||||||||||||
| 197 | case never executed: 1:case 1:never executed: case 1:code before this statement never executed: case 1: | 0 | ||||||||||||
| 198 | sm->appSaveState(); | - | ||||||||||||
| 199 | break; never executed: break; | 0 | ||||||||||||
| 200 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||
| 201 | sm->appCommitData(); | - | ||||||||||||
| 202 | break; never executed: break; | 0 | ||||||||||||
| 203 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 204 | break; never executed: break; | 0 | ||||||||||||
| 205 | } | - | ||||||||||||
| 206 | - | |||||||||||||
| 207 | if (sm_phase2
| 0 | ||||||||||||
| 208 | SmcRequestSaveYourselfPhase2(smcConnection, sm_saveYourselfPhase2Callback, (SmPointer*) sm); | - | ||||||||||||
| 209 | qt_sm_blockUserInput = false; | - | ||||||||||||
| 210 | } never executed: else {end of block | 0 | ||||||||||||
| 211 | - | |||||||||||||
| 212 | - | |||||||||||||
| 213 | - | |||||||||||||
| 214 | if (sm_interactionActive
| 0 | ||||||||||||
| 215 | SmcInteractDone(smcConnection, sm_isshutdown && sm_cancel); | - | ||||||||||||
| 216 | sm_interactionActive = false; | - | ||||||||||||
| 217 | } never executed: else if (sm_cancelend of block
| 0 | ||||||||||||
| 218 | if (sm->allowsErrorInteraction()
| 0 | ||||||||||||
| 219 | SmcInteractDone(smcConnection, 1); | - | ||||||||||||
| 220 | sm_interactionActive = false; | - | ||||||||||||
| 221 | } never executed: end of block | 0 | ||||||||||||
| 222 | } never executed: end of block | 0 | ||||||||||||
| 223 | - | |||||||||||||
| 224 | - | |||||||||||||
| 225 | sm_setProperty(QString::fromLatin1("RestartCommand"), sm->restartCommand()); | - | ||||||||||||
| 226 | sm_setProperty(QString::fromLatin1("DiscardCommand"), sm->discardCommand()); | - | ||||||||||||
| 227 | - | |||||||||||||
| 228 | - | |||||||||||||
| 229 | SmPropValue prop; | - | ||||||||||||
| 230 | prop.length = sizeof(int); | - | ||||||||||||
| 231 | int value = sm->restartHint(); | - | ||||||||||||
| 232 | prop.value = (SmPointer) &value; | - | ||||||||||||
| 233 | sm_setProperty("RestartStyleHint", "CARD8", 1, &prop); | - | ||||||||||||
| 234 | - | |||||||||||||
| 235 | - | |||||||||||||
| 236 | SmcSaveYourselfDone(smcConnection, !sm_cancel); | - | ||||||||||||
| 237 | } never executed: end of block | 0 | ||||||||||||
| 238 | } | - | ||||||||||||
| 239 | - | |||||||||||||
| 240 | static void sm_dieCallback(SmcConn smcConn, SmPointer ) | - | ||||||||||||
| 241 | { | - | ||||||||||||
| 242 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 243 | return; never executed: return; | 0 | ||||||||||||
| 244 | resetSmState(); | - | ||||||||||||
| 245 | QEvent quitEvent(QEvent::Quit); | - | ||||||||||||
| 246 | QGuiApplication::sendEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &quitEvent); | - | ||||||||||||
| 247 | } never executed: end of block | 0 | ||||||||||||
| 248 | - | |||||||||||||
| 249 | static void sm_shutdownCancelledCallback(SmcConn smcConn, SmPointer clientData) | - | ||||||||||||
| 250 | { | - | ||||||||||||
| 251 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 252 | return; never executed: return; | 0 | ||||||||||||
| 253 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 254 | (( never executed: QXcbSessionManager *) clientData)->exitEventLoop();((QXcbSessionManager *) clientData)->exitEventLoop();never executed: ((QXcbSessionManager *) clientData)->exitEventLoop(); | 0 | ||||||||||||
| 255 | resetSmState(); | - | ||||||||||||
| 256 | } never executed: end of block | 0 | ||||||||||||
| 257 | - | |||||||||||||
| 258 | static void sm_saveCompleteCallback(SmcConn smcConn, SmPointer ) | - | ||||||||||||
| 259 | { | - | ||||||||||||
| 260 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 261 | return; never executed: return; | 0 | ||||||||||||
| 262 | resetSmState(); | - | ||||||||||||
| 263 | } never executed: end of block | 0 | ||||||||||||
| 264 | - | |||||||||||||
| 265 | static void sm_interactCallback(SmcConn smcConn, SmPointer clientData) | - | ||||||||||||
| 266 | { | - | ||||||||||||
| 267 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 268 | return; never executed: return; | 0 | ||||||||||||
| 269 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 270 | (( never executed: QXcbSessionManager *) clientData)->exitEventLoop();((QXcbSessionManager *) clientData)->exitEventLoop();never executed: ((QXcbSessionManager *) clientData)->exitEventLoop(); | 0 | ||||||||||||
| 271 | } never executed: end of block | 0 | ||||||||||||
| 272 | - | |||||||||||||
| 273 | static void sm_saveYourselfPhase2Callback(SmcConn smcConn, SmPointer clientData) | - | ||||||||||||
| 274 | { | - | ||||||||||||
| 275 | if (smcConn != smcConnection
| 0 | ||||||||||||
| 276 | return; never executed: return; | 0 | ||||||||||||
| 277 | sm_in_phase2 = true; | - | ||||||||||||
| 278 | sm_performSaveYourself((QXcbSessionManager *) clientData); | - | ||||||||||||
| 279 | } never executed: end of block | 0 | ||||||||||||
| 280 | - | |||||||||||||
| 281 | - | |||||||||||||
| 282 | void QSmSocketReceiver::socketActivated(int) | - | ||||||||||||
| 283 | { | - | ||||||||||||
| 284 | IceProcessMessages(SmcGetIceConnection(smcConnection), 0, 0); | - | ||||||||||||
| 285 | } never executed: end of block | 0 | ||||||||||||
| 286 | - | |||||||||||||
| 287 | - | |||||||||||||
| 288 | - | |||||||||||||
| 289 | - | |||||||||||||
| 290 | QXcbSessionManager::QXcbSessionManager(const QString &id, const QString &key) | - | ||||||||||||
| 291 | : QPlatformSessionManager(id, key) | - | ||||||||||||
| 292 | , m_eventLoop(0) | - | ||||||||||||
| 293 | { | - | ||||||||||||
| 294 | resetSmState(); | - | ||||||||||||
| 295 | char cerror[256]; | - | ||||||||||||
| 296 | char* myId = 0; | - | ||||||||||||
| 297 | QByteArray b_id = id.toLatin1(); | - | ||||||||||||
| 298 | char* prevId = b_id.data(); | - | ||||||||||||
| 299 | - | |||||||||||||
| 300 | SmcCallbacks cb; | - | ||||||||||||
| 301 | cb.save_yourself.callback = sm_saveYourselfCallback; | - | ||||||||||||
| 302 | cb.save_yourself.client_data = (SmPointer) this; | - | ||||||||||||
| 303 | cb.die.callback = sm_dieCallback; | - | ||||||||||||
| 304 | cb.die.client_data = (SmPointer) this; | - | ||||||||||||
| 305 | cb.save_complete.callback = sm_saveCompleteCallback; | - | ||||||||||||
| 306 | cb.save_complete.client_data = (SmPointer) this; | - | ||||||||||||
| 307 | cb.shutdown_cancelled.callback = sm_shutdownCancelledCallback; | - | ||||||||||||
| 308 | cb.shutdown_cancelled.client_data = (SmPointer) this; | - | ||||||||||||
| 309 | - | |||||||||||||
| 310 | - | |||||||||||||
| 311 | if (!qEnvironmentVariableIsSet("SESSION_MANAGER")
| 0-135 | ||||||||||||
| 312 | return; executed 135 times by 5 tests: return;Executed by:
| 135 | ||||||||||||
| 313 | - | |||||||||||||
| 314 | smcConnection = SmcOpenConnection(0, 0, 1, 0, | - | ||||||||||||
| 315 | (1L << 0) | | - | ||||||||||||
| 316 | (1L << 1) | | - | ||||||||||||
| 317 | (1L << 2) | | - | ||||||||||||
| 318 | (1L << 3), | - | ||||||||||||
| 319 | &cb, | - | ||||||||||||
| 320 | prevId, | - | ||||||||||||
| 321 | &myId, | - | ||||||||||||
| 322 | 256, cerror); | - | ||||||||||||
| 323 | - | |||||||||||||
| 324 | setSessionId(QString::fromLatin1(myId)); | - | ||||||||||||
| 325 | ::free(myId); | - | ||||||||||||
| 326 | - | |||||||||||||
| 327 | QString error = QString::fromLocal8Bit(cerror); | - | ||||||||||||
| 328 | if (!smcConnection
| 0 | ||||||||||||
| 329 | QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).warning("Qt: Session management error: %s", QString(error).toLocal8Bit().constData()); never executed: QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).warning("Qt: Session management error: %s", QString(error).toLocal8Bit().constData()); | 0 | ||||||||||||
| 330 | else | - | ||||||||||||
| 331 | sm_receiver = new QSmSocketReceiver(IceConnectionNumber(SmcGetIceConnection(smcConnection))); never executed: sm_receiver = new QSmSocketReceiver(IceConnectionNumber(SmcGetIceConnection(smcConnection))); | 0 | ||||||||||||
| 332 | } | - | ||||||||||||
| 333 | - | |||||||||||||
| 334 | QXcbSessionManager::~QXcbSessionManager() | - | ||||||||||||
| 335 | { | - | ||||||||||||
| 336 | if (smcConnection
| 0-347 | ||||||||||||
| 337 | SmcCloseConnection(smcConnection, 0, 0); never executed: SmcCloseConnection(smcConnection, 0, 0); | 0 | ||||||||||||
| 338 | smcConnection = 0; | - | ||||||||||||
| 339 | delete sm_receiver; | - | ||||||||||||
| 340 | } executed 347 times by 219 tests: end of blockExecuted by:
| 347 | ||||||||||||
| 341 | - | |||||||||||||
| 342 | - | |||||||||||||
| 343 | void* QXcbSessionManager::handle() const | - | ||||||||||||
| 344 | { | - | ||||||||||||
| 345 | return never executed: (void*) smcConnection;return (void*) smcConnection;never executed: return (void*) smcConnection; | 0 | ||||||||||||
| 346 | } | - | ||||||||||||
| 347 | - | |||||||||||||
| 348 | bool QXcbSessionManager::allowsInteraction() | - | ||||||||||||
| 349 | { | - | ||||||||||||
| 350 | if (sm_interactionActive
| 0 | ||||||||||||
| 351 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 352 | - | |||||||||||||
| 353 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 354 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 355 | - | |||||||||||||
| 356 | if (sm_interactStyle == 2
| 0 | ||||||||||||
| 357 | sm_waitingForInteraction = SmcInteractRequest(smcConnection, | - | ||||||||||||
| 358 | 1, | - | ||||||||||||
| 359 | sm_interactCallback, | - | ||||||||||||
| 360 | (SmPointer*) this); | - | ||||||||||||
| 361 | } never executed: end of block | 0 | ||||||||||||
| 362 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 363 | QEventLoop eventLoop; | - | ||||||||||||
| 364 | m_eventLoop = &eventLoop; | - | ||||||||||||
| 365 | eventLoop.exec(); | - | ||||||||||||
| 366 | m_eventLoop = 0; | - | ||||||||||||
| 367 | - | |||||||||||||
| 368 | sm_waitingForInteraction = false; | - | ||||||||||||
| 369 | if (sm_smActive
| 0 | ||||||||||||
| 370 | sm_interactionActive = true; | - | ||||||||||||
| 371 | qt_sm_blockUserInput = false; | - | ||||||||||||
| 372 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 373 | } | - | ||||||||||||
| 374 | } never executed: end of block | 0 | ||||||||||||
| 375 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 376 | } | - | ||||||||||||
| 377 | - | |||||||||||||
| 378 | bool QXcbSessionManager::allowsErrorInteraction() | - | ||||||||||||
| 379 | { | - | ||||||||||||
| 380 | if (sm_interactionActive
| 0 | ||||||||||||
| 381 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 382 | - | |||||||||||||
| 383 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 384 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 385 | - | |||||||||||||
| 386 | if (sm_interactStyle == 2
| 0 | ||||||||||||
| 387 | sm_waitingForInteraction = SmcInteractRequest(smcConnection, | - | ||||||||||||
| 388 | 0, | - | ||||||||||||
| 389 | sm_interactCallback, | - | ||||||||||||
| 390 | (SmPointer*) this); | - | ||||||||||||
| 391 | } never executed: end of block | 0 | ||||||||||||
| 392 | if (sm_waitingForInteraction
| 0 | ||||||||||||
| 393 | QEventLoop eventLoop; | - | ||||||||||||
| 394 | m_eventLoop = &eventLoop; | - | ||||||||||||
| 395 | eventLoop.exec(); | - | ||||||||||||
| 396 | m_eventLoop = 0; | - | ||||||||||||
| 397 | - | |||||||||||||
| 398 | sm_waitingForInteraction = false; | - | ||||||||||||
| 399 | if (sm_smActive
| 0 | ||||||||||||
| 400 | sm_interactionActive = true; | - | ||||||||||||
| 401 | qt_sm_blockUserInput = false; | - | ||||||||||||
| 402 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 403 | } | - | ||||||||||||
| 404 | } never executed: end of block | 0 | ||||||||||||
| 405 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 406 | } | - | ||||||||||||
| 407 | - | |||||||||||||
| 408 | void QXcbSessionManager::release() | - | ||||||||||||
| 409 | { | - | ||||||||||||
| 410 | if (sm_interactionActive
| 0 | ||||||||||||
| 411 | SmcInteractDone(smcConnection, 0); | - | ||||||||||||
| 412 | sm_interactionActive = false; | - | ||||||||||||
| 413 | if (sm_smActive
| 0 | ||||||||||||
| 414 | qt_sm_blockUserInput = true; never executed: qt_sm_blockUserInput = true; | 0 | ||||||||||||
| 415 | } never executed: end of block | 0 | ||||||||||||
| 416 | } never executed: end of block | 0 | ||||||||||||
| 417 | - | |||||||||||||
| 418 | void QXcbSessionManager::cancel() | - | ||||||||||||
| 419 | { | - | ||||||||||||
| 420 | sm_cancel = true; | - | ||||||||||||
| 421 | } never executed: end of block | 0 | ||||||||||||
| 422 | - | |||||||||||||
| 423 | void QXcbSessionManager::setManagerProperty(const QString &name, const QString &value) | - | ||||||||||||
| 424 | { | - | ||||||||||||
| 425 | sm_setProperty(name, value); | - | ||||||||||||
| 426 | } never executed: end of block | 0 | ||||||||||||
| 427 | - | |||||||||||||
| 428 | void QXcbSessionManager::setManagerProperty(const QString &name, const QStringList &value) | - | ||||||||||||
| 429 | { | - | ||||||||||||
| 430 | sm_setProperty(name, value); | - | ||||||||||||
| 431 | } never executed: end of block | 0 | ||||||||||||
| 432 | - | |||||||||||||
| 433 | bool QXcbSessionManager::isPhase2() const | - | ||||||||||||
| 434 | { | - | ||||||||||||
| 435 | return never executed: sm_in_phase2;return sm_in_phase2;never executed: return sm_in_phase2; | 0 | ||||||||||||
| 436 | } | - | ||||||||||||
| 437 | - | |||||||||||||
| 438 | void QXcbSessionManager::requestPhase2() | - | ||||||||||||
| 439 | { | - | ||||||||||||
| 440 | sm_phase2 = true; | - | ||||||||||||
| 441 | } never executed: end of block | 0 | ||||||||||||
| 442 | - | |||||||||||||
| 443 | void QXcbSessionManager::exitEventLoop() | - | ||||||||||||
| 444 | { | - | ||||||||||||
| 445 | m_eventLoop->exit(); | - | ||||||||||||
| 446 | } never executed: end of block | 0 | ||||||||||||
| 447 | - | |||||||||||||
| Switch to Source code | Preprocessed file |