All pastes #884775 Raw Edit

Mine

public text v1 · immutable
#884775 ·published 2008-01-30 16:26 UTC
rendered paste body
Index: kstandarddirs.cpp
===================================================================
--- kstandarddirs.cpp   (revision 767687)
+++ kstandarddirs.cpp   (working copy)
@@ -391,6 +391,15 @@
                                     const QString& absdir,
                                     bool priority)
 {
+    if (strcmp(type, "qtplugins") == 0) {
+        if (priority) {
+            QStringList libPaths(absdir);
+            libPaths += QCoreApplication::libraryPaths();
+            QCoreApplication::setLibraryPaths(libPaths);
+        } else {
+            QCoreApplication::addLibraryPath(absdir);
+        }
+    }
     // find or insert entry in the map
     QStringList &paths = d->absolutes[type];
     QString copy = absdir;
@@ -919,6 +928,9 @@

 QStringList KStandardDirs::resourceDirs(const char *type) const
 {
+    if (strcmp(type, "qtplugins") == 0) {
+        return QCoreApplication::libraryPaths();
+    }
     QMap<QByteArray, QStringList>::const_iterator dirCacheIt = d->dircache.find(type);

     QStringList candidates;