summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-25 10:04:18 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-25 10:04:18 (GMT)
commit89478a911481a229bcc7d73071f274229ee12991 (patch)
tree19ec17eeec3f46edb2aa05dbce6fe2eeeede7e8a /src/corelib/plugin/qlibrary.cpp
parentc086dc9056ee9777938026aec47dccb239a328a7 (diff)
downloadQt-89478a911481a229bcc7d73071f274229ee12991.zip
Qt-89478a911481a229bcc7d73071f274229ee12991.tar.gz
Qt-89478a911481a229bcc7d73071f274229ee12991.tar.bz2
Fix plugin mis-caching issues with universal binaries on Mac
Add the current application architecture to the cache key in order to cache plugin information separately for each arch. This prevents Qt from wrongly caching plugin load failures when the archs don't match.
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
-rw-r--r--src/corelib/plugin/qlibrary.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 6496876..1298a11 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -629,6 +629,22 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
.arg((QT_VERSION & 0xff00) >> 8)
.arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false"))
.arg(fileName);
+#ifdef Q_WS_MAC
+ // On Mac, add the application arch to the reg key in order to
+ // cache plugin information separately for each arch. This prevents
+ // Qt from wrongly caching plugin load failures when the archs
+ // don't match.
+#if defined(__x86_64__)
+ regkey += QLatin1String("-x86_64");
+#elif defined(__i386__)
+ regkey += QLatin1String("-i386");
+#elif defined(__ppc64__)
+ regkey += QLatin1String("-ppc64");
+#elif defined(__ppc__)
+ regkey += QLatin1String("-ppc");
+#endif
+#endif // Q_WS_MAC
+
QStringList reg;
#ifndef QT_NO_SETTINGS
if (!settings) {