global/qlibraryinfo.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10extern void qDumpCPUFeatures(); -
11 -
12 -
13 -
14struct QLibrarySettings -
15{ -
16 QLibrarySettings(); -
17 QScopedPointer<QSettings> settings; -
18 -
19 -
20 -
21 -
22}; -
23static QLibrarySettings *qt_library_settings() { static QGlobalStatic<QLibrarySettings > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QLibrarySettings *x = new QLibrarySettings; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QLibrarySettings > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:371
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:345
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:26
no
Evaluation Count:0
0-371
24 -
25class QLibraryInfoPrivate -
26{ -
27public: -
28 static QSettings *findConfiguration(); -
29 -
30 static void cleanup() -
31 { -
32 QLibrarySettings *ls = qt_library_settings(); -
33 if (ls)
partially evaluated: ls
TRUEFALSE
yes
Evaluation Count:210
no
Evaluation Count:0
0-210
34 ls->settings.reset(0);
executed: ls->settings.reset(0);
Execution Count:210
210
35 }
executed: }
Execution Count:210
210
36 static QSettings *configuration() -
37 { -
38 QLibrarySettings *ls = qt_library_settings(); -
39 return ls ? ls->settings.data() : 0;
executed: return ls ? ls->settings.data() : 0;
Execution Count:161
161
40 } -
41}; -
42 -
43QLibrarySettings::QLibrarySettings() -
44 : settings(QLibraryInfoPrivate::findConfiguration()) -
45{ -
46 -
47 qAddPostRoutine(QLibraryInfoPrivate::cleanup); -
48 bool haveEffectivePaths; -
49 bool havePaths; -
50 -
51 if (settings) {
partially evaluated: settings
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
52 -
53 -
54 QStringList children = settings->childGroups(); -
55 haveEffectivePaths = children.contains(QLatin1String("EffectivePaths")); -
56 -
57 havePaths = !haveEffectivePaths || children.contains(QLatin1String("Paths"));
never evaluated: !haveEffectivePaths
never evaluated: children.contains(QLatin1String("Paths"))
0
58 -
59 if (!havePaths)
never evaluated: !havePaths
0
60 settings.reset(0);
never executed: settings.reset(0);
0
61 -
62 -
63 -
64 -
65 -
66 }
never executed: }
0
67}
executed: }
Execution Count:26
26
68 -
69QSettings *QLibraryInfoPrivate::findConfiguration() -
70{ -
71 QString qtconfig = QString::fromUtf8("" ":/qt/etc/qt.conf" "", sizeof(":/qt/etc/qt.conf") - 1); -
72 -
73 -
74 -
75 -
76 if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
partially evaluated: !QFile::exists(qtconfig)
TRUEFALSE
yes
Evaluation Count:26
no
Evaluation Count:0
evaluated: QCoreApplication::instance()
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:3
0-26
77 { -
78 QDir pwd(QCoreApplication::applicationDirPath()); -
79 qtconfig = pwd.filePath(QLatin1String("qt.conf")); -
80 } -
81 }
executed: }
Execution Count:23
23
82 -
83 if (QFile::exists(qtconfig))
partially evaluated: QFile::exists(qtconfig)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
84 return new QSettings(qtconfig, QSettings::IniFormat);
never executed: return new QSettings(qtconfig, QSettings::IniFormat);
0
85 return 0;
executed: return 0;
Execution Count:26
26
86} -
87QLibraryInfo::QLibraryInfo() -
88{ } -
89 -
90 -
91 -
92 -
93 -
94 -
95 -
96QString -
97QLibraryInfo::licensee() -
98{ -
99 const char *str = qt_configure_licensee_str + 12;; -
100 return QString::fromLocal8Bit(str);
never executed: return QString::fromLocal8Bit(str);
0
101} -
102 -
103 -
104 -
105 -
106 -
107 -
108 -
109QString -
110QLibraryInfo::licensedProducts() -
111{ -
112 const char *str = qt_configure_licensed_products_str + 12;; -
113 return QString::fromLatin1(str);
never executed: return QString::fromLatin1(str);
0
114} -
115 -
116 -
117 -
118 -
119 -
120 -
121 -
122QDate -
123QLibraryInfo::buildDate() -
124{ -
125 return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
never executed: return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
0
126} -
127 -
128 -
129 -
130 -
131 -
132 -
133 -
134bool -
135QLibraryInfo::isDebugBuild() -
136{ -
137 -
138 -
139 -
140 return false;
executed: return false;
Execution Count:1
1
141 -
142} -
143static const struct { -
144 char key[19], value[13]; -
145} qtConfEntries[] = { -
146 { "Prefix", "." }, -
147 { "Documentation", "doc" }, -
148 { "Headers", "include" }, -
149 { "Libraries", "lib" }, -
150 -
151 -
152 -
153 { "LibraryExecutables", "libexec" }, -
154 -
155 { "Binaries", "bin" }, -
156 { "Plugins", "plugins" }, -
157 { "Imports", "imports" }, -
158 { "Qml2Imports", "qml" }, -
159 { "ArchData", "." }, -
160 { "Data", "." }, -
161 { "Translations", "translations" }, -
162 { "Examples", "examples" }, -
163 { "Tests", "tests" }, -
164}; -
165 -
166 -
167 -
168 -
169 -
170QString -
171QLibraryInfo::location(LibraryLocation loc) -
172{ -
173 QString ret; -
174 if (!QLibraryInfoPrivate::configuration())
partially evaluated: !QLibraryInfoPrivate::configuration()
TRUEFALSE
yes
Evaluation Count:161
no
Evaluation Count:0
0-161
175 -
176 { -
177 const char *path = 0; -
178 if (unsigned(loc) < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0]))
evaluated: unsigned(loc) < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0])
TRUEFALSE
yes
Evaluation Count:156
yes
Evaluation Count:5
5-156
179 path = qt_configure_prefix_path_strs[loc] + 12;
executed: path = qt_configure_prefix_path_strs[loc] + 12;
Execution Count:156
156
180 -
181 else if (loc == SettingsPath)
partially evaluated: loc == SettingsPath
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
182 path = qt_configure_settings_path_str + 12;;
executed: path = qt_configure_settings_path_str + 12;
Execution Count:5
5
183 -
184 -
185 if (path)
partially evaluated: path
TRUEFALSE
yes
Evaluation Count:161
no
Evaluation Count:0
0-161
186 ret = QString::fromLocal8Bit(path);
executed: ret = QString::fromLocal8Bit(path);
Execution Count:161
161
187 -
188 } else {
executed: }
Execution Count:161
161
189 QString key; -
190 QString defaultValue; -
191 if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) {
never evaluated: unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])
0
192 key = QLatin1String(qtConfEntries[loc].key); -
193 defaultValue = QLatin1String(qtConfEntries[loc].value); -
194 }
never executed: }
0
195 -
196 else if (loc == SettingsPath)
never evaluated: loc == SettingsPath
0
197 key = QLatin1String("Settings");
never executed: key = QLatin1String("Settings");
0
198 -
199 -
200 if(!key.isNull()) {
never evaluated: !key.isNull()
0
201 QSettings *config = QLibraryInfoPrivate::configuration(); -
202 config->beginGroup(QLatin1String( -
203 -
204 -
205 -
206 "Paths")); -
207 -
208 ret = config->value(key, defaultValue).toString(); -
209 int rep; -
210 QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); -
211 reg_var.setMinimal(true); -
212 while((rep = reg_var.indexIn(ret)) != -1) {
never evaluated: (rep = reg_var.indexIn(ret)) != -1
0
213 ret.replace(rep, reg_var.matchedLength(), -
214 QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, -
215 reg_var.matchedLength() - 3).toLatin1().constData()).constData())); -
216 }
never executed: }
0
217 -
218 config->endGroup(); -
219 -
220 ret = QDir::fromNativeSeparators(ret); -
221 }
never executed: }
0
222 -
223 }
never executed: }
0
224 -
225 -
226 -
227 -
228 -
229 -
230 -
231 if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
partially evaluated: !ret.isEmpty()
TRUEFALSE
yes
Evaluation Count:161
no
Evaluation Count:0
partially evaluated: QDir::isRelativePath(ret)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:161
0-161
232 QString baseDir; -
233 if (loc == PrefixPath) {
never evaluated: loc == PrefixPath
0
234 if (QCoreApplication::instance()) {
never evaluated: QCoreApplication::instance()
0
235 baseDir = QCoreApplication::applicationDirPath(); -
236 } else {
never executed: }
0
237 baseDir = QDir::currentPath(); -
238 }
never executed: }
0
239 -
240 } else { -
241 -
242 baseDir = location(PrefixPath); -
243 }
never executed: }
0
244 ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); -
245 }
never executed: }
0
246 return ret;
executed: return ret;
Execution Count:161
161
247} -
248 -
249 -
250 -
251 -
252 -
253 -
254extern const char qt_core_interpreter[] __attribute__((section(".interp"))) -
255 = "/lib64/ld-linux-x86-64.so.2"; -
256 -
257extern "C" void qt_core_boilerplate(); -
258void qt_core_boilerplate() -
259{ -
260 printf("This is the QtCore library version " "5.0.2" "\n" -
261 "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n" -
262 "Contact: http://www.qt-project.org/legal\n" -
263 "\n" -
264 "Build date: %s\n" -
265 "Installation prefix: %s\n" -
266 "Library path: %s\n" -
267 "Include path: %s\n", -
268 qt_configure_installation + 12, -
269 qt_configure_prefix_path_strs[::QLibraryInfo::PrefixPath] + 12, -
270 qt_configure_prefix_path_strs[::QLibraryInfo::LibrariesPath] + 12, -
271 qt_configure_prefix_path_strs[::QLibraryInfo::HeadersPath] + 12); -
272 -
273 ::qDumpCPUFeatures(); -
274 -
275 -
276 -
277 -
278 -
279 -
280 exit(0);
never executed: exit(0);
0
281} -
282 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial