[Kde-bindings] KDE/kdebindings/generator

Arno Rehn kde at arnorehn.de
Mon Nov 2 21:03:22 UTC 2009


SVN commit 1044013 by arnorehn:

First try to load plugins from the executable directory.
Thanks to urkud for that patch!

CCMAIL: kde-bindings at kde.org



 M  +8 -2      main.cpp  


--- trunk/KDE/kdebindings/generator/main.cpp #1044012:1044013
@@ -158,10 +158,16 @@
     } else {
         qWarning() << "Couldn't find config file" << configFile.filePath();
     }
-    
-    QLibrary lib("generator_" + generator);
+
+    // first try to load plugins from the executable's directory
+    QLibrary lib(app.applicationDirPath() + "/generator_" + generator);
     lib.load();
     if (!lib.isLoaded()) {
+        lib.unload();
+        lib.setFileName("generator_" + generator);
+        lib.load();
+    }
+    if (!lib.isLoaded()) {
         qCritical() << lib.errorString();
         return EXIT_FAILURE;
     }



More information about the Kde-bindings mailing list