kernel/qcoreapplication.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5class QMutexUnlocker -
6{ -
7public: -
8 inline explicit QMutexUnlocker(QMutex *m) -
9 : mtx(m) -
10 { }
executed: }
Execution Count:476519
476519
11 inline ~QMutexUnlocker() { unlock(); }
executed: }
Execution Count:476518
476518
12 inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; }
executed: mtx->unlock();
Execution Count:476517
evaluated: mtx
TRUEFALSE
yes
Evaluation Count:476517
yes
Evaluation Count:468151
executed: }
Execution Count:944666
468151-944666
13 -
14private: -
15 QMutexUnlocker(const QMutexUnlocker &) = delete; QMutexUnlocker &operator=(const QMutexUnlocker &) = delete; -
16 -
17 QMutex *mtx; -
18}; -
19int QCoreApplicationPrivate::app_compile_version = 0x050000; -
20QString QCoreApplicationPrivate::appName() const -
21{ -
22 static QString applName; -
23 -
24 -
25 -
26 if (applName.isEmpty() && argv[0]) {
evaluated: applName.isEmpty()
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:5328
partially evaluated: argv[0]
TRUEFALSE
yes
Evaluation Count:111
no
Evaluation Count:0
0-5328
27 char *p = strrchr(argv[0], '/'); -
28 applName = QString::fromLocal8Bit(p ? p + 1 : argv[0]); -
29 }
executed: }
Execution Count:111
111
30 return applName;
executed: return applName;
Execution Count:5439
5439
31} -
32 -
33 -
34bool QCoreApplicationPrivate::checkInstance(const char *function) -
35{ -
36 bool b = (QCoreApplication::self != 0); -
37 if (!b)
partially evaluated: !b
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:142
0-142
38 QMessageLogger("kernel/qcoreapplication.cpp", 155, __PRETTY_FUNCTION__).warning("QApplication::%s: Please instantiate the QApplication object first", function);
never executed: QMessageLogger("kernel/qcoreapplication.cpp", 155, __PRETTY_FUNCTION__).warning("QApplication::%s: Please instantiate the QApplication object first", function);
0
39 return b;
executed: return b;
Execution Count:142
142
40} -
41 -
42void QCoreApplicationPrivate::processCommandLineArguments() -
43{ -
44 int j = argc ? 1 : 0;
evaluated: argc
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:92
53-92
45 for (int i = 1; i < argc; ++i) {
evaluated: i < argc
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:145
12-145
46 if (argv[i] && *argv[i] != '-') {
partially evaluated: argv[i]
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
evaluated: *argv[i] != '-'
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
0-12
47 argv[j++] = argv[i]; -
48 continue;
executed: continue;
Execution Count:6
6
49 } -
50 QByteArray arg = argv[i]; -
51 if (arg.startsWith("-qmljsdebugger=")) {
evaluated: arg.startsWith("-qmljsdebugger=")
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5
1-5
52 qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15)); -
53 } else if (arg == "-qmljsdebugger" && i < argc - 1) {
partially evaluated: arg == "-qmljsdebugger"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
never evaluated: i < argc - 1
executed: }
Execution Count:1
0-5
54 ++i; -
55 qmljs_debug_arguments = QString::fromLocal8Bit(argv[i]); -
56 } else {
never executed: }
0
57 argv[j++] = argv[i]; -
58 }
executed: }
Execution Count:5
5
59 } -
60 -
61 if (j < argc) {
evaluated: j < argc
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:144
1-144
62 argv[j] = 0; -
63 argc = j; -
64 }
executed: }
Execution Count:1
1
65}
executed: }
Execution Count:145
145
66 -
67 -
68 -
69QSignalSpyCallbackSet __attribute__((visibility("default"))) qt_signal_spy_callback_set = { 0, 0, 0, 0 }; -
70 -
71void qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set) -
72{ -
73 qt_signal_spy_callback_set = callback_set; -
74}
executed: }
Execution Count:394
394
75 -
76extern "C" void __attribute__((visibility("default"))) qt_startup_hook() -
77{ -
78} -
79 -
80typedef QList<QtCleanUpFunction> QVFuncList; -
81static QVFuncList *postRList() { static QGlobalStatic<QVFuncList > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QVFuncList *x = new QVFuncList; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QVFuncList > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:819
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:160
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:659
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-819
82 -
83void qAddPostRoutine(QtCleanUpFunction p) -
84{ -
85 QVFuncList *list = postRList(); -
86 if (!list)
partially evaluated: !list
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
87 return;
never executed: return;
0
88 list->prepend(p); -
89}
executed: }
Execution Count:123
123
90 -
91void qRemovePostRoutine(QtCleanUpFunction p) -
92{ -
93 QVFuncList *list = postRList(); -
94 if (!list)
never evaluated: !list
0
95 return;
never executed: return;
0
96 list->removeAll(p); -
97}
never executed: }
0
98 -
99void __attribute__((visibility("default"))) qt_call_post_routines() -
100{ -
101 QVFuncList *list = 0; -
102 try { -
103 list = postRList(); -
104 } catch (const std::bad_alloc &) {
executed: }
Execution Count:696
696
105 -
106 -
107 -
108 }
never executed: }
0
109 if (!list)
partially evaluated: !list
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:696
0-696
110 return;
never executed: return;
0
111 while (!list->isEmpty())
evaluated: !list->isEmpty()
TRUEFALSE
yes
Evaluation Count:309
yes
Evaluation Count:696
309-696
112 (list->takeFirst())();
executed: (list->takeFirst())();
Execution Count:309
309
113}
executed: }
Execution Count:696
696
114 -
115 -
116 -
117bool QCoreApplicationPrivate::is_app_running = false; -
118 -
119bool QCoreApplicationPrivate::is_app_closing = false; -
120 -
121static bool qt_locale_initialized = false; -
122 -
123__attribute__((visibility("default"))) uint qGlobalPostedEventsCount() -
124{ -
125 QThreadData *currentThreadData = QThreadData::current(); -
126 return currentThreadData->postEventList.size() - currentThreadData->postEventList.startOffset;
executed: return currentThreadData->postEventList.size() - currentThreadData->postEventList.startOffset;
Execution Count:8
8
127} -
128 -
129QCoreApplication *QCoreApplication::self = 0; -
130QAbstractEventDispatcher *QCoreApplicationPrivate::eventDispatcher = 0; -
131uint QCoreApplicationPrivate::attribs = (1 << Qt::AA_SynthesizeMouseForUnhandledTouchEvents); -
132 -
133 -
134Qt::HANDLE qt_application_thread_id = 0; -
135 -
136 -
137struct QCoreApplicationData { -
138 QCoreApplicationData() { -
139 -
140 app_libpaths = 0; -
141 -
142 }
executed: }
Execution Count:6
6
143 ~QCoreApplicationData() { -
144 -
145 delete app_libpaths; -
146 -
147 -
148 -
149 if (QCoreApplicationPrivate::theMainThread) {
partially evaluated: QCoreApplicationPrivate::theMainThread
TRUEFALSE
yes
Evaluation Count:346
no
Evaluation Count:0
0-346
150 QThreadData *data = QThreadData::get2(QCoreApplicationPrivate::theMainThread); -
151 QCoreApplicationPrivate::theMainThread = 0; -
152 data->deref(); -
153 }
executed: }
Execution Count:346
346
154 }
executed: }
Execution Count:346
346
155 QString orgName, orgDomain, application; -
156 QString applicationVersion; -
157 -
158 -
159 QStringList *app_libpaths; -
160 -
161 -
162}; -
163 -
164static QCoreApplicationData *coreappdata() { static QGlobalStatic<QCoreApplicationData > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QCoreApplicationData *x = new QCoreApplicationData; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QCoreApplicationData > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:16666
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:16660
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-16666
165 -
166static bool quitLockRefEnabled = true; -
167 -
168QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint flags) -
169 : QObjectPrivate() -
170 , argc(aargc) -
171 , argv(aargv) -
172 -
173 -
174 -
175 -
176 , application_type(0) -
177 , in_exec(false) -
178 , aboutToQuitEmitted(false) -
179 , threadData_clean(false) -
180{ -
181 app_compile_version = flags & 0xffffff; -
182 static const char *const empty = ""; -
183 if (argc == 0 || argv == 0) {
evaluated: argc == 0
TRUEFALSE
yes
Evaluation Count:92
yes
Evaluation Count:53
partially evaluated: argv == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
0-92
184 argc = 0; -
185 argv = (char **)&empty; -
186 }
executed: }
Execution Count:92
92
187 QCoreApplicationPrivate::is_app_closing = false; -
188 -
189 -
190 qt_application_thread_id = QThread::currentThreadId(); -
191 -
192 -
193 -
194 -
195 -
196 if (QThread::currentThread() != theMainThread)
partially evaluated: QThread::currentThread() != theMainThread
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:145
0-145
197 QMessageLogger("kernel/qcoreapplication.cpp", 343, __PRETTY_FUNCTION__).warning("WARNING: QApplication was not created in the main() thread.");
never executed: QMessageLogger("kernel/qcoreapplication.cpp", 343, __PRETTY_FUNCTION__).warning("WARNING: QApplication was not created in the main() thread.");
0
198}
executed: }
Execution Count:145
145
199 -
200QCoreApplicationPrivate::~QCoreApplicationPrivate() -
201{ -
202 cleanupThreadData(); -
203 -
204 -
205 -
206}
executed: }
Execution Count:483
483
207 -
208void QCoreApplicationPrivate::cleanupThreadData() -
209{ -
210 if (threadData && !threadData_clean) {
partially evaluated: threadData
TRUEFALSE
yes
Evaluation Count:770
no
Evaluation Count:0
evaluated: !threadData_clean
TRUEFALSE
yes
Evaluation Count:483
yes
Evaluation Count:287
0-770
211 -
212 void *data = &threadData->tls; -
213 QThreadStorageData::finish((void **)data); -
214 -
215 -
216 -
217 QMutexLocker locker(&threadData->postEventList.mutex); -
218 for (int i = 0; i < threadData->postEventList.size(); ++i) {
evaluated: i < threadData->postEventList.size()
TRUEFALSE
yes
Evaluation Count:5904
yes
Evaluation Count:483
483-5904
219 const QPostEvent &pe = threadData->postEventList.at(i); -
220 if (pe.event) {
evaluated: pe.event
TRUEFALSE
yes
Evaluation Count:5892
yes
Evaluation Count:12
12-5892
221 --pe.receiver->d_func()->postedEvents; -
222 pe.event->posted = false; -
223 delete pe.event; -
224 }
executed: }
Execution Count:5892
5892
225 }
executed: }
Execution Count:5904
5904
226 threadData->postEventList.clear(); -
227 threadData->postEventList.recursion = 0; -
228 threadData->quitNow = false; -
229 threadData_clean = true; -
230 }
executed: }
Execution Count:483
483
231}
executed: }
Execution Count:770
770
232 -
233void QCoreApplicationPrivate::createEventDispatcher() -
234{ -
235 QCoreApplication * const q = q_func(); -
236 -
237 -
238 -
239 -
240 -
241 if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && QEventDispatcherGlib::versionSupported())
partially evaluated: qEnvironmentVariableIsEmpty("QT_NO_GLIB")
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
partially evaluated: QEventDispatcherGlib::versionSupported()
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
242 eventDispatcher = new QEventDispatcherGlib(q);
executed: eventDispatcher = new QEventDispatcherGlib(q);
Execution Count:39
39
243 else -
244 -
245 eventDispatcher = new QEventDispatcherUNIX(q);
never executed: eventDispatcher = new QEventDispatcherUNIX(q);
0
246 -
247 -
248 -
249 -
250 -
251 -
252} -
253 -
254QThread *QCoreApplicationPrivate::theMainThread = 0; -
255QThread *QCoreApplicationPrivate::mainThread() -
256{ -
257 qt_noop(); -
258 return theMainThread;
executed: return theMainThread;
Execution Count:8888
8888
259} -
260void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() -
261{ -
262 -
263 QStringList *app_libpaths = coreappdata()->app_libpaths; -
264 if (!app_libpaths)
partially evaluated: !app_libpaths
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34
0-34
265 coreappdata()->app_libpaths = app_libpaths = new QStringList;
never executed: coreappdata()->app_libpaths = app_libpaths = new QStringList;
0
266 QString app_location = QCoreApplication::applicationFilePath(); -
267 app_location.truncate(app_location.lastIndexOf(QLatin1Char('/'))); -
268 app_location = QDir(app_location).canonicalPath(); -
269 if (QFile::exists(app_location) && !app_libpaths->contains(app_location))
partially evaluated: QFile::exists(app_location)
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
evaluated: !app_libpaths->contains(app_location)
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:3
0-34
270 app_libpaths->append(app_location);
executed: app_libpaths->append(app_location);
Execution Count:31
31
271 -
272}
executed: }
Execution Count:34
34
273 -
274QString qAppName() -
275{ -
276 if (!QCoreApplicationPrivate::checkInstance("qAppName"))
partially evaluated: !QCoreApplicationPrivate::checkInstance("qAppName")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
277 return QString();
never executed: return QString();
0
278 return QCoreApplication::instance()->d_func()->appName();
executed: return QCoreApplication::instance()->d_func()->appName();
Execution Count:3
3
279} -
280 -
281void QCoreApplicationPrivate::initLocale() -
282{ -
283 if (qt_locale_initialized)
evaluated: qt_locale_initialized
TRUEFALSE
yes
Evaluation Count:139
yes
Evaluation Count:6
6-139
284 return;
executed: return;
Execution Count:139
139
285 qt_locale_initialized = true; -
286 -
287 setlocale(__LC_ALL, ""); -
288 -
289}
executed: }
Execution Count:6
6
290QCoreApplication::QCoreApplication(QCoreApplicationPrivate &p) -
291 : QObject(p, 0) -
292{ -
293 init(); -
294 -
295 -
296}
executed: }
Execution Count:105
105
297void QCoreApplication::flush() -
298{ -
299 if (self && self->d_func()->eventDispatcher)
partially evaluated: self
TRUEFALSE
yes
Evaluation Count:270
no
Evaluation Count:0
partially evaluated: self->d_func()->eventDispatcher
TRUEFALSE
yes
Evaluation Count:270
no
Evaluation Count:0
0-270
300 self->d_func()->eventDispatcher->flush();
executed: self->d_func()->eventDispatcher->flush();
Execution Count:270
270
301}
executed: }
Execution Count:270
270
302QCoreApplication::QCoreApplication(int &argc, char **argv -
303 -
304 , int _internal -
305 -
306 ) -
307 : QObject(*new QCoreApplicationPrivate(argc, argv, _internal)) -
308{ -
309 init(); -
310 QCoreApplicationPrivate::eventDispatcher->startingUp(); -
311}
executed: }
Execution Count:40
40
312 -
313 -
314 -
315void QCoreApplication::init() -
316{ -
317 QCoreApplicationPrivate * const d = d_func(); -
318 -
319 QCoreApplicationPrivate::initLocale(); -
320 -
321 qt_noop(); -
322 QCoreApplication::self = this; -
323 -
324 -
325 if (!QCoreApplicationPrivate::eventDispatcher)
partially evaluated: !QCoreApplicationPrivate::eventDispatcher
TRUEFALSE
yes
Evaluation Count:145
no
Evaluation Count:0
0-145
326 QCoreApplicationPrivate::eventDispatcher = d->threadData->eventDispatcher;
executed: QCoreApplicationPrivate::eventDispatcher = d->threadData->eventDispatcher;
Execution Count:145
145
327 -
328 if (!QCoreApplicationPrivate::eventDispatcher)
evaluated: !QCoreApplicationPrivate::eventDispatcher
TRUEFALSE
yes
Evaluation Count:144
yes
Evaluation Count:1
1-144
329 d->createEventDispatcher();
executed: d->createEventDispatcher();
Execution Count:144
144
330 qt_noop(); -
331 -
332 if (!QCoreApplicationPrivate::eventDispatcher->parent()) {
evaluated: !QCoreApplicationPrivate::eventDispatcher->parent()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:144
1-144
333 QCoreApplicationPrivate::eventDispatcher->moveToThread(d->threadData->thread); -
334 QCoreApplicationPrivate::eventDispatcher->setParent(this); -
335 }
executed: }
Execution Count:1
1
336 -
337 d->threadData->eventDispatcher = QCoreApplicationPrivate::eventDispatcher; -
338 -
339 -
340 if (coreappdata()->app_libpaths)
evaluated: coreappdata()->app_libpaths
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:140
5-140
341 d->appendApplicationPathToLibraryPaths();
executed: d->appendApplicationPathToLibraryPaths();
Execution Count:5
5
342 -
343 -
344 -
345 -
346 -
347 QProcessPrivate::initializeProcessManager(); -
348 -
349 -
350 -
351 -
352 -
353 -
354 -
355 d->processCommandLineArguments(); -
356 -
357 qt_startup_hook(); -
358}
executed: }
Execution Count:145
145
359 -
360 -
361 -
362 -
363QCoreApplication::~QCoreApplication() -
364{ -
365 qt_call_post_routines(); -
366 -
367 self = 0; -
368 QCoreApplicationPrivate::is_app_closing = true; -
369 QCoreApplicationPrivate::is_app_running = false; -
370 -
371 -
372 -
373 QThreadPool *globalThreadPool = 0; -
374 try { -
375 globalThreadPool = QThreadPool::globalInstance(); -
376 } catch (...) {
executed: }
Execution Count:483
483
377 -
378 }
never executed: }
0
379 if (globalThreadPool)
partially evaluated: globalThreadPool
TRUEFALSE
yes
Evaluation Count:483
no
Evaluation Count:0
0-483
380 globalThreadPool->waitForDone();
executed: globalThreadPool->waitForDone();
Execution Count:483
483
381 -
382 -
383 d_func()->threadData->eventDispatcher = 0; -
384 if (QCoreApplicationPrivate::eventDispatcher)
evaluated: QCoreApplicationPrivate::eventDispatcher
TRUEFALSE
yes
Evaluation Count:196
yes
Evaluation Count:287
196-287
385 QCoreApplicationPrivate::eventDispatcher->closingDown();
executed: QCoreApplicationPrivate::eventDispatcher->closingDown();
Execution Count:196
196
386 QCoreApplicationPrivate::eventDispatcher = 0; -
387 -
388 -
389 delete coreappdata()->app_libpaths; -
390 coreappdata()->app_libpaths = 0; -
391 -
392}
executed: }
Execution Count:483
483
393void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on) -
394{ -
395 if (on)
evaluated: on
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:6
6-113
396 QCoreApplicationPrivate::attribs |= 1 << attribute;
executed: QCoreApplicationPrivate::attribs |= 1 << attribute;
Execution Count:113
113
397 else -
398 QCoreApplicationPrivate::attribs &= ~(1 << attribute);
executed: QCoreApplicationPrivate::attribs &= ~(1 << attribute);
Execution Count:6
6
399} -
400 -
401 -
402 -
403 -
404 -
405 -
406 -
407bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute) -
408{ -
409 return QCoreApplicationPrivate::testAttribute(attribute);
executed: return QCoreApplicationPrivate::testAttribute(attribute);
Execution Count:439800
439800
410} -
411bool QCoreApplication::isQuitLockEnabled() -
412{ -
413 return quitLockRefEnabled;
executed: return quitLockRefEnabled;
Execution Count:12
12
414} -
415void QCoreApplication::setQuitLockEnabled(bool enabled) -
416{ -
417 quitLockRefEnabled = enabled; -
418}
never executed: }
0
419 -
420 -
421 -
422 -
423 -
424 -
425 -
426bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) -
427{ -
428 -
429 -
430 bool result = false; -
431 void *cbdata[] = { receiver, event, &result }; -
432 if (QInternal::activateCallbacks(QInternal::EventNotifyCallback, cbdata)) {
partially evaluated: QInternal::activateCallbacks(QInternal::EventNotifyCallback, cbdata)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1194751
0-1194751
433 return result;
never executed: return result;
0
434 } -
435 -
436 -
437 -
438 -
439 -
440 QObjectPrivate *d = receiver->d_func(); -
441 QThreadData *threadData = d->threadData; -
442 QScopedLoopLevelCounter loopLevelCounter(threadData); -
443 return notify(receiver, event);
executed: return notify(receiver, event);
Execution Count:1194737
1194737
444} -
445bool QCoreApplication::notify(QObject *receiver, QEvent *event) -
446{ -
447 QCoreApplicationPrivate * const d = d_func(); -
448 -
449 if (QCoreApplicationPrivate::is_app_closing)
evaluated: QCoreApplicationPrivate::is_app_closing
TRUEFALSE
yes
Evaluation Count:213
yes
Evaluation Count:495119
213-495119
450 return true;
executed: return true;
Execution Count:213
213
451 -
452 if (receiver == 0) {
partially evaluated: receiver == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:495119
0-495119
453 QMessageLogger("kernel/qcoreapplication.cpp", 821, __PRETTY_FUNCTION__).warning("QCoreApplication::notify: Unexpected null receiver"); -
454 return true;
never executed: return true;
0
455 } -
456 -
457 -
458 -
459 -
460 -
461 return receiver->isWidgetType() ? false : d->notify_helper(receiver, event);
executed: return receiver->isWidgetType() ? false : d->notify_helper(receiver, event);
Execution Count:495116
495116
462} -
463 -
464bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiver, QEvent *event) -
465{ -
466 if (receiver->d_func()->threadData == this->threadData && extraData) {
evaluated: receiver->d_func()->threadData == this->threadData
TRUEFALSE
yes
Evaluation Count:1116668
yes
Evaluation Count:101235
evaluated: extraData
TRUEFALSE
yes
Evaluation Count:125924
yes
Evaluation Count:990744
101235-1116668
467 -
468 for (int i = 0; i < extraData->eventFilters.size(); ++i) {
evaluated: i < extraData->eventFilters.size()
TRUEFALSE
yes
Evaluation Count:155610
yes
Evaluation Count:125909
125909-155610
469 register QObject *obj = extraData->eventFilters.at(i); -
470 if (!obj)
evaluated: !obj
TRUEFALSE
yes
Evaluation Count:29818
yes
Evaluation Count:125792
29818-125792
471 continue;
executed: continue;
Execution Count:29818
29818
472 if (obj->d_func()->threadData != threadData) {
partially evaluated: obj->d_func()->threadData != threadData
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:125792
0-125792
473 QMessageLogger("kernel/qcoreapplication.cpp", 841, __PRETTY_FUNCTION__).warning("QCoreApplication: Application event filter cannot be in a different thread."); -
474 continue;
never executed: continue;
0
475 } -
476 if (obj->eventFilter(receiver, event))
evaluated: obj->eventFilter(receiver, event)
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:125777
15-125777
477 return true;
executed: return true;
Execution Count:15
15
478 }
executed: }
Execution Count:125777
125777
479 }
executed: }
Execution Count:125909
125909
480 return false;
executed: return false;
Execution Count:1217818
1217818
481} -
482 -
483bool QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *receiver, QEvent *event) -
484{ -
485 QCoreApplication * const q = q_func(); -
486 if (receiver != q && receiver->d_func()->extraData) {
evaluated: receiver != q
TRUEFALSE
yes
Evaluation Count:1215503
yes
Evaluation Count:2309
evaluated: receiver->d_func()->extraData
TRUEFALSE
yes
Evaluation Count:374701
yes
Evaluation Count:840836
2309-1215503
487 for (int i = 0; i < receiver->d_func()->extraData->eventFilters.size(); ++i) {
evaluated: i < receiver->d_func()->extraData->eventFilters.size()
TRUEFALSE
yes
Evaluation Count:147738
yes
Evaluation Count:354035
147738-354035
488 register QObject *obj = receiver->d_func()->extraData->eventFilters.at(i); -
489 if (!obj)
evaluated: !obj
TRUEFALSE
yes
Evaluation Count:10469
yes
Evaluation Count:137269
10469-137269
490 continue;
executed: continue;
Execution Count:10469
10469
491 if (obj->d_func()->threadData != receiver->d_func()->threadData) {
evaluated: obj->d_func()->threadData != receiver->d_func()->threadData
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:137268
1-137268
492 QMessageLogger("kernel/qcoreapplication.cpp", 860, __PRETTY_FUNCTION__).warning("QCoreApplication: Object event filter cannot be in a different thread."); -
493 continue;
executed: continue;
Execution Count:1
1
494 } -
495 if (obj->eventFilter(receiver, event))
evaluated: obj->eventFilter(receiver, event)
TRUEFALSE
yes
Evaluation Count:20666
yes
Evaluation Count:116602
20666-116602
496 return true;
executed: return true;
Execution Count:20666
20666
497 }
executed: }
Execution Count:116602
116602
498 }
executed: }
Execution Count:354035
354035
499 return false;
executed: return false;
Execution Count:1197163
1197163
500} -
501 -
502 -
503 -
504 -
505 -
506 -
507bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event) -
508{ -
509 -
510 if (sendThroughApplicationEventFilters(receiver, event))
partially evaluated: sendThroughApplicationEventFilters(receiver, event)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:495059
0-495059
511 return true;
never executed: return true;
0
512 -
513 if (sendThroughObjectEventFilters(receiver, event))
partially evaluated: sendThroughObjectEventFilters(receiver, event)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:495054
0-495054
514 return true;
never executed: return true;
0
515 -
516 return receiver->event(event);
executed: return receiver->event(event);
Execution Count:495062
495062
517} -
518bool QCoreApplication::startingUp() -
519{ -
520 return !QCoreApplicationPrivate::is_app_running;
executed: return !QCoreApplicationPrivate::is_app_running;
Execution Count:7
7
521} -
522bool QCoreApplication::closingDown() -
523{ -
524 return QCoreApplicationPrivate::is_app_closing;
executed: return QCoreApplicationPrivate::is_app_closing;
Execution Count:57087
57087
525} -
526void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags) -
527{ -
528 QThreadData *data = QThreadData::current(); -
529 if (!data->eventDispatcher)
evaluated: !data->eventDispatcher
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:380645
1-380645
530 return;
executed: return;
Execution Count:1
1
531 data->eventDispatcher->processEvents(flags); -
532}
executed: }
Execution Count:380645
380645
533void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags, int maxtime) -
534{ -
535 QThreadData *data = QThreadData::current(); -
536 if (!data->eventDispatcher)
partially evaluated: !data->eventDispatcher
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:65070
0-65070
537 return;
never executed: return;
0
538 QElapsedTimer start; -
539 start.start(); -
540 while (data->eventDispatcher->processEvents(flags & ~QEventLoop::WaitForMoreEvents)) {
evaluated: data->eventDispatcher->processEvents(flags & ~QEventLoop::WaitForMoreEvents)
TRUEFALSE
yes
Evaluation Count:43356
yes
Evaluation Count:64934
43356-64934
541 if (start.elapsed() > maxtime)
evaluated: start.elapsed() > maxtime
TRUEFALSE
yes
Evaluation Count:57
yes
Evaluation Count:43299
57-43299
542 break;
executed: break;
Execution Count:57
57
543 }
executed: }
Execution Count:43299
43299
544}
executed: }
Execution Count:64986
64986
545int QCoreApplication::exec() -
546{ -
547 if (!QCoreApplicationPrivate::checkInstance("exec"))
partially evaluated: !QCoreApplicationPrivate::checkInstance("exec")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:66
0-66
548 return -1;
never executed: return -1;
0
549 -
550 QThreadData *threadData = self->d_func()->threadData; -
551 if (threadData != QThreadData::current()) {
partially evaluated: threadData != QThreadData::current()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:66
0-66
552 QMessageLogger("kernel/qcoreapplication.cpp", 1008, __PRETTY_FUNCTION__).warning("%s::exec: Must be called from the main thread", self->metaObject()->className()); -
553 return -1;
never executed: return -1;
0
554 } -
555 if (!threadData->eventLoops.isEmpty()) {
partially evaluated: !threadData->eventLoops.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:66
0-66
556 QMessageLogger("kernel/qcoreapplication.cpp", 1012, __PRETTY_FUNCTION__).warning("QCoreApplication::exec: The event loop is already running"); -
557 return -1;
never executed: return -1;
0
558 } -
559 -
560 threadData->quitNow = false; -
561 QEventLoop eventLoop; -
562 self->d_func()->in_exec = true; -
563 self->d_func()->aboutToQuitEmitted = false; -
564 int returnCode = eventLoop.exec(); -
565 threadData->quitNow = false; -
566 if (self) {
partially evaluated: self
TRUEFALSE
yes
Evaluation Count:66
no
Evaluation Count:0
0-66
567 self->d_func()->in_exec = false; -
568 if (!self->d_func()->aboutToQuitEmitted)
partially evaluated: !self->d_func()->aboutToQuitEmitted
TRUEFALSE
yes
Evaluation Count:66
no
Evaluation Count:0
0-66
569 self->aboutToQuit(QPrivateSignal());
executed: self->aboutToQuit(QPrivateSignal());
Execution Count:66
66
570 self->d_func()->aboutToQuitEmitted = true; -
571 sendPostedEvents(0, QEvent::DeferredDelete); -
572 }
executed: }
Execution Count:66
66
573 -
574 return returnCode;
executed: return returnCode;
Execution Count:66
66
575} -
576void QCoreApplication::exit(int returnCode) -
577{ -
578 if (!self)
partially evaluated: !self
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
579 return;
never executed: return;
0
580 QThreadData *data = self->d_func()->threadData; -
581 data->quitNow = true; -
582 for (int i = 0; i < data->eventLoops.size(); ++i) {
evaluated: i < data->eventLoops.size()
TRUEFALSE
yes
Evaluation Count:72
yes
Evaluation Count:70
70-72
583 QEventLoop *eventLoop = data->eventLoops.at(i); -
584 eventLoop->exit(returnCode); -
585 }
executed: }
Execution Count:72
72
586}
executed: }
Execution Count:70
70
587void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority) -
588{ -
589 if (receiver == 0) {
partially evaluated: receiver == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:476518
0-476518
590 QMessageLogger("kernel/qcoreapplication.cpp", 1110, __PRETTY_FUNCTION__).warning("QCoreApplication::postEvent: Unexpected null receiver"); -
591 delete event; -
592 return;
never executed: return;
0
593 } -
594 -
595 QThreadData * volatile * pdata = &receiver->d_func()->threadData; -
596 QThreadData *data = *pdata; -
597 if (!data) {
partially evaluated: !data
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:476518
0-476518
598 -
599 delete event; -
600 return;
never executed: return;
0
601 } -
602 -
603 -
604 data->postEventList.mutex.lock(); -
605 -
606 -
607 while (data != *pdata) {
evaluated: data != *pdata
TRUEFALSE
yes
Evaluation Count:4568
yes
Evaluation Count:476519
4568-476519
608 data->postEventList.mutex.unlock(); -
609 -
610 data = *pdata; -
611 if (!data) {
partially evaluated: !data
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4568
0-4568
612 -
613 delete event; -
614 return;
never executed: return;
0
615 } -
616 -
617 data->postEventList.mutex.lock(); -
618 }
executed: }
Execution Count:4568
4568
619 -
620 QMutexUnlocker locker(&data->postEventList.mutex); -
621 -
622 -
623 if (receiver->d_func()->postedEvents
evaluated: receiver->d_func()->postedEvents
TRUEFALSE
yes
Evaluation Count:100661
yes
Evaluation Count:375858
100661-375858
624 && self && self->compressEvent(event, receiver, &data->postEventList)) {
partially evaluated: self
TRUEFALSE
yes
Evaluation Count:100661
no
Evaluation Count:0
evaluated: self->compressEvent(event, receiver, &data->postEventList)
TRUEFALSE
yes
Evaluation Count:8367
yes
Evaluation Count:92294
0-100661
625 return;
executed: return;
Execution Count:8367
8367
626 } -
627 -
628 if (event->type() == QEvent::DeferredDelete && data == QThreadData::current()) {
evaluated: event->type() == QEvent::DeferredDelete
TRUEFALSE
yes
Evaluation Count:8426
yes
Evaluation Count:459725
evaluated: data == QThreadData::current()
TRUEFALSE
yes
Evaluation Count:7787
yes
Evaluation Count:639
639-459725
629 -
630 -
631 static_cast<QDeferredDeleteEvent *>(event)->level = data->loopLevel; -
632 }
executed: }
Execution Count:7787
7787
633 -
634 -
635 -
636 QScopedPointer<QEvent> eventDeleter(event); -
637 data->postEventList.addEvent(QPostEvent(receiver, event, priority)); -
638 eventDeleter.take(); -
639 event->posted = true; -
640 ++receiver->d_func()->postedEvents; -
641 data->canWait = false; -
642 locker.unlock(); -
643 -
644 if (data->eventDispatcher)
evaluated: data->eventDispatcher
TRUEFALSE
yes
Evaluation Count:467574
yes
Evaluation Count:576
576-467574
645 data->eventDispatcher->wakeUp();
executed: data->eventDispatcher->wakeUp();
Execution Count:467573
467573
646}
executed: }
Execution Count:468152
468152
647 -
648 -
649 -
650 -
651 -
652bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) -
653{ -
654 if ((event->type() == QEvent::DeferredDelete
evaluated: event->type() == QEvent::DeferredDelete
TRUEFALSE
yes
Evaluation Count:174
yes
Evaluation Count:75156
174-75156
655 || event->type() == QEvent::Quit)
partially evaluated: event->type() == QEvent::Quit
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75156
0-75156
656 && receiver->d_func()->postedEvents > 0) {
partially evaluated: receiver->d_func()->postedEvents > 0
TRUEFALSE
yes
Evaluation Count:174
no
Evaluation Count:0
0-174
657 for (int i = 0; i < postedEvents->size(); ++i) {
evaluated: i < postedEvents->size()
TRUEFALSE
yes
Evaluation Count:5813
yes
Evaluation Count:167
167-5813
658 const QPostEvent &cur = postedEvents->at(i); -
659 if (cur.receiver != receiver
evaluated: cur.receiver != receiver
TRUEFALSE
yes
Evaluation Count:5535
yes
Evaluation Count:278
278-5535
660 || cur.event == 0
evaluated: cur.event == 0
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:267
11-267
661 || cur.event->type() != event->type())
evaluated: cur.event->type() != event->type()
TRUEFALSE
yes
Evaluation Count:260
yes
Evaluation Count:7
7-260
662 continue;
executed: continue;
Execution Count:5806
5806
663 -
664 delete event; -
665 return true;
executed: return true;
Execution Count:7
7
666 } -
667 }
executed: }
Execution Count:167
167
668 return false;
executed: return false;
Execution Count:75323
75323
669} -
670void QCoreApplication::sendPostedEvents(QObject *receiver, int event_type) -
671{ -
672 QThreadData *data = QThreadData::current(); -
673 -
674 QCoreApplicationPrivate::sendPostedEvents(receiver, event_type, data); -
675}
executed: }
Execution Count:2119992
2119992
676 -
677void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type, -
678 QThreadData *data) -
679{ -
680 if (event_type == -1) {
partially evaluated: event_type == -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2119897
0-2119897
681 -
682 event_type = 0; -
683 }
never executed: }
0
684 -
685 if (receiver && receiver->d_func()->threadData != data) {
evaluated: receiver
TRUEFALSE
yes
Evaluation Count:1032
yes
Evaluation Count:2118853
partially evaluated: receiver->d_func()->threadData != data
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1032
0-2118853
686 QMessageLogger("kernel/qcoreapplication.cpp", 1240, __PRETTY_FUNCTION__).warning("QCoreApplication::sendPostedEvents: Cannot send " -
687 "posted events for objects in another thread"); -
688 return;
never executed: return;
0
689 } -
690 -
691 ++data->postEventList.recursion; -
692 -
693 QMutexLocker locker(&data->postEventList.mutex); -
694 -
695 -
696 -
697 -
698 data->canWait = (data->postEventList.size() == 0); -
699 -
700 if (data->postEventList.size() == 0 || (receiver && !receiver->d_func()->postedEvents)) {
evaluated: data->postEventList.size() == 0
TRUEFALSE
yes
Evaluation Count:1787245
yes
Evaluation Count:332671
evaluated: receiver
TRUEFALSE
yes
Evaluation Count:1032
yes
Evaluation Count:331642
evaluated: !receiver->d_func()->postedEvents
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:1007
25-1787245
701 --data->postEventList.recursion; -
702 return;
executed: return;
Execution Count:1787265
1787265
703 } -
704 -
705 data->canWait = true; -
706 -
707 -
708 -
709 int startOffset = data->postEventList.startOffset; -
710 int &i = (!event_type && !receiver) ? data->postEventList.startOffset : startOffset;
evaluated: !event_type
TRUEFALSE
yes
Evaluation Count:328134
yes
Evaluation Count:4514
evaluated: !receiver
TRUEFALSE
yes
Evaluation Count:328101
yes
Evaluation Count:34
34-328134
711 data->postEventList.insertionOffset = data->postEventList.size(); -
712 -
713 -
714 struct CleanUp { -
715 QObject *receiver; -
716 int event_type; -
717 QThreadData *data; -
718 bool exceptionCaught; -
719 -
720 inline CleanUp(QObject *receiver, int event_type, QThreadData *data) : -
721 receiver(receiver), event_type(event_type), data(data), exceptionCaught(true) -
722 {}
executed: }
Execution Count:332647
332647
723 inline ~CleanUp() -
724 { -
725 if (exceptionCaught) {
partially evaluated: exceptionCaught
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:332657
0-332657
726 -
727 data->canWait = false; -
728 }
never executed: }
0
729 -
730 --data->postEventList.recursion; -
731 if (!data->postEventList.recursion && !data->canWait && data->eventDispatcher)
evaluated: !data->postEventList.recursion
TRUEFALSE
yes
Evaluation Count:330814
yes
Evaluation Count:1842
evaluated: !data->canWait
TRUEFALSE
yes
Evaluation Count:42917
yes
Evaluation Count:287906
partially evaluated: data->eventDispatcher
TRUEFALSE
yes
Evaluation Count:42917
no
Evaluation Count:0
0-330814
732 data->eventDispatcher->wakeUp();
executed: data->eventDispatcher->wakeUp();
Execution Count:42916
42916
733 -
734 -
735 -
736 if (!event_type && !receiver && data->postEventList.startOffset >= 0) {
evaluated: !event_type
TRUEFALSE
yes
Evaluation Count:328150
yes
Evaluation Count:4514
evaluated: !receiver
TRUEFALSE
yes
Evaluation Count:328117
yes
Evaluation Count:34
partially evaluated: data->postEventList.startOffset >= 0
TRUEFALSE
yes
Evaluation Count:328117
no
Evaluation Count:0
0-328150
737 const QPostEventList::iterator it = data->postEventList.begin(); -
738 data->postEventList.erase(it, it + data->postEventList.startOffset); -
739 data->postEventList.insertionOffset -= data->postEventList.startOffset; -
740 qt_noop(); -
741 data->postEventList.startOffset = 0; -
742 }
executed: }
Execution Count:328114
328114
743 }
executed: }
Execution Count:332662
332662
744 }; -
745 CleanUp cleanup(receiver, event_type, data); -
746 -
747 while (i < data->postEventList.size()) {
evaluated: i < data->postEventList.size()
TRUEFALSE
yes
Evaluation Count:868864
yes
Evaluation Count:289905
289905-868864
748 -
749 if (i >= data->postEventList.insertionOffset)
evaluated: i >= data->postEventList.insertionOffset
TRUEFALSE
yes
Evaluation Count:42759
yes
Evaluation Count:826190
42759-826190
750 break;
executed: break;
Execution Count:42758
42758
751 -
752 const QPostEvent &pe = data->postEventList.at(i); -
753 ++i; -
754 -
755 if (!pe.event)
evaluated: !pe.event
TRUEFALSE
yes
Evaluation Count:414019
yes
Evaluation Count:412726
412726-414019
756 continue;
executed: continue;
Execution Count:414037
414037
757 if ((receiver && receiver != pe.receiver) || (event_type && event_type != pe.event->type())) {
evaluated: receiver
TRUEFALSE
yes
Evaluation Count:8949
yes
Evaluation Count:403775
evaluated: receiver != pe.receiver
TRUEFALSE
yes
Evaluation Count:6653
yes
Evaluation Count:2296
evaluated: event_type
TRUEFALSE
yes
Evaluation Count:2722
yes
Evaluation Count:403351
evaluated: event_type != pe.event->type()
TRUEFALSE
yes
Evaluation Count:1535
yes
Evaluation Count:1187
1187-403775
758 data->canWait = false; -
759 continue;
executed: continue;
Execution Count:8188
8188
760 } -
761 -
762 if (pe.event->type() == QEvent::DeferredDelete) {
evaluated: pe.event->type() == QEvent::DeferredDelete
TRUEFALSE
yes
Evaluation Count:3648
yes
Evaluation Count:400879
3648-400879
763 -
764 -
765 -
766 int loopLevel = static_cast<QDeferredDeleteEvent *>(pe.event)->loopLevel(); -
767 const bool allowDeferredDelete = -
768 (loopLevel > data->loopLevel
evaluated: loopLevel > data->loopLevel
TRUEFALSE
yes
Evaluation Count:1820
yes
Evaluation Count:1828
1820-1828
769 || (!loopLevel && data->loopLevel > 0)
evaluated: !loopLevel
TRUEFALSE
yes
Evaluation Count:1810
yes
Evaluation Count:18
evaluated: data->loopLevel > 0
TRUEFALSE
yes
Evaluation Count:663
yes
Evaluation Count:1147
18-1810
770 || (event_type == QEvent::DeferredDelete
evaluated: event_type == QEvent::DeferredDelete
TRUEFALSE
yes
Evaluation Count:286
yes
Evaluation Count:879
286-879
771 && loopLevel == data->loopLevel));
evaluated: loopLevel == data->loopLevel
TRUEFALSE
yes
Evaluation Count:285
yes
Evaluation Count:1
1-285
772 if (!allowDeferredDelete) {
evaluated: !allowDeferredDelete
TRUEFALSE
yes
Evaluation Count:880
yes
Evaluation Count:2768
880-2768
773 -
774 if (!event_type && !receiver) {
evaluated: !event_type
TRUEFALSE
yes
Evaluation Count:879
yes
Evaluation Count:1
partially evaluated: !receiver
TRUEFALSE
yes
Evaluation Count:879
no
Evaluation Count:0
0-879
775 -
776 -
777 -
778 -
779 QPostEvent pe_copy = pe; -
780 -
781 -
782 -
783 const_cast<QPostEvent &>(pe).event = 0; -
784 -
785 -
786 data->postEventList.addEvent(pe_copy); -
787 }
executed: }
Execution Count:879
879
788 continue;
executed: continue;
Execution Count:880
880
789 } -
790 }
executed: }
Execution Count:2768
2768
791 -
792 -
793 -
794 pe.event->posted = false; -
795 QScopedPointer<QEvent> e(pe.event); -
796 QObject * r = pe.receiver; -
797 -
798 --r->d_func()->postedEvents; -
799 qt_noop(); -
800 -
801 -
802 -
803 const_cast<QPostEvent &>(pe).event = 0; -
804 -
805 struct MutexUnlocker -
806 { -
807 QMutexLocker &m; -
808 MutexUnlocker(QMutexLocker &m) : m(m) { m.unlock(); }
executed: }
Execution Count:403671
403671
809 ~MutexUnlocker() { m.relock(); }
executed: }
Execution Count:403661
403661
810 }; -
811 MutexUnlocker unlocker(locker); -
812 -
813 -
814 QCoreApplication::sendEvent(r, e.data()); -
815 -
816 -
817 -
818 -
819 }
executed: }
Execution Count:403650
403650
820 -
821 cleanup.exceptionCaught = false; -
822}
executed: }
Execution Count:332658
332658
823void QCoreApplication::removePostedEvents(QObject *receiver, int eventType) -
824{ -
825 QThreadData *data = receiver ? receiver->d_func()->threadData : QThreadData::current();
evaluated: receiver
TRUEFALSE
yes
Evaluation Count:55058
yes
Evaluation Count:2
2-55058
826 QMutexLocker locker(&data->postEventList.mutex); -
827 -
828 -
829 -
830 -
831 -
832 if (receiver && !receiver->d_func()->postedEvents)
evaluated: receiver
TRUEFALSE
yes
Evaluation Count:55058
yes
Evaluation Count:2
evaluated: !receiver->d_func()->postedEvents
TRUEFALSE
yes
Evaluation Count:17401
yes
Evaluation Count:37657
2-55058
833 return;
executed: return;
Execution Count:17401
17401
834 -
835 -
836 -
837 QVarLengthArray<QEvent*> events; -
838 int n = data->postEventList.size(); -
839 int j = 0; -
840 -
841 for (int i = 0; i < n; ++i) {
evaluated: i < n
TRUEFALSE
yes
Evaluation Count:1350838
yes
Evaluation Count:37659
37659-1350838
842 const QPostEvent &pe = data->postEventList.at(i); -
843 -
844 if ((!receiver || pe.receiver == receiver)
evaluated: !receiver
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:1350826
evaluated: pe.receiver == receiver
TRUEFALSE
yes
Evaluation Count:58930
yes
Evaluation Count:1291896
12-1350826
845 && (pe.event && (eventType == 0 || pe.event->type() == eventType))) {
evaluated: pe.event
TRUEFALSE
yes
Evaluation Count:58828
yes
Evaluation Count:114
evaluated: eventType == 0
TRUEFALSE
yes
Evaluation Count:58559
yes
Evaluation Count:269
evaluated: pe.event->type() == eventType
TRUEFALSE
yes
Evaluation Count:155
yes
Evaluation Count:114
114-58828
846 --pe.receiver->d_func()->postedEvents; -
847 pe.event->posted = false; -
848 events.append(pe.event); -
849 const_cast<QPostEvent &>(pe).event = 0; -
850 } else if (!data->postEventList.recursion) {
executed: }
Execution Count:58714
evaluated: !data->postEventList.recursion
TRUEFALSE
yes
Evaluation Count:1291808
yes
Evaluation Count:316
316-1291808
851 if (i != j)
evaluated: i != j
TRUEFALSE
yes
Evaluation Count:728310
yes
Evaluation Count:563498
563498-728310
852 qSwap(data->postEventList[i], data->postEventList[j]);
executed: qSwap(data->postEventList[i], data->postEventList[j]);
Execution Count:728310
728310
853 ++j; -
854 }
executed: }
Execution Count:1291808
1291808
855 } -
856 -
857 -
858 -
859 -
860 -
861 -
862 -
863 if (!data->postEventList.recursion) {
evaluated: !data->postEventList.recursion
TRUEFALSE
yes
Evaluation Count:37474
yes
Evaluation Count:185
185-37474
864 -
865 data->postEventList.erase(data->postEventList.begin() + j, data->postEventList.end()); -
866 }
executed: }
Execution Count:37474
37474
867 -
868 locker.unlock(); -
869 for (int i = 0; i < events.count(); ++i) {
evaluated: i < events.count()
TRUEFALSE
yes
Evaluation Count:58714
yes
Evaluation Count:37659
37659-58714
870 delete events[i]; -
871 }
executed: }
Execution Count:58714
58714
872}
executed: }
Execution Count:37659
37659
873void QCoreApplicationPrivate::removePostedEvent(QEvent * event) -
874{ -
875 if (!event || !event->posted)
never evaluated: !event
never evaluated: !event->posted
0
876 return;
never executed: return;
0
877 -
878 QThreadData *data = QThreadData::current(); -
879 -
880 QMutexLocker locker(&data->postEventList.mutex); -
881 -
882 if (data->postEventList.size() == 0) {
never evaluated: data->postEventList.size() == 0
0
883 -
884 -
885 -
886 -
887 -
888 }
never executed: }
0
889 -
890 for (int i = 0; i < data->postEventList.size(); ++i) {
never evaluated: i < data->postEventList.size()
0
891 const QPostEvent & pe = data->postEventList.at(i); -
892 if (pe.event == event) {
never evaluated: pe.event == event
0
893 -
894 -
895 -
896 -
897 -
898 -
899 --pe.receiver->d_func()->postedEvents; -
900 pe.event->posted = false; -
901 delete pe.event; -
902 const_cast<QPostEvent &>(pe).event = 0; -
903 return;
never executed: return;
0
904 } -
905 }
never executed: }
0
906}
never executed: }
0
907 -
908 -
909 -
910 -
911bool QCoreApplication::event(QEvent *e) -
912{ -
913 if (e->type() == QEvent::Quit) {
evaluated: e->type() == QEvent::Quit
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:2296
13-2296
914 quit(); -
915 return true;
executed: return true;
Execution Count:13
13
916 } -
917 return QObject::event(e);
executed: return QObject::event(e);
Execution Count:2296
2296
918} -
919void QCoreApplicationPrivate::ref() -
920{ -
921 quitLockRef.ref(); -
922}
executed: }
Execution Count:6
6
923 -
924void QCoreApplicationPrivate::deref() -
925{ -
926 if (!quitLockRef.deref())
evaluated: !quitLockRef.deref()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5
1-5
927 maybeQuit();
executed: maybeQuit();
Execution Count:1
1
928}
executed: }
Execution Count:6
6
929 -
930void QCoreApplicationPrivate::maybeQuit() -
931{ -
932 if (quitLockRef.load() == 0 && in_exec && quitLockRefEnabled && shouldQuit())
partially evaluated: quitLockRef.load() == 0
TRUEFALSE
yes
Evaluation Count:1775
no
Evaluation Count:0
evaluated: in_exec
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:1756
partially evaluated: quitLockRefEnabled
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
evaluated: shouldQuit()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:2
0-1775
933 QCoreApplication::postEvent(QCoreApplication::instance(), new QEvent(QEvent::Quit));
executed: QCoreApplication::postEvent(QCoreApplication::instance(), new QEvent(QEvent::Quit));
Execution Count:17
17
934}
executed: }
Execution Count:1775
1775
935void QCoreApplication::quit() -
936{ -
937 exit(0);
executed: exit(0);
Execution Count:64
64
938} -
939bool QCoreApplication::installTranslator(QTranslator *translationFile) -
940{ -
941 if (!translationFile)
partially evaluated: !translationFile
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31
0-31
942 return false;
never executed: return false;
0
943 -
944 if (!QCoreApplicationPrivate::checkInstance("installTranslator"))
partially evaluated: !QCoreApplicationPrivate::checkInstance("installTranslator")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31
0-31
945 return false;
never executed: return false;
0
946 QCoreApplicationPrivate *d = self->d_func(); -
947 d->translators.prepend(translationFile); -
948 -
949 -
950 if (translationFile->isEmpty())
evaluated: translationFile->isEmpty()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:30
1-30
951 return false;
executed: return false;
Execution Count:1
1
952 -
953 -
954 QEvent ev(QEvent::LanguageChange); -
955 QCoreApplication::sendEvent(self, &ev); -
956 return true;
executed: return true;
Execution Count:30
30
957} -
958bool QCoreApplication::removeTranslator(QTranslator *translationFile) -
959{ -
960 if (!translationFile)
partially evaluated: !translationFile
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42
0-42
961 return false;
never executed: return false;
0
962 if (!QCoreApplicationPrivate::checkInstance("removeTranslator"))
partially evaluated: !QCoreApplicationPrivate::checkInstance("removeTranslator")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42
0-42
963 return false;
never executed: return false;
0
964 QCoreApplicationPrivate *d = self->d_func(); -
965 if (d->translators.removeAll(translationFile)) {
evaluated: d->translators.removeAll(translationFile)
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:11
11-31
966 if (!self->closingDown()) {
partially evaluated: !self->closingDown()
TRUEFALSE
yes
Evaluation Count:31
no
Evaluation Count:0
0-31
967 QEvent ev(QEvent::LanguageChange); -
968 QCoreApplication::sendEvent(self, &ev); -
969 }
executed: }
Execution Count:31
31
970 return true;
executed: return true;
Execution Count:31
31
971 } -
972 return false;
executed: return false;
Execution Count:11
11
973} -
974 -
975static void replacePercentN(QString *result, int n) -
976{ -
977 if (n >= 0) {
evaluated: n >= 0
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:315117
6-315117
978 int percentPos = 0; -
979 int len = 0; -
980 while ((percentPos = result->indexOf(QLatin1Char('%'), percentPos + len)) != -1) {
evaluated: (percentPos = result->indexOf(QLatin1Char('%'), percentPos + len)) != -1
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
6
981 len = 1; -
982 QString fmt; -
983 if (result->at(percentPos + len) == QLatin1Char('L')) {
partially evaluated: result->at(percentPos + len) == QLatin1Char('L')
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
984 ++len; -
985 fmt = QLatin1String("%L1"); -
986 } else {
never executed: }
0
987 fmt = QLatin1String("%1"); -
988 }
executed: }
Execution Count:6
6
989 if (result->at(percentPos + len) == QLatin1Char('n')) {
partially evaluated: result->at(percentPos + len) == QLatin1Char('n')
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
990 fmt = fmt.arg(n); -
991 ++len; -
992 result->replace(percentPos, len, fmt); -
993 len = fmt.length(); -
994 }
executed: }
Execution Count:6
6
995 }
executed: }
Execution Count:6
6
996 }
executed: }
Execution Count:6
6
997}
executed: }
Execution Count:315123
315123
998QString QCoreApplication::translate(const char *context, const char *sourceText, -
999 const char *disambiguation, int n) -
1000{ -
1001 QString result; -
1002 -
1003 if (!sourceText)
evaluated: !sourceText
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:315123
4-315123
1004 return result;
executed: return result;
Execution Count:4
4
1005 -
1006 if (self && !self->d_func()->translators.isEmpty()) {
evaluated: self
TRUEFALSE
yes
Evaluation Count:315111
yes
Evaluation Count:12
evaluated: !self->d_func()->translators.isEmpty()
TRUEFALSE
yes
Evaluation Count:183
yes
Evaluation Count:314928
12-315111
1007 QList<QTranslator*>::ConstIterator it; -
1008 QTranslator *translationFile; -
1009 for (it = self->d_func()->translators.constBegin(); it != self->d_func()->translators.constEnd(); ++it) {
evaluated: it != self->d_func()->translators.constEnd()
TRUEFALSE
yes
Evaluation Count:208
yes
Evaluation Count:46
46-208
1010 translationFile = *it; -
1011 result = translationFile->translate(context, sourceText, disambiguation, n); -
1012 if (!result.isNull())
evaluated: !result.isNull()
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:71
71-137
1013 break;
executed: break;
Execution Count:137
137
1014 }
executed: }
Execution Count:71
71
1015 }
executed: }
Execution Count:183
183
1016 -
1017 if (result.isNull())
evaluated: result.isNull()
TRUEFALSE
yes
Evaluation Count:314986
yes
Evaluation Count:137
137-314986
1018 result = QString::fromUtf8(sourceText);
executed: result = QString::fromUtf8(sourceText);
Execution Count:314986
314986
1019 -
1020 replacePercentN(&result, n); -
1021 return result;
executed: return result;
Execution Count:315123
315123
1022} -
1023 -
1024 -
1025 -
1026 -
1027 -
1028 -
1029 -
1030QString qtTrId(const char *id, int n) -
1031{ -
1032 return QCoreApplication::translate(0, id, 0, n);
never executed: return QCoreApplication::translate(0, id, 0, n);
0
1033} -
1034 -
1035bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator) -
1036{ -
1037 return QCoreApplication::self 34
1038 && QCoreApplication::self->d_func()->translators.contains(translator);
executed: return QCoreApplication::self && QCoreApplication::self->d_func()->translators.contains(translator);
Execution Count:34
34
1039} -
1040QString QCoreApplication::applicationDirPath() -
1041{ -
1042 if (!self) {
partially evaluated: !self
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:521
0-521
1043 QMessageLogger("kernel/qcoreapplication.cpp", 1775, __PRETTY_FUNCTION__).warning("QCoreApplication::applicationDirPath: Please instantiate the QApplication object first"); -
1044 return QString();
never executed: return QString();
0
1045 } -
1046 -
1047 QCoreApplicationPrivate *d = self->d_func(); -
1048 if (d->cachedApplicationDirPath.isNull())
evaluated: d->cachedApplicationDirPath.isNull()
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:461
60-461
1049 d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path();
executed: d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path();
Execution Count:60
60
1050 return d->cachedApplicationDirPath;
executed: return d->cachedApplicationDirPath;
Execution Count:521
521
1051} -
1052QString QCoreApplication::applicationFilePath() -
1053{ -
1054 if (!self) {
partially evaluated: !self
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:98
0-98
1055 QMessageLogger("kernel/qcoreapplication.cpp", 1803, __PRETTY_FUNCTION__).warning("QCoreApplication::applicationFilePath: Please instantiate the QApplication object first"); -
1056 return QString();
never executed: return QString();
0
1057 } -
1058 -
1059 QCoreApplicationPrivate *d = self->d_func(); -
1060 if (!d->cachedApplicationFilePath.isNull())
evaluated: !d->cachedApplicationFilePath.isNull()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:63
35-63
1061 return d->cachedApplicationFilePath;
executed: return d->cachedApplicationFilePath;
Execution Count:35
35
1062 QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid())); -
1063 if (pfi.exists() && pfi.isSymLink()) {
partially evaluated: pfi.exists()
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
partially evaluated: pfi.isSymLink()
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
1064 d->cachedApplicationFilePath = pfi.canonicalFilePath(); -
1065 return d->cachedApplicationFilePath;
executed: return d->cachedApplicationFilePath;
Execution Count:63
63
1066 } -
1067 -
1068 -
1069 QString argv0 = QFile::decodeName(arguments().at(0).toLocal8Bit()); -
1070 QString absPath; -
1071 -
1072 if (!argv0.isEmpty() && argv0.at(0) == QLatin1Char('/')) {
never evaluated: !argv0.isEmpty()
never evaluated: argv0.at(0) == QLatin1Char('/')
0
1073 -
1074 -
1075 -
1076 -
1077 absPath = argv0; -
1078 } else if (argv0.contains(QLatin1Char('/'))) {
never executed: }
never evaluated: argv0.contains(QLatin1Char('/'))
0
1079 -
1080 -
1081 -
1082 -
1083 absPath = QDir::current().absoluteFilePath(argv0); -
1084 } else {
never executed: }
0
1085 -
1086 -
1087 -
1088 -
1089 absPath = QStandardPaths::findExecutable(argv0); -
1090 }
never executed: }
0
1091 -
1092 absPath = QDir::cleanPath(absPath); -
1093 -
1094 QFileInfo fi(absPath); -
1095 d->cachedApplicationFilePath = fi.exists() ? fi.canonicalFilePath() : QString();
never evaluated: fi.exists()
0
1096 return d->cachedApplicationFilePath;
never executed: return d->cachedApplicationFilePath;
0
1097 -
1098} -
1099 -
1100 -
1101 -
1102 -
1103 -
1104 -
1105qint64 QCoreApplication::applicationPid() -
1106{ -
1107 -
1108 -
1109 -
1110 -
1111 -
1112 return getpid();
executed: return getpid();
Execution Count:1485
1485
1113 -
1114} -
1115QStringList QCoreApplication::arguments() -
1116{ -
1117 QStringList list; -
1118 -
1119 if (!self) {
partially evaluated: !self
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1120 QMessageLogger("kernel/qcoreapplication.cpp", 1945, __PRETTY_FUNCTION__).warning("QCoreApplication::arguments: Please instantiate the QApplication object first"); -
1121 return list;
never executed: return list;
0
1122 } -
1123 const int ac = self->d_func()->argc; -
1124 char ** const av = self->d_func()->argv; -
1125 list.reserve(ac); -
1126 for (int a = 0; a < ac; ++a) {
evaluated: a < ac
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:4
4-6
1127 list << QString::fromLocal8Bit(av[a]); -
1128 }
executed: }
Execution Count:6
6
1129 -
1130 -
1131 return list;
executed: return list;
Execution Count:4
4
1132} -
1133void QCoreApplication::setOrganizationName(const QString &orgName) -
1134{ -
1135 coreappdata()->orgName = orgName; -
1136}
executed: }
Execution Count:5
5
1137 -
1138QString QCoreApplication::organizationName() -
1139{ -
1140 -
1141 -
1142 -
1143 return coreappdata()->orgName;
executed: return coreappdata()->orgName;
Execution Count:22
22
1144} -
1145void QCoreApplication::setOrganizationDomain(const QString &orgDomain) -
1146{ -
1147 coreappdata()->orgDomain = orgDomain; -
1148}
never executed: }
0
1149 -
1150QString QCoreApplication::organizationDomain() -
1151{ -
1152 return coreappdata()->orgDomain;
executed: return coreappdata()->orgDomain;
Execution Count:5
5
1153} -
1154void QCoreApplication::setApplicationName(const QString &application) -
1155{ -
1156 coreappdata()->application = application; -
1157}
executed: }
Execution Count:17
17
1158 -
1159QString QCoreApplication::applicationName() -
1160{ -
1161 -
1162 -
1163 -
1164 QString appname = coreappdata() ? coreappdata()->application : QString();
partially evaluated: coreappdata()
TRUEFALSE
yes
Evaluation Count:7547
no
Evaluation Count:0
0-7547
1165 if (appname.isEmpty() && QCoreApplication::self)
evaluated: appname.isEmpty()
TRUEFALSE
yes
Evaluation Count:5436
yes
Evaluation Count:2111
partially evaluated: QCoreApplication::self
TRUEFALSE
yes
Evaluation Count:5436
no
Evaluation Count:0
0-5436
1166 appname = QCoreApplication::self->d_func()->appName();
executed: appname = QCoreApplication::self->d_func()->appName();
Execution Count:5436
5436
1167 return appname;
executed: return appname;
Execution Count:7547
7547
1168} -
1169 -
1170 -
1171__attribute__((visibility("default"))) QString qt_applicationName_noFallback() -
1172{ -
1173 return coreappdata()->application;
executed: return coreappdata()->application;
Execution Count:2
2
1174} -
1175void QCoreApplication::setApplicationVersion(const QString &version) -
1176{ -
1177 coreappdata()->applicationVersion = version; -
1178}
executed: }
Execution Count:2
2
1179 -
1180QString QCoreApplication::applicationVersion() -
1181{ -
1182 -
1183 -
1184 -
1185 return coreappdata()->applicationVersion;
executed: return coreappdata()->applicationVersion;
Execution Count:4
4
1186} -
1187 -
1188 -
1189 -
1190static QMutex *libraryPathMutex() { static QGlobalStatic<QMutex > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QMutex *x = new QMutex (QMutex::Recursive); if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QMutex > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:171
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:148
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:23
no
Evaluation Count:0
0-171
1191QStringList QCoreApplication::libraryPaths() -
1192{ -
1193 QMutexLocker locker(libraryPathMutex()); -
1194 if (!coreappdata()->app_libpaths) {
evaluated: !coreappdata()->app_libpaths
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:131
30-131
1195 QStringList *app_libpaths = coreappdata()->app_libpaths = new QStringList; -
1196 QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath); -
1197 if (QFile::exists(installPathPlugins)) {
partially evaluated: QFile::exists(installPathPlugins)
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
0-30
1198 -
1199 installPathPlugins = QDir(installPathPlugins).canonicalPath(); -
1200 if (!app_libpaths->contains(installPathPlugins))
partially evaluated: !app_libpaths->contains(installPathPlugins)
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
0-30
1201 app_libpaths->append(installPathPlugins);
executed: app_libpaths->append(installPathPlugins);
Execution Count:30
30
1202 }
executed: }
Execution Count:30
30
1203 -
1204 -
1205 -
1206 if (self) self->d_func()->appendApplicationPathToLibraryPaths();
executed: self->d_func()->appendApplicationPathToLibraryPaths();
Execution Count:29
evaluated: self
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:1
1-29
1207 -
1208 const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH"); -
1209 if (!libPathEnv.isEmpty()) {
evaluated: !libPathEnv.isEmpty()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:27
3-27
1210 -
1211 -
1212 -
1213 QLatin1Char pathSep(':'); -
1214 -
1215 QStringList paths = QFile::decodeName(libPathEnv).split(pathSep, QString::SkipEmptyParts); -
1216 for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
evaluated: it != paths.constEnd()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:3
3-5
1217 QString canonicalPath = QDir(*it).canonicalPath(); -
1218 if (!canonicalPath.isEmpty()
evaluated: !canonicalPath.isEmpty()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:2
2-3
1219 && !app_libpaths->contains(canonicalPath)) {
evaluated: !app_libpaths->contains(canonicalPath)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
1220 app_libpaths->append(canonicalPath); -
1221 }
executed: }
Execution Count:2
2
1222 }
executed: }
Execution Count:5
5
1223 }
executed: }
Execution Count:3
3
1224 }
executed: }
Execution Count:30
30
1225 return *(coreappdata()->app_libpaths);
executed: return *(coreappdata()->app_libpaths);
Execution Count:161
161
1226} -
1227void QCoreApplication::setLibraryPaths(const QStringList &paths) -
1228{ -
1229 QMutexLocker locker(libraryPathMutex()); -
1230 if (!coreappdata()->app_libpaths)
evaluated: !coreappdata()->app_libpaths
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
1231 coreappdata()->app_libpaths = new QStringList;
executed: coreappdata()->app_libpaths = new QStringList;
Execution Count:2
2
1232 *(coreappdata()->app_libpaths) = paths; -
1233 locker.unlock(); -
1234 QFactoryLoader::refreshAll(); -
1235}
executed: }
Execution Count:3
3
1236void QCoreApplication::addLibraryPath(const QString &path) -
1237{ -
1238 if (path.isEmpty())
partially evaluated: path.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1239 return;
never executed: return;
0
1240 -
1241 QMutexLocker locker(libraryPathMutex()); -
1242 -
1243 -
1244 libraryPaths(); -
1245 -
1246 QString canonicalPath = QDir(path).canonicalPath(); -
1247 if (!canonicalPath.isEmpty()
partially evaluated: !canonicalPath.isEmpty()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1248 && !coreappdata()->app_libpaths->contains(canonicalPath)) {
evaluated: !coreappdata()->app_libpaths->contains(canonicalPath)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:4
3-4
1249 coreappdata()->app_libpaths->prepend(canonicalPath); -
1250 locker.unlock(); -
1251 QFactoryLoader::refreshAll(); -
1252 }
executed: }
Execution Count:3
3
1253}
executed: }
Execution Count:7
7
1254 -
1255 -
1256 -
1257 -
1258 -
1259 -
1260 -
1261void QCoreApplication::removeLibraryPath(const QString &path) -
1262{ -
1263 if (path.isEmpty())
never evaluated: path.isEmpty()
0
1264 return;
never executed: return;
0
1265 -
1266 QMutexLocker locker(libraryPathMutex()); -
1267 -
1268 -
1269 libraryPaths(); -
1270 -
1271 QString canonicalPath = QDir(path).canonicalPath(); -
1272 coreappdata()->app_libpaths->removeAll(canonicalPath); -
1273 QFactoryLoader::refreshAll(); -
1274}
never executed: }
0
1275void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filterObj) -
1276{ -
1277 QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread); -
1278 if (!filterObj || !eventDispatcher)
partially evaluated: !filterObj
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !eventDispatcher
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1279 return;
never executed: return;
0
1280 eventDispatcher->installNativeEventFilter(filterObj); -
1281}
executed: }
Execution Count:1
1
1282void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filterObject) -
1283{ -
1284 QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(); -
1285 if (!filterObject || !eventDispatcher)
never evaluated: !filterObject
never evaluated: !eventDispatcher
0
1286 return;
never executed: return;
0
1287 eventDispatcher->removeNativeEventFilter(filterObject); -
1288}
never executed: }
0
1289bool QCoreApplication::hasPendingEvents() -
1290{ -
1291 QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(); -
1292 if (eventDispatcher)
never evaluated: eventDispatcher
0
1293 return eventDispatcher->hasPendingEvents();
never executed: return eventDispatcher->hasPendingEvents();
0
1294 return false;
never executed: return false;
0
1295} -
1296 -
1297 -
1298 -
1299 -
1300 -
1301QAbstractEventDispatcher *QCoreApplication::eventDispatcher() -
1302{ -
1303 if (QCoreApplicationPrivate::theMainThread)
partially evaluated: QCoreApplicationPrivate::theMainThread
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1304 return QCoreApplicationPrivate::theMainThread->eventDispatcher();
executed: return QCoreApplicationPrivate::theMainThread->eventDispatcher();
Execution Count:3
3
1305 return 0;
never executed: return 0;
0
1306} -
1307 -
1308 -
1309 -
1310 -
1311 -
1312 -
1313 -
1314void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher) -
1315{ -
1316 QThread *mainThread = QCoreApplicationPrivate::theMainThread; -
1317 if (!mainThread)
partially evaluated: !mainThread
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1318 mainThread = QThread::currentThread();
never executed: mainThread = QThread::currentThread();
0
1319 mainThread->setEventDispatcher(eventDispatcher); -
1320}
executed: }
Execution Count:1
1
1321 -
1322 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial