diff options
author | axis <qt-info@nokia.com> | 2009-08-21 13:48:44 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-21 13:48:44 (GMT) |
commit | afd7cfce7333635edc8d3637f81cc9c3023ee874 (patch) | |
tree | 433345bd8cfd4a2c057a24ee3c906d274d6282ca /src/corelib/plugin/qlibrary.cpp | |
parent | 044680951401487590c0ed554092dd9b7e0ee783 (diff) | |
parent | 3513c1a01b319fb5fd4057be306c9f9506f8223d (diff) | |
download | Qt-afd7cfce7333635edc8d3637f81cc9c3023ee874.zip Qt-afd7cfce7333635edc8d3637f81cc9c3023ee874.tar.gz Qt-afd7cfce7333635edc8d3637f81cc9c3023ee874.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into master-s60
Conflicts:
src/corelib/io/qfsfileengine_unix.cpp
src/corelib/plugin/qlibrary.cpp
tests/auto/qfileinfo/tst_qfileinfo.cpp
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 3a5bb55..5cf6513 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -421,7 +421,23 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB #endif // Q_OS_UNIX && !Q_OS_MAC && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK) typedef QMap<QString, QLibraryPrivate*> LibraryMap; -Q_GLOBAL_STATIC(LibraryMap, libraryMap) + +struct LibraryData { + LibraryData() : settings(0) { } + ~LibraryData() { + delete settings; + } + + QSettings *settings; + LibraryMap libraryMap; +}; + +Q_GLOBAL_STATIC(LibraryData, libraryData) + +static LibraryMap *libraryMap() +{ + return &(libraryData()->libraryMap); +} QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString &version) :pHnd(0), fileName(canonicalFileName), fullVersion(version), instance(0), qt_version(0), @@ -614,10 +630,12 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) .arg(fileName); QStringList reg; #ifndef QT_NO_SETTINGS - QScopedPointer<QSettings> madeSettings; if (!settings) { - settings = new QSettings(QSettings::UserScope, QLatin1String("Trolltech")); - madeSettings.reset(settings); + settings = libraryData()->settings; + if (!settings) { + settings = new QSettings(QSettings::UserScope, QLatin1String("Trolltech")); + libraryData()->settings = settings; + } } reg = settings->value(regkey).toStringList(); #endif @@ -709,9 +727,6 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) settings->setValue(regkey, queried); #endif } -#ifndef QT_NO_SETTINGS - madeSettings.reset(); -#endif if (!success) { if (errorString.isEmpty()){ |