69 lines
2.9 KiB
Diff
69 lines
2.9 KiB
Diff
Description: include legacy pre-multiarch plugin paths
|
|
A full multiarch system requires an architecture-qualified plugin path for
|
|
Qt, but installed systems may still have plugins (e.g., from other
|
|
distribution packages) in another pre-multiarch directory. When constructing
|
|
the plugin path, include both the configured plugin path and a plugin path
|
|
with the architecture triplet stripped out.
|
|
.
|
|
This applies to the general plugin loading system, and to the QML one.
|
|
Author: Steve Langasek <steve.langasek@ubuntu.com>
|
|
Author: Felix Geyer <debfx-pkg@fobos.de>
|
|
Last-Update: 2012-04-25
|
|
|
|
---
|
|
src/corelib/kernel/qcoreapplication.cpp | 17 +++++++++++++++++
|
|
src/declarative/qml/qdeclarativeimport.cpp | 16 ++++++++++++++++
|
|
2 files changed, 33 insertions(+)
|
|
|
|
--- a/src/corelib/kernel/qcoreapplication.cpp
|
|
+++ b/src/corelib/kernel/qcoreapplication.cpp
|
|
@@ -2531,6 +2531,23 @@ QStringList QCoreApplication::libraryPat
|
|
if (!app_libpaths->contains(installPathPlugins))
|
|
app_libpaths->append(installPathPlugins);
|
|
}
|
|
+ QString pathSep("/");
|
|
+ QStringList dirnames = QString(installPathPlugins).split(QLatin1Char('/'), QString::SkipEmptyParts);
|
|
+ if (dirnames[0] == QLatin1String("usr") && dirnames[1] == QLatin1String("lib") && dirnames[3] == QLatin1String("qt4"))
|
|
+ {
|
|
+ QString legacyPathPlugins = pathSep;
|
|
+ int i = 0;
|
|
+ for (QStringList::const_iterator it = dirnames.constBegin(); it != dirnames.constEnd(); ++it) {
|
|
+ if (++i == 3)
|
|
+ continue;
|
|
+ legacyPathPlugins = legacyPathPlugins + QString(*it) + pathSep;
|
|
+ }
|
|
+ if (QFile::exists(legacyPathPlugins)) {
|
|
+ legacyPathPlugins = QDir(legacyPathPlugins).canonicalPath();
|
|
+ if (!app_libpaths->contains(legacyPathPlugins))
|
|
+ app_libpaths->append(legacyPathPlugins);
|
|
+ }
|
|
+ }
|
|
#endif
|
|
|
|
// If QCoreApplication is not yet instantiated,
|
|
--- a/src/declarative/qml/qdeclarativeimport.cpp
|
|
+++ b/src/declarative/qml/qdeclarativeimport.cpp
|
|
@@ -770,6 +770,22 @@ QDeclarativeImportDatabase::QDeclarative
|
|
addImportPath(installImportsPath);
|
|
}
|
|
#else
|
|
+ QStringList dirnames = installImportsPath.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
|
+ if (dirnames[0] == QLatin1String("usr") && dirnames[1] == QLatin1String("lib") && dirnames[3] == QLatin1String("qt4"))
|
|
+ {
|
|
+ QString pathSep("/");
|
|
+ QString legacyImportPath = pathSep;
|
|
+ int i = 0;
|
|
+ for (QStringList::const_iterator it = dirnames.constBegin(); it != dirnames.constEnd(); ++it) {
|
|
+ if (++i == 3)
|
|
+ continue;
|
|
+ legacyImportPath = legacyImportPath + *it + pathSep;
|
|
+ }
|
|
+ if (QFile::exists(legacyImportPath)) {
|
|
+ addImportPath(legacyImportPath);
|
|
+ }
|
|
+ }
|
|
+
|
|
addImportPath(installImportsPath);
|
|
#endif
|
|
|