author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 09:15:16 +0300 | |
branch | RCL_3 |
changeset 11 | 68d3b337861b |
parent 4 | 3b1da2848fc7 |
child 30 | 5dc02b23752f |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtCore module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include "qdir.h" |
|
43 |
#include "qfile.h" |
|
44 |
#include "qconfig.h" |
|
45 |
#include "qsettings.h" |
|
46 |
#include "qlibraryinfo.h" |
|
47 |
#include "qscopedpointer.h" |
|
48 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
49 |
#if defined(QT_BUILD_QMAKE) || defined(QT_BOOTSTRAPPED) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
50 |
# define BOOTSTRAPPING |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
#endif |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
52 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
#ifdef BOOTSTRAPPING |
0 | 54 |
QT_BEGIN_NAMESPACE |
55 |
extern QString qmake_libraryInfoFile(); |
|
56 |
QT_END_NAMESPACE |
|
57 |
#else |
|
58 |
# include "qcoreapplication.h" |
|
59 |
#endif |
|
60 |
||
61 |
#ifdef Q_OS_MAC |
|
62 |
# include "private/qcore_mac_p.h" |
|
63 |
#endif |
|
64 |
||
65 |
#include "qconfig.cpp" |
|
66 |
||
67 |
QT_BEGIN_NAMESPACE |
|
68 |
||
69 |
#ifndef QT_NO_SETTINGS |
|
70 |
||
71 |
struct QLibrarySettings |
|
72 |
{ |
|
73 |
QLibrarySettings(); |
|
74 |
QScopedPointer<QSettings> settings; |
|
75 |
}; |
|
76 |
Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) |
|
77 |
||
78 |
class QLibraryInfoPrivate |
|
79 |
{ |
|
80 |
public: |
|
81 |
static QSettings *findConfiguration(); |
|
82 |
static void cleanup() |
|
83 |
{ |
|
84 |
QLibrarySettings *ls = qt_library_settings(); |
|
85 |
if (ls) |
|
86 |
ls->settings.reset(0); |
|
87 |
} |
|
88 |
static QSettings *configuration() |
|
89 |
{ |
|
90 |
QLibrarySettings *ls = qt_library_settings(); |
|
91 |
return ls ? ls->settings.data() : 0; |
|
92 |
} |
|
93 |
}; |
|
94 |
||
95 |
QLibrarySettings::QLibrarySettings() |
|
96 |
: settings(QLibraryInfoPrivate::findConfiguration()) |
|
97 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
#ifndef BOOTSTRAPPING |
0 | 99 |
qAddPostRoutine(QLibraryInfoPrivate::cleanup); |
100 |
#endif |
|
101 |
} |
|
102 |
||
103 |
QSettings *QLibraryInfoPrivate::findConfiguration() |
|
104 |
{ |
|
105 |
QString qtconfig = QLatin1String(":/qt/etc/qt.conf"); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
#ifdef BOOTSTRAPPING |
0 | 107 |
if(!QFile::exists(qtconfig)) |
108 |
qtconfig = qmake_libraryInfoFile(); |
|
109 |
#else |
|
110 |
if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { |
|
111 |
#ifdef Q_OS_MAC |
|
112 |
CFBundleRef bundleRef = CFBundleGetMainBundle(); |
|
113 |
if (bundleRef) { |
|
114 |
QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef, |
|
115 |
QCFString(QLatin1String("qt.conf")), |
|
116 |
0, |
|
117 |
0); |
|
118 |
if (urlRef) { |
|
119 |
QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); |
|
120 |
qtconfig = QDir::cleanPath(path); |
|
121 |
} |
|
122 |
} |
|
123 |
if (qtconfig.isEmpty()) |
|
124 |
#endif |
|
125 |
{ |
|
126 |
QDir pwd(QCoreApplication::applicationDirPath()); |
|
127 |
qtconfig = pwd.filePath(QLatin1String("qt.conf")); |
|
128 |
} |
|
129 |
} |
|
130 |
#endif |
|
131 |
if (QFile::exists(qtconfig)) |
|
132 |
return new QSettings(qtconfig, QSettings::IniFormat); |
|
133 |
return 0; //no luck |
|
134 |
} |
|
135 |
||
136 |
/*! |
|
137 |
\class QLibraryInfo |
|
138 |
\brief The QLibraryInfo class provides information about the Qt library. |
|
139 |
||
140 |
Many pieces of information are established when Qt is configured. |
|
141 |
Installation paths, license information, and even a unique build |
|
142 |
key. This class provides an abstraction for accessing this |
|
143 |
information. |
|
144 |
||
145 |
\table |
|
146 |
\header \o Function \o Return value |
|
147 |
\row \o buildKey() \o A string that identifies the Qt version and |
|
148 |
the configuration. This key is used to ensure |
|
149 |
that \l{plugins} link against the same version |
|
150 |
of Qt as the application. |
|
151 |
\row \o location() \o The path to a certain Qt |
|
152 |
component (e.g., documentation, header files). |
|
153 |
\row \o licensee(), |
|
154 |
licensedProducts() \o Licensing information. |
|
155 |
\endtable |
|
156 |
||
157 |
You can also use a \c qt.conf file to override the hard-coded paths |
|
158 |
that are compiled into the Qt library. For more information, see |
|
159 |
the \l {Using qt.conf} documentation. |
|
160 |
||
161 |
\sa QSysInfo, {Using qt.conf} |
|
162 |
*/ |
|
163 |
||
164 |
/*! \internal |
|
165 |
||
166 |
You cannot create a QLibraryInfo, instead only the static functions are available to query |
|
167 |
information. |
|
168 |
*/ |
|
169 |
||
170 |
QLibraryInfo::QLibraryInfo() |
|
171 |
{ } |
|
172 |
||
173 |
/*! |
|
174 |
Returns the person to whom this build of Qt is licensed. |
|
175 |
||
176 |
\sa licensedProducts() |
|
177 |
*/ |
|
178 |
||
179 |
QString |
|
180 |
QLibraryInfo::licensee() |
|
181 |
{ |
|
182 |
const char *str = QT_CONFIGURE_LICENSEE; |
|
183 |
return QString::fromLocal8Bit(str); |
|
184 |
} |
|
185 |
||
186 |
/*! |
|
187 |
Returns the products that the license for this build of Qt has access to. |
|
188 |
||
189 |
\sa licensee() |
|
190 |
*/ |
|
191 |
||
192 |
QString |
|
193 |
QLibraryInfo::licensedProducts() |
|
194 |
{ |
|
195 |
const char *str = QT_CONFIGURE_LICENSED_PRODUCTS; |
|
196 |
return QString::fromLatin1(str); |
|
197 |
} |
|
198 |
||
199 |
/*! |
|
200 |
Returns a unique key identifying this build of Qt and its |
|
201 |
configurations. This key is not globally unique, rather only useful |
|
202 |
for establishing of two configurations are compatible. This can be |
|
203 |
used to compare with the \c QT_BUILD_KEY preprocessor symbol. |
|
204 |
||
205 |
\sa location() |
|
206 |
*/ |
|
207 |
||
208 |
QString |
|
209 |
QLibraryInfo::buildKey() |
|
210 |
{ |
|
211 |
return QString::fromLatin1(QT_BUILD_KEY); |
|
212 |
} |
|
213 |
||
214 |
/*! |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
215 |
\since 4.6 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
216 |
Returns the installation date for this build of Qt. The install date will |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
217 |
usually be the last time that Qt sources were configured. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
218 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
219 |
#ifndef QT_NO_DATESTRING |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
220 |
QDate |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
221 |
QLibraryInfo::buildDate() |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
222 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
223 |
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
224 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
#endif //QT_NO_DATESTRING |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
/*! |
0 | 228 |
Returns the location specified by \a loc. |
229 |
||
230 |
*/ |
|
231 |
||
232 |
QString |
|
233 |
QLibraryInfo::location(LibraryLocation loc) |
|
234 |
{ |
|
235 |
QString ret; |
|
236 |
if(!QLibraryInfoPrivate::configuration()) { |
|
237 |
const char *path = 0; |
|
238 |
switch (loc) { |
|
239 |
#ifdef QT_CONFIGURE_PREFIX_PATH |
|
240 |
case PrefixPath: |
|
241 |
path = QT_CONFIGURE_PREFIX_PATH; |
|
242 |
break; |
|
243 |
#endif |
|
244 |
#ifdef QT_CONFIGURE_DOCUMENTATION_PATH |
|
245 |
case DocumentationPath: |
|
246 |
path = QT_CONFIGURE_DOCUMENTATION_PATH; |
|
247 |
break; |
|
248 |
#endif |
|
249 |
#ifdef QT_CONFIGURE_HEADERS_PATH |
|
250 |
case HeadersPath: |
|
251 |
path = QT_CONFIGURE_HEADERS_PATH; |
|
252 |
break; |
|
253 |
#endif |
|
254 |
#ifdef QT_CONFIGURE_LIBRARIES_PATH |
|
255 |
case LibrariesPath: |
|
256 |
path = QT_CONFIGURE_LIBRARIES_PATH; |
|
257 |
break; |
|
258 |
#endif |
|
259 |
#ifdef QT_CONFIGURE_BINARIES_PATH |
|
260 |
case BinariesPath: |
|
261 |
path = QT_CONFIGURE_BINARIES_PATH; |
|
262 |
break; |
|
263 |
#endif |
|
264 |
#ifdef QT_CONFIGURE_PLUGINS_PATH |
|
265 |
case PluginsPath: |
|
266 |
path = QT_CONFIGURE_PLUGINS_PATH; |
|
267 |
break; |
|
268 |
#endif |
|
269 |
#ifdef QT_CONFIGURE_DATA_PATH |
|
270 |
case DataPath: |
|
271 |
path = QT_CONFIGURE_DATA_PATH; |
|
272 |
break; |
|
273 |
#endif |
|
274 |
#ifdef QT_CONFIGURE_TRANSLATIONS_PATH |
|
275 |
case TranslationsPath: |
|
276 |
path = QT_CONFIGURE_TRANSLATIONS_PATH; |
|
277 |
break; |
|
278 |
#endif |
|
279 |
#ifdef QT_CONFIGURE_SETTINGS_PATH |
|
280 |
case SettingsPath: |
|
281 |
path = QT_CONFIGURE_SETTINGS_PATH; |
|
282 |
break; |
|
283 |
#endif |
|
284 |
#ifdef QT_CONFIGURE_EXAMPLES_PATH |
|
285 |
case ExamplesPath: |
|
286 |
path = QT_CONFIGURE_EXAMPLES_PATH; |
|
287 |
break; |
|
288 |
#endif |
|
289 |
#ifdef QT_CONFIGURE_DEMOS_PATH |
|
290 |
case DemosPath: |
|
291 |
path = QT_CONFIGURE_DEMOS_PATH; |
|
292 |
break; |
|
293 |
#endif |
|
294 |
default: |
|
295 |
break; |
|
296 |
} |
|
297 |
||
298 |
if (path) |
|
299 |
ret = QString::fromLocal8Bit(path); |
|
300 |
} else { |
|
301 |
QString key; |
|
302 |
QString defaultValue; |
|
303 |
switch(loc) { |
|
304 |
case PrefixPath: |
|
305 |
key = QLatin1String("Prefix"); |
|
306 |
break; |
|
307 |
case DocumentationPath: |
|
308 |
key = QLatin1String("Documentation"); |
|
309 |
defaultValue = QLatin1String("doc"); |
|
310 |
break; |
|
311 |
case HeadersPath: |
|
312 |
key = QLatin1String("Headers"); |
|
313 |
defaultValue = QLatin1String("include"); |
|
314 |
break; |
|
315 |
case LibrariesPath: |
|
316 |
key = QLatin1String("Libraries"); |
|
317 |
defaultValue = QLatin1String("lib"); |
|
318 |
break; |
|
319 |
case BinariesPath: |
|
320 |
key = QLatin1String("Binaries"); |
|
321 |
defaultValue = QLatin1String("bin"); |
|
322 |
break; |
|
323 |
case PluginsPath: |
|
324 |
key = QLatin1String("Plugins"); |
|
325 |
defaultValue = QLatin1String("plugins"); |
|
326 |
break; |
|
327 |
case DataPath: |
|
328 |
key = QLatin1String("Data"); |
|
329 |
break; |
|
330 |
case TranslationsPath: |
|
331 |
key = QLatin1String("Translations"); |
|
332 |
defaultValue = QLatin1String("translations"); |
|
333 |
break; |
|
334 |
case SettingsPath: |
|
335 |
key = QLatin1String("Settings"); |
|
336 |
break; |
|
337 |
case ExamplesPath: |
|
338 |
key = QLatin1String("Examples"); |
|
339 |
break; |
|
340 |
case DemosPath: |
|
341 |
key = QLatin1String("Demos"); |
|
342 |
break; |
|
343 |
default: |
|
344 |
break; |
|
345 |
} |
|
346 |
||
347 |
if(!key.isNull()) { |
|
348 |
QSettings *config = QLibraryInfoPrivate::configuration(); |
|
349 |
config->beginGroup(QLatin1String("Paths")); |
|
350 |
||
351 |
QString subKey; |
|
352 |
{ |
|
353 |
/* |
|
354 |
find the child group whose version number is closest |
|
355 |
to the library version. for example and we have the |
|
356 |
following groups: |
|
357 |
||
358 |
Paths |
|
359 |
Paths/4.0 |
|
360 |
Paths/4.1.2 |
|
361 |
Paths/4.2.5 |
|
362 |
Paths/5 |
|
363 |
||
364 |
if QT_VERSION is 4.0.1, then we use 'Paths/4.0' |
|
365 |
if QT_VERSION is 4.1.5, then we use 'Paths/4.1.2' |
|
366 |
if QT_VERSION is 4.6.3, then we use 'Paths/4.2.5' |
|
367 |
if QT_VERSION is 6.0.2, then we use 'Paths/5' |
|
368 |
||
369 |
note: any of the trailing version numbers may be |
|
370 |
omitted (in which case, they default to zero), |
|
371 |
i.e. 4 == 4.0.0, 4.1 == 4.1.0, and so on |
|
372 |
*/ |
|
373 |
enum { |
|
374 |
QT_MAJOR = ((QT_VERSION >> 16) & 0xFF), |
|
375 |
QT_MINOR = ((QT_VERSION >> 8) & 0xFF), |
|
376 |
QT_PATCH = (QT_VERSION & 0xFF) |
|
377 |
}; |
|
378 |
int maj = 0, min = 0, pat = 0; |
|
379 |
QStringList children = config->childGroups(); |
|
380 |
for(int child = 0; child < children.size(); ++child) { |
|
381 |
QString cver = children.at(child); |
|
382 |
QStringList cver_list = cver.split(QLatin1Char('.')); |
|
383 |
if(cver_list.size() > 0 && cver_list.size() < 4) { |
|
384 |
bool ok; |
|
385 |
int cmaj = -1, cmin = -1, cpat = -1; |
|
386 |
cmaj = cver_list[0].toInt(&ok); |
|
387 |
if(!ok || cmaj < 0) |
|
388 |
continue; |
|
389 |
if(cver_list.size() >= 2) { |
|
390 |
cmin = cver_list[1].toInt(&ok); |
|
391 |
if(!ok) |
|
392 |
continue; |
|
393 |
if(cmin < 0) |
|
394 |
cmin = -1; |
|
395 |
} |
|
396 |
if(cver_list.size() >= 3) { |
|
397 |
cpat = cver_list[2].toInt(&ok); |
|
398 |
if(!ok) |
|
399 |
continue; |
|
400 |
if(cpat < 0) |
|
401 |
cpat = -1; |
|
402 |
} |
|
403 |
if((cmaj >= maj && cmaj <= QT_MAJOR) && |
|
404 |
(cmin == -1 || (cmin >= min && cmin <= QT_MINOR)) && |
|
405 |
(cpat == -1 || (cpat >= pat && cpat <= QT_PATCH)) && |
|
406 |
config->contains(cver + QLatin1Char('/') + key)) { |
|
407 |
subKey = cver + QLatin1Char('/'); |
|
408 |
maj = cmaj; |
|
409 |
min = cmin; |
|
410 |
pat = cpat; |
|
411 |
} |
|
412 |
} |
|
413 |
} |
|
414 |
} |
|
415 |
ret = config->value(subKey + key, defaultValue).toString(); |
|
416 |
// expand environment variables in the form $(ENVVAR) |
|
417 |
int rep; |
|
418 |
QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); |
|
419 |
reg_var.setMinimal(true); |
|
420 |
while((rep = reg_var.indexIn(ret)) != -1) { |
|
421 |
ret.replace(rep, reg_var.matchedLength(), |
|
422 |
QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, |
|
423 |
reg_var.matchedLength() - 3).toLatin1().constData()).constData())); |
|
424 |
} |
|
425 |
config->endGroup(); |
|
426 |
} |
|
427 |
} |
|
428 |
||
429 |
if (QDir::isRelativePath(ret)) { |
|
430 |
if (loc == PrefixPath) { |
|
431 |
// we make the prefix path absolute to the executable's directory |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
432 |
#ifdef BOOTSTRAPPING |
0 | 433 |
return QFileInfo(qmake_libraryInfoFile()).absolutePath(); |
434 |
#else |
|
435 |
if (QCoreApplication::instance()) { |
|
436 |
#ifdef Q_OS_MAC |
|
437 |
CFBundleRef bundleRef = CFBundleGetMainBundle(); |
|
438 |
if (bundleRef) { |
|
439 |
QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef); |
|
440 |
if (urlRef) { |
|
441 |
QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); |
|
442 |
return QDir::cleanPath(path + QLatin1String("/Contents/") + ret); |
|
443 |
} |
|
444 |
} |
|
445 |
#endif |
|
446 |
return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret); |
|
447 |
} else { |
|
448 |
return QDir::current().absoluteFilePath(ret); |
|
449 |
} |
|
450 |
#endif |
|
451 |
} else { |
|
452 |
// we make any other path absolute to the prefix directory |
|
453 |
return QDir(location(PrefixPath)).absoluteFilePath(ret); |
|
454 |
} |
|
455 |
} |
|
456 |
return ret; |
|
457 |
} |
|
458 |
||
459 |
/*! |
|
460 |
\enum QLibraryInfo::LibraryLocation |
|
461 |
||
462 |
\keyword library location |
|
463 |
||
464 |
This enum type is used to specify a specific location |
|
465 |
specifier: |
|
466 |
||
467 |
\value PrefixPath The default prefix for all paths. |
|
468 |
\value DocumentationPath The location for documentation upon install. |
|
469 |
\value HeadersPath The location for all headers. |
|
470 |
\value LibrariesPath The location of installed librarires. |
|
471 |
\value BinariesPath The location of installed Qt binaries (tools and applications). |
|
472 |
\value PluginsPath The location of installed Qt plugins. |
|
473 |
\value DataPath The location of general Qt data. |
|
474 |
\value TranslationsPath The location of translation information for Qt strings. |
|
475 |
\value SettingsPath The location for Qt settings. |
|
476 |
\value ExamplesPath The location for examples upon install. |
|
477 |
\value DemosPath The location for demos upon install. |
|
478 |
||
479 |
\sa location() |
|
480 |
*/ |
|
481 |
||
482 |
#endif // QT_NO_SETTINGS |
|
483 |
||
484 |
QT_END_NAMESPACE |
|
485 |
||
486 |
#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER) |
|
487 |
# include <stdio.h> |
|
488 |
# include <stdlib.h> |
|
489 |
||
490 |
extern const char qt_core_interpreter[] __attribute__((section(".interp"))) |
|
491 |
= ELF_INTERPRETER; |
|
492 |
||
493 |
extern "C" void qt_core_boilerplate(); |
|
494 |
void qt_core_boilerplate() |
|
495 |
{ |
|
496 |
printf("This is the QtCore library version " QT_VERSION_STR "\n" |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
497 |
"Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).\n" |
0 | 498 |
"Contact: Nokia Corporation (qt-info@nokia.com)\n" |
499 |
"\n" |
|
500 |
"Build key: " QT_BUILD_KEY "\n" |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
501 |
"Build date: %s\n" |
0 | 502 |
"Installation prefix: %s\n" |
503 |
"Library path: %s\n" |
|
504 |
"Include path: %s\n", |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
505 |
qt_configure_installation + 12, |
0 | 506 |
qt_configure_prefix_path_str + 12, |
507 |
qt_configure_libraries_path_str + 12, |
|
508 |
qt_configure_headers_path_str + 12); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
509 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
510 |
#ifdef QT_EVAL |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
511 |
extern void qt_core_eval_init(uint); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
512 |
qt_core_eval_init(1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
513 |
#endif |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
514 |
|
0 | 515 |
exit(0); |
516 |
} |
|
517 |
||
518 |
#endif |