Package: qt4-x11 / 4:4.8.7+dfsg-18

qt-multiarch-plugin-path-compat.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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