kernel/qobjectcleanuphandler.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3QObjectCleanupHandler::QObjectCleanupHandler() -
4{ -
5} -
6 -
7 -
8 -
9 -
10 -
11 -
12 -
13QObjectCleanupHandler::~QObjectCleanupHandler() -
14{ -
15 clear(); -
16}
never executed: }
0
17 -
18 -
19 -
20 -
21 -
22 -
23 -
24QObject *QObjectCleanupHandler::add(QObject* object) -
25{ -
26 if (!object)
never evaluated: !object
0
27 return 0;
never executed: return 0;
0
28 -
29 connect(object, "2""destroyed(QObject*)", this, "1""objectDestroyed(QObject*)"); -
30 cleanupObjects.insert(0, object); -
31 return object;
never executed: return object;
0
32} -
33 -
34 -
35 -
36 -
37 -
38 -
39 -
40void QObjectCleanupHandler::remove(QObject *object) -
41{ -
42 int index; -
43 if ((index = cleanupObjects.indexOf(object)) != -1) {
never evaluated: (index = cleanupObjects.indexOf(object)) != -1
0
44 cleanupObjects.removeAt(index); -
45 disconnect(object, "2""destroyed(QObject*)", this, "1""objectDestroyed(QObject*)"); -
46 }
never executed: }
0
47}
never executed: }
0
48 -
49 -
50 -
51 -
52 -
53 -
54 -
55bool QObjectCleanupHandler::isEmpty() const -
56{ -
57 return cleanupObjects.isEmpty();
never executed: return cleanupObjects.isEmpty();
0
58} -
59 -
60 -
61 -
62 -
63 -
64 -
65 -
66void QObjectCleanupHandler::clear() -
67{ -
68 while (!cleanupObjects.isEmpty())
never evaluated: !cleanupObjects.isEmpty()
0
69 delete cleanupObjects.takeFirst();
never executed: delete cleanupObjects.takeFirst();
0
70}
never executed: }
0
71 -
72void QObjectCleanupHandler::objectDestroyed(QObject *object) -
73{ -
74 remove(object); -
75}
never executed: }
0
76 -
77 -
78 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial