From 89478a911481a229bcc7d73071f274229ee12991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 25 Nov 2009 11:04:18 +0100 Subject: 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. --- src/corelib/plugin/qlibrary.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) { -- cgit v0.12