qdbus_symbols.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6extern "C" void dbus_shutdown(); -
7 -
8 -
9 -
10void (*qdbus_resolve_me(const char *name))(); -
11 -
12 -
13 -
14 -
15static QLibrary *qdbus_libdbus = 0; -
16 -
17void qdbus_unloadLibDBus() -
18{ -
19 if (qdbus_libdbus) {
never evaluated: qdbus_libdbus
0
20 if (qEnvironmentVariableIsSet("QDBUS_FORCE_SHUTDOWN"))
never evaluated: qEnvironmentVariableIsSet("QDBUS_FORCE_SHUTDOWN")
0
21 qdbus_libdbus->resolve("dbus_shutdown")();
never executed: qdbus_libdbus->resolve("dbus_shutdown")();
0
22 qdbus_libdbus->unload(); -
23 }
never executed: }
0
24 delete qdbus_libdbus; -
25 qdbus_libdbus = 0; -
26}
never executed: }
0
27 -
28 -
29bool qdbus_loadLibDBus() -
30{ -
31 -
32 -
33 -
34 -
35 -
36 -
37 -
38 static bool triedToLoadLibrary = false; -
39 -
40 QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&qdbus_resolve_me)); -
41 -
42 QLibrary *&lib = qdbus_libdbus; -
43 if (triedToLoadLibrary)
evaluated: triedToLoadLibrary
TRUEFALSE
yes
Evaluation Count:2574
yes
Evaluation Count:15
15-2574
44 return lib && lib->isLoaded();
executed: return lib && lib->isLoaded();
Execution Count:2574
2574
45 -
46 lib = new QLibrary; -
47 triedToLoadLibrary = true; -
48 -
49 static int majorversions[] = { 3, 2, -1 }; -
50 lib->unload(); -
51 lib->setFileName(QLatin1String("dbus-1")); -
52 for (uint i = 0; i < sizeof(majorversions) / sizeof(majorversions[0]); ++i) {
partially evaluated: i < sizeof(majorversions) / sizeof(majorversions[0])
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
53 lib->setFileNameAndVersion(lib->fileName(), majorversions[i]); -
54 if (lib->load() && lib->resolve("dbus_connection_open_private"))
partially evaluated: lib->load()
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: lib->resolve("dbus_connection_open_private")
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
55 return true;
executed: return true;
Execution Count:15
15
56 -
57 lib->unload(); -
58 }
never executed: }
0
59 -
60 delete lib; -
61 lib = 0; -
62 return false;
never executed: return false;
0
63 -
64 -
65 -
66} -
67 -
68 -
69void (*qdbus_resolve_conditionally(const char *name))() -
70{ -
71 if (qdbus_loadLibDBus())
partially evaluated: qdbus_loadLibDBus()
TRUEFALSE
yes
Evaluation Count:23
no
Evaluation Count:0
0-23
72 return qdbus_libdbus->resolve(name);
executed: return qdbus_libdbus->resolve(name);
Execution Count:23
23
73 return 0;
never executed: return 0;
0
74} -
75 -
76 -
77void (*qdbus_resolve_me(const char *name))() -
78{ -
79 -
80 if (!qdbus_loadLibDBus())
partially evaluated: !qdbus_loadLibDBus()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:621
0-621
81 QMessageLogger("qdbus_symbols.cpp", 126, __PRETTY_FUNCTION__).fatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
never executed: QMessageLogger("qdbus_symbols.cpp", 126, __PRETTY_FUNCTION__).fatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
0
82 -
83 QFunctionPointer ptr = qdbus_libdbus->resolve(name); -
84 if (!ptr)
partially evaluated: !ptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:621
0-621
85 QMessageLogger("qdbus_symbols.cpp", 130, __PRETTY_FUNCTION__).fatal("Cannot resolve '%s' in your libdbus-1.", name);
never executed: QMessageLogger("qdbus_symbols.cpp", 130, __PRETTY_FUNCTION__).fatal("Cannot resolve '%s' in your libdbus-1.", name);
0
86 -
87 return ptr;
executed: return ptr;
Execution Count:621
621
88 -
89 -
90 -
91 -
92} -
93namespace { static const struct qdbus_unloadLibDBus_dtor_class_ { inline qdbus_unloadLibDBus_dtor_class_() { } inline ~ qdbus_unloadLibDBus_dtor_class_() { qdbus_unloadLibDBus(); } } qdbus_unloadLibDBus_dtor_instance_; }
never executed: }
0
94 -
95 -
96 -
97 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial