Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | #include "qdir.h" | - |
42 | #include "qstringlist.h" | - |
43 | #include "qfile.h" | - |
44 | #include "qsettings.h" | - |
45 | #include "qlibraryinfo.h" | - |
46 | #include "qscopedpointer.h" | - |
47 | | - |
48 | #ifdef QT_BUILD_QMAKE | - |
49 | QT_BEGIN_NAMESPACE | - |
50 | extern QString qmake_libraryInfoFile(); | - |
51 | QT_END_NAMESPACE | - |
52 | #else | - |
53 | # include "qcoreapplication.h" | - |
54 | #endif | - |
55 | | - |
56 | #ifdef Q_OS_DARWIN | - |
57 | # include "private/qcore_mac_p.h" | - |
58 | #endif | - |
59 | | - |
60 | #include "qconfig.cpp" | - |
61 | #include "archdetect.cpp" | - |
62 | | - |
63 | QT_BEGIN_NAMESPACE | - |
64 | | - |
65 | extern void qDumpCPUFeatures(); | - |
66 | | - |
67 | #ifndef QT_NO_SETTINGS | - |
68 | | - |
69 | struct QLibrarySettings | - |
70 | { | - |
71 | QLibrarySettings(); | - |
72 | void load(); | - |
73 | | - |
74 | QScopedPointer<QSettings> settings; | - |
75 | #ifdef QT_BUILD_QMAKE | - |
76 | bool haveDevicePaths; | - |
77 | bool haveEffectiveSourcePaths; | - |
78 | bool haveEffectivePaths; | - |
79 | bool havePaths; | - |
80 | #else | - |
81 | bool reloadOnQAppAvailable; | - |
82 | #endif | - |
83 | }; | - |
84 | Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) | - |
85 | | - |
86 | class QLibraryInfoPrivate | - |
87 | { | - |
88 | public: | - |
89 | static QSettings *findConfiguration(); | - |
90 | #ifdef QT_BUILD_QMAKE | - |
91 | static bool haveGroup(QLibraryInfo::PathGroup group) | - |
92 | { | - |
93 | QLibrarySettings *ls = qt_library_settings(); | - |
94 | return ls ? (group == QLibraryInfo::EffectiveSourcePaths | - |
95 | ? ls->haveEffectiveSourcePaths | - |
96 | : group == QLibraryInfo::EffectivePaths | - |
97 | ? ls->haveEffectivePaths | - |
98 | : group == QLibraryInfo::DevicePaths | - |
99 | ? ls->haveDevicePaths | - |
100 | : ls->havePaths) : false; | - |
101 | } | - |
102 | #endif | - |
103 | static QSettings *configuration() | - |
104 | { | - |
105 | QLibrarySettings *ls = qt_library_settings(); | - |
106 | if (ls) { | - |
107 | #ifndef QT_BUILD_QMAKE | - |
108 | if (ls->reloadOnQAppAvailable && QCoreApplication::instance() != 0) | - |
109 | ls->load(); | - |
110 | #endif | - |
111 | return ls->settings.data(); | - |
112 | } else { | - |
113 | return 0; | - |
114 | } | - |
115 | } | - |
116 | }; | - |
117 | | - |
118 | static const char platformsSection[] = "Platforms"; | - |
119 | | - |
120 | QLibrarySettings::QLibrarySettings() | - |
121 | { | - |
122 | load(); | - |
123 | } | - |
124 | | - |
125 | void QLibrarySettings::load() | - |
126 | { | - |
127 | | - |
128 | settings.reset(QLibraryInfoPrivate::findConfiguration()); | - |
129 | #ifndef QT_BUILD_QMAKE | - |
130 | reloadOnQAppAvailable = (settings.data() == 0 && QCoreApplication::instance() == 0); | - |
131 | bool haveDevicePaths; | - |
132 | bool haveEffectivePaths; | - |
133 | bool havePaths; | - |
134 | #endif | - |
135 | if (settings) { | - |
136 | | - |
137 | | - |
138 | QStringList children = settings->childGroups(); | - |
139 | haveDevicePaths = children.contains(QLatin1String("DevicePaths")); | - |
140 | #ifdef QT_BUILD_QMAKE | - |
141 | haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths")); | - |
142 | #else | - |
143 | | - |
144 | bool haveEffectiveSourcePaths = false; | - |
145 | #endif | - |
146 | haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths")); | - |
147 | | - |
148 | havePaths = (!haveDevicePaths && !haveEffectivePaths | - |
149 | && !children.contains(QLatin1String(platformsSection))) | - |
150 | || children.contains(QLatin1String("Paths")); | - |
151 | #ifndef QT_BUILD_QMAKE | - |
152 | if (!havePaths) | - |
153 | settings.reset(0); | - |
154 | #else | - |
155 | } else { | - |
156 | haveDevicePaths = false; | - |
157 | haveEffectiveSourcePaths = false; | - |
158 | haveEffectivePaths = false; | - |
159 | havePaths = false; | - |
160 | #endif | - |
161 | } | - |
162 | } | - |
163 | | - |
164 | QSettings *QLibraryInfoPrivate::findConfiguration() | - |
165 | { | - |
166 | QString qtconfig = QStringLiteral(":/qt/etc/qt.conf"); | - |
167 | if (QFile::exists(qtconfig)) | - |
168 | return new QSettings(qtconfig, QSettings::IniFormat); | - |
169 | #ifdef QT_BUILD_QMAKE | - |
170 | qtconfig = qmake_libraryInfoFile(); | - |
171 | if (QFile::exists(qtconfig)) | - |
172 | return new QSettings(qtconfig, QSettings::IniFormat); | - |
173 | #else | - |
174 | #ifdef Q_OS_DARWIN | - |
175 | CFBundleRef bundleRef = CFBundleGetMainBundle(); | - |
176 | if (bundleRef) { | - |
177 | QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef, | - |
178 | QCFString(QLatin1String("qt.conf")), | - |
179 | 0, | - |
180 | 0); | - |
181 | if (urlRef) { | - |
182 | QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); | - |
183 | qtconfig = QDir::cleanPath(path); | - |
184 | if (QFile::exists(qtconfig)) | - |
185 | return new QSettings(qtconfig, QSettings::IniFormat); | - |
186 | } | - |
187 | } | - |
188 | #endif | - |
189 | if (QCoreApplication::instance()) { | - |
190 | QDir pwd(QCoreApplication::applicationDirPath()); | - |
191 | qtconfig = pwd.filePath(QLatin1String("qt.conf")); | - |
192 | if (QFile::exists(qtconfig)) | - |
193 | return new QSettings(qtconfig, QSettings::IniFormat); | - |
194 | } | - |
195 | #endif | - |
196 | return 0; | - |
197 | } | - |
198 | | - |
199 | #endif // QT_NO_SETTINGS | - |
200 | | - |
201 | | - |
202 | | - |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | | - |
208 | | - |
209 | | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | | - |
215 | | - |
216 | | - |
217 | | - |
218 | | - |
219 | #ifndef QT_BUILD_QMAKE | - |
220 | | - |
221 | | - |
222 | | - |
223 | | - |
224 | | - |
225 | | - |
226 | | - |
227 | | - |
228 | QLibraryInfo::QLibraryInfo() | - |
229 | { } | - |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | QString | - |
238 | QLibraryInfo::licensee() | - |
239 | { | - |
240 | const char * volatile str = QT_CONFIGURE_LICENSEE; | - |
241 | return QString::fromLocal8Bit(str); | - |
242 | } | - |
243 | | - |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
248 | | - |
249 | | - |
250 | QString | - |
251 | QLibraryInfo::licensedProducts() | - |
252 | { | - |
253 | const char * volatile str = QT_CONFIGURE_LICENSED_PRODUCTS; | - |
254 | return QString::fromLatin1(str); | - |
255 | } | - |
256 | | - |
257 | | - |
258 | | - |
259 | | - |
260 | | - |
261 | | - |
262 | #ifndef QT_NO_DATESTRING | - |
263 | #if QT_DEPRECATED_SINCE(5, 5) | - |
264 | QDate | - |
265 | QLibraryInfo::buildDate() | - |
266 | { | - |
267 | return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); | - |
268 | } | - |
269 | #endif | - |
270 | #endif //QT_NO_DATESTRING | - |
271 | | - |
272 | #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them | - |
273 | # ifdef __INTEL_CLANG_COMPILER | - |
274 | # define ICC_COMPAT "Clang" | - |
275 | # elif defined(__INTEL_MS_COMPAT_LEVEL) | - |
276 | # define ICC_COMPAT "Microsoft" | - |
277 | # elif defined(__GNUC__) | - |
278 | # define ICC_COMPAT "GCC" | - |
279 | # else | - |
280 | # define ICC_COMPAT "no" | - |
281 | # endif | - |
282 | # if __INTEL_COMPILER == 1300 | - |
283 | # define ICC_VERSION "13.0" | - |
284 | # elif __INTEL_COMPILER == 1310 | - |
285 | # define ICC_VERSION "13.1" | - |
286 | # elif __INTEL_COMPILER == 1400 | - |
287 | # define ICC_VERSION "14.0" | - |
288 | # elif __INTEL_COMPILER == 1500 | - |
289 | # define ICC_VERSION "15.0" | - |
290 | # else | - |
291 | # define ICC_VERSION QT_STRINGIFY(__INTEL_COMPILER) | - |
292 | # endif | - |
293 | # ifdef __INTEL_COMPILER_UPDATE | - |
294 | # define COMPILER_STRING "Intel(R) C++ " ICC_VERSION "." QT_STRINGIFY(__INTEL_COMPILER_UPDATE) \ | - |
295 | " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ | - |
296 | ICC_COMPAT " compatibility]" | - |
297 | # else | - |
298 | # define COMPILER_STRING "Intel(R) C++ " ICC_VERSION \ | - |
299 | " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ | - |
300 | ICC_COMPAT " compatibility]" | - |
301 | # endif | - |
302 | #elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too | - |
303 | # ifdef __apple_build_version__ // Apple clang has other version numbers | - |
304 | # define COMPILER_STRING "Clang " __clang_version__ " (Apple)" | - |
305 | # else | - |
306 | # define COMPILER_STRING "Clang " __clang_version__ | - |
307 | # endif | - |
308 | #elif defined(Q_CC_GHS) | - |
309 | # define COMPILER_STRING "GHS " QT_STRINGIFY(__GHS_VERSION_NUMBER) | - |
310 | #elif defined(Q_CC_GNU) | - |
311 | # define COMPILER_STRING "GCC " __VERSION__ | - |
312 | #elif defined(Q_CC_MSVC) | - |
313 | # if _MSC_VER < 1600 | - |
314 | # define COMPILER_STRING "MSVC 2008" | - |
315 | # elif _MSC_VER < 1700 | - |
316 | # define COMPILER_STRING "MSVC 2010" | - |
317 | # elif _MSC_VER < 1800 | - |
318 | # define COMPILER_STRING "MSVC 2012" | - |
319 | # elif _MSC_VER < 1900 | - |
320 | # define COMPILER_STRING "MSVC 2013" | - |
321 | # elif _MSC_VER < 1910 | - |
322 | # define COMPILER_STRING "MSVC 2015" | - |
323 | # elif _MSC_VER < 2000 | - |
324 | # define COMPILER_STRING "MSVC 2017" | - |
325 | # else | - |
326 | # define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER) | - |
327 | # endif | - |
328 | #else | - |
329 | # define COMPILER_STRING "<unknown compiler>" | - |
330 | #endif | - |
331 | #ifdef QT_NO_DEBUG | - |
332 | # define DEBUG_STRING " release" | - |
333 | #else | - |
334 | # define DEBUG_STRING " debug" | - |
335 | #endif | - |
336 | #ifdef QT_SHARED | - |
337 | # define SHARED_STRING " shared (dynamic)" | - |
338 | #else | - |
339 | # define SHARED_STRING " static" | - |
340 | #endif | - |
341 | #define QT_BUILD_STR "Qt " QT_VERSION_STR " (" ARCH_FULL SHARED_STRING DEBUG_STRING " build; by " COMPILER_STRING ")" | - |
342 | | - |
343 | | - |
344 | | - |
345 | | - |
346 | | - |
347 | | - |
348 | | - |
349 | | - |
350 | | - |
351 | const char *QLibraryInfo::build() Q_DECL_NOTHROW | - |
352 | { | - |
353 | return QT_BUILD_STR;executed 1436 times by 506 tests: return "Qt " "5.7.1" " (" "x86_64" "-" "little_endian" "-" "lp64" "" "" "" " shared (dynamic)" " debug" " build; by " "GCC " "4.9.2" ")"; Executed by:- tst_Collections
- tst_Compiler
- tst_Gestures
- tst_Lancelot
- tst_LargeFile
- tst_ModelTest
- tst_NetworkSelfTest
- tst_PlatformSocketEngine
- tst_QAbstractAnimation
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSocket
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- ...
| 1436 |
354 | } | - |
355 | | - |
356 | | - |
357 | | - |
358 | | - |
359 | | - |
360 | | - |
361 | bool | - |
362 | QLibraryInfo::isDebugBuild() | - |
363 | { | - |
364 | #ifdef QT_DEBUG | - |
365 | return true; | - |
366 | #else | - |
367 | return false; | - |
368 | #endif | - |
369 | } | - |
370 | | - |
371 | #endif // QT_BUILD_QMAKE | - |
372 | | - |
373 | | - |
374 | | - |
375 | | - |
376 | | - |
377 | | - |
378 | | - |
379 | | - |
380 | | - |
381 | | - |
382 | static const struct { | - |
383 | char key[19], value[13]; | - |
384 | } qtConfEntries[] = { | - |
385 | { "Prefix", "." }, | - |
386 | { "Documentation", "doc" }, | - |
387 | { "Headers", "include" }, | - |
388 | { "Libraries", "lib" }, | - |
389 | #ifdef Q_OS_WIN | - |
390 | { "LibraryExecutables", "bin" }, | - |
391 | #else | - |
392 | { "LibraryExecutables", "libexec" }, | - |
393 | #endif | - |
394 | { "Binaries", "bin" }, | - |
395 | { "Plugins", "plugins" }, | - |
396 | { "Imports", "imports" }, | - |
397 | { "Qml2Imports", "qml" }, | - |
398 | { "ArchData", "." }, | - |
399 | { "Data", "." }, | - |
400 | { "Translations", "translations" }, | - |
401 | { "Examples", "examples" }, | - |
402 | { "Tests", "tests" }, | - |
403 | #ifdef QT_BUILD_QMAKE | - |
404 | { "Sysroot", "" }, | - |
405 | { "HostBinaries", "bin" }, | - |
406 | { "HostLibraries", "lib" }, | - |
407 | { "HostData", "." }, | - |
408 | { "TargetSpec", "" }, | - |
409 | { "HostSpec", "" }, | - |
410 | { "HostPrefix", "" }, | - |
411 | #endif | - |
412 | }; | - |
413 | | - |
414 | | - |
415 | | - |
416 | | - |
417 | QString | - |
418 | QLibraryInfo::location(LibraryLocation loc) | - |
419 | { | - |
420 | #ifdef QT_BUILD_QMAKE // ends inside rawLocation ! | - |
421 | QString ret = rawLocation(loc, FinalPaths); | - |
422 | | - |
423 | | - |
424 | if ((loc < SysrootPath || loc > LastHostPath) && QT_CONFIGURE_SYSROOTIFY_PREFIX) { | - |
425 | QString sysroot = rawLocation(SysrootPath, FinalPaths); | - |
426 | if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':') | - |
427 | && (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\'))) | - |
428 | ret.replace(0, 2, sysroot); | - |
429 | else | - |
430 | ret.prepend(sysroot); | - |
431 | } | - |
432 | | - |
433 | return ret; | - |
434 | } | - |
435 | | - |
436 | QString | - |
437 | QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) | - |
438 | { | - |
439 | #endif // QT_BUILD_QMAKE, started inside location ! | - |
440 | QString ret; | - |
441 | #ifdef QT_BUILD_QMAKE | - |
442 | | - |
443 | | - |
444 | | - |
445 | | - |
446 | | - |
447 | | - |
448 | PathGroup orig_group = group; | - |
449 | if (!QLibraryInfoPrivate::haveGroup(group) | - |
450 | && !(group == EffectiveSourcePaths | - |
451 | && (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group))) | - |
452 | && !((group == EffectivePaths || group == DevicePaths) | - |
453 | && (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group))) | - |
454 | && (group = orig_group, true)) | - |
455 | #elif !defined(QT_NO_SETTINGS) | - |
456 | if (!QLibraryInfoPrivate::configuration()) | - |
457 | #endif | - |
458 | { | - |
459 | const char * volatile path = 0; | - |
460 | if (loc == PrefixPath) { | - |
461 | path = | - |
462 | #ifdef QT_BUILD_QMAKE | - |
463 | (group != DevicePaths) ? | - |
464 | QT_CONFIGURE_EXT_PREFIX_PATH : | - |
465 | #endif | - |
466 | QT_CONFIGURE_PREFIX_PATH; | - |
467 | } else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) { | - |
468 | path = qt_configure_strs + qt_configure_str_offsets[loc - 1]; | - |
469 | #ifndef Q_OS_WIN // On Windows we use the registry | - |
470 | } else if (loc == SettingsPath) { | - |
471 | path = QT_CONFIGURE_SETTINGS_PATH; | - |
472 | #endif | - |
473 | #ifdef QT_BUILD_QMAKE | - |
474 | } else if (loc == HostPrefixPath) { | - |
475 | path = QT_CONFIGURE_HOST_PREFIX_PATH; | - |
476 | #endif | - |
477 | } | - |
478 | | - |
479 | if (path) | - |
480 | ret = QString::fromLocal8Bit(path); | - |
481 | #ifndef QT_NO_SETTINGS | - |
482 | } else { | - |
483 | QString key; | - |
484 | QString defaultValue; | - |
485 | if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) { | - |
486 | key = QLatin1String(qtConfEntries[loc].key); | - |
487 | defaultValue = QLatin1String(qtConfEntries[loc].value); | - |
488 | } | - |
489 | #ifndef Q_OS_WIN // On Windows we use the registry | - |
490 | else if (loc == SettingsPath) { | - |
491 | key = QLatin1String("Settings"); | - |
492 | defaultValue = QLatin1String("."); | - |
493 | } | - |
494 | #endif | - |
495 | | - |
496 | if(!key.isNull()) { | - |
497 | QSettings *config = QLibraryInfoPrivate::configuration(); | - |
498 | config->beginGroup(QLatin1String( | - |
499 | #ifdef QT_BUILD_QMAKE | - |
500 | group == DevicePaths ? "DevicePaths" : | - |
501 | group == EffectiveSourcePaths ? "EffectiveSourcePaths" : | - |
502 | group == EffectivePaths ? "EffectivePaths" : | - |
503 | #endif | - |
504 | "Paths")); | - |
505 | | - |
506 | ret = config->value(key, defaultValue).toString(); | - |
507 | | - |
508 | #ifdef QT_BUILD_QMAKE | - |
509 | if (ret.isEmpty()) { | - |
510 | if (loc == HostPrefixPath) | - |
511 | ret = config->value(QLatin1String(qtConfEntries[PrefixPath].key), | - |
512 | QLatin1String(qtConfEntries[PrefixPath].value)).toString(); | - |
513 | else if (loc == TargetSpecPath || loc == HostSpecPath) | - |
514 | ret = QString::fromLocal8Bit(qt_configure_strs + qt_configure_str_offsets[loc - 1]); | - |
515 | } | - |
516 | #endif | - |
517 | | - |
518 | | - |
519 | int rep; | - |
520 | QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); | - |
521 | reg_var.setMinimal(true); | - |
522 | while((rep = reg_var.indexIn(ret)) != -1) { | - |
523 | ret.replace(rep, reg_var.matchedLength(), | - |
524 | QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, | - |
525 | reg_var.matchedLength() - 3).toLatin1().constData()).constData())); | - |
526 | } | - |
527 | | - |
528 | config->endGroup(); | - |
529 | | - |
530 | ret = QDir::fromNativeSeparators(ret); | - |
531 | } | - |
532 | #endif // QT_NO_SETTINGS | - |
533 | } | - |
534 | | - |
535 | #ifdef QT_BUILD_QMAKE | - |
536 | | - |
537 | if (loc == TargetSpecPath || loc == HostSpecPath) | - |
538 | return ret; | - |
539 | #endif | - |
540 | | - |
541 | if (!ret.isEmpty() && QDir::isRelativePath(ret)) { | - |
542 | QString baseDir; | - |
543 | #ifdef QT_BUILD_QMAKE | - |
544 | if (loc == HostPrefixPath || loc == PrefixPath || loc == SysrootPath) { | - |
545 | | - |
546 | | - |
547 | | - |
548 | baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath(); | - |
549 | } else if (loc > SysrootPath && loc <= LastHostPath) { | - |
550 | | - |
551 | baseDir = rawLocation(HostPrefixPath, group); | - |
552 | } else { | - |
553 | | - |
554 | baseDir = rawLocation(PrefixPath, group); | - |
555 | } | - |
556 | #else | - |
557 | if (loc == PrefixPath) { | - |
558 | if (QCoreApplication::instance()) { | - |
559 | #ifdef Q_OS_DARWIN | - |
560 | CFBundleRef bundleRef = CFBundleGetMainBundle(); | - |
561 | if (bundleRef) { | - |
562 | QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef); | - |
563 | if (urlRef) { | - |
564 | QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); | - |
565 | #ifdef Q_OS_OSX | - |
566 | QString bundleContentsDir = QString(path) + QLatin1String("/Contents/"); | - |
567 | if (QDir(bundleContentsDir).exists()) | - |
568 | return QDir::cleanPath(bundleContentsDir + ret); | - |
569 | #else | - |
570 | return QDir::cleanPath(QString(path) + QLatin1Char('/') + ret); | - |
571 | #endif // Q_OS_OSX | - |
572 | } | - |
573 | } | - |
574 | #endif // Q_OS_DARWIN | - |
575 | | - |
576 | baseDir = QCoreApplication::applicationDirPath(); | - |
577 | } else { | - |
578 | baseDir = QDir::currentPath(); | - |
579 | } | - |
580 | } else { | - |
581 | | - |
582 | baseDir = location(PrefixPath); | - |
583 | } | - |
584 | #endif // QT_BUILD_QMAKE | - |
585 | ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); | - |
586 | } | - |
587 | return ret; | - |
588 | } | - |
589 | | - |
590 | | - |
591 | | - |
592 | | - |
593 | | - |
594 | | - |
595 | | - |
596 | | - |
597 | | - |
598 | | - |
599 | | - |
600 | | - |
601 | | - |
602 | | - |
603 | QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) | - |
604 | { | - |
605 | #if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS) | - |
606 | QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration()); | - |
607 | if (!settings.isNull()) { | - |
608 | QString key = QLatin1String(platformsSection); | - |
609 | key += QLatin1Char('/'); | - |
610 | key += platformName; | - |
611 | key += QLatin1String("Arguments"); | - |
612 | return settings->value(key).toStringList(); | - |
613 | } | - |
614 | #endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS | - |
615 | return QStringList(); | - |
616 | } | - |
617 | | - |
618 | | - |
619 | | - |
620 | | - |
621 | | - |
622 | | - |
623 | | - |
624 | | - |
625 | | - |
626 | | - |
627 | | - |
628 | | - |
629 | | - |
630 | | - |
631 | | - |
632 | | - |
633 | | - |
634 | | - |
635 | | - |
636 | | - |
637 | | - |
638 | | - |
639 | | - |
640 | | - |
641 | | - |
642 | | - |
643 | | - |
644 | | - |
645 | QT_END_NAMESPACE | - |
646 | | - |
647 | #if defined(Q_CC_GNU) && defined(ELF_INTERPRETER) | - |
648 | # include <stdio.h> | - |
649 | # include <stdlib.h> | - |
650 | | - |
651 | #include "private/qcoreapplication_p.h" | - |
652 | | - |
653 | extern const char qt_core_interpreter[] __attribute__((section(".interp"))) | - |
654 | = ELF_INTERPRETER; | - |
655 | | - |
656 | extern "C" void qt_core_boilerplate(); | - |
657 | void qt_core_boilerplate() | - |
658 | { | - |
659 | printf("This is the QtCore library version " QT_BUILD_STR "\n" | - |
660 | "Copyright (C) 2016 The Qt Company Ltd.\n" | - |
661 | "Contact: http://www.qt.io/licensing/\n" | - |
662 | "\n" | - |
663 | "Installation prefix: %s\n" | - |
664 | "Library path: %s\n" | - |
665 | "Include path: %s\n", | - |
666 | qt_configure_prefix_path_str + 12, | - |
667 | qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1], | - |
668 | qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]); | - |
669 | | - |
670 | QT_PREPEND_NAMESPACE(qDumpCPUFeatures)(); | - |
671 | | - |
672 | #ifdef QT_EVAL | - |
673 | extern void qt_core_eval_init(QCoreApplicationPrivate::Type); | - |
674 | qt_core_eval_init(QCoreApplicationPrivate::Tty); | - |
675 | #endif | - |
676 | | - |
677 | exit(0); | - |
678 | } | - |
679 | | - |
680 | #endif | - |
| | |