[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase
From:       Kevin Ottens <ervin () kde ! org>
Date:       2010-11-10 16:42:52
Message-ID: 20101110164252.D0FFDAC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195243 by ervin:

Cleanup KLibLoader use.


 M  +2 -1      apps/dolphin/src/panels/terminal/terminalpanel.cpp  
 M  +0 -1      apps/nsplugins/plugin_part.h  
 M  +9 -9      apps/nsplugins/pluginscan.cpp  
 M  +3 -3      apps/nsplugins/viewer/nsplugin.cpp  
 M  +1 -1      runtime/kioslave/thumbnail/thumbnail.cpp  
 M  +1 -0      workspace/kcontrol/keyboard/keyboard_applet.cpp  
 M  +0 -1      workspace/khotkeys/libkhotkeysprivate/khotkeysglobal.cpp  
 M  +1 -1      workspace/khotkeys/libkhotkeysprivate/soundrecorder.cpp  
 M  +7 -7      workspace/kstyles/oxygen/config/oxygenconfigdialog.cpp  
 M  +7 -4      workspace/kwin/lib/kdecoration_plugins_p.cpp  
 M  +0 -1      workspace/libs/solid/control/managerbase.cpp  


--- trunk/KDE/kdebase/apps/dolphin/src/panels/terminal/terminalpanel.cpp #1195242:1195243
@@ -19,7 +19,8 @@
 
 #include "terminalpanel.h"
 
-#include <klibloader.h>
+#include <kpluginloader.h>
+#include <kpluginfactory.h>
 #include <kde_terminal_interface_v2.h>
 #include <kparts/part.h>
 #include <kshell.h>
--- trunk/KDE/kdebase/apps/nsplugins/plugin_part.h #1195242:1195243
@@ -27,7 +27,6 @@
 #include <kparts/browserextension.h>
 #include <kparts/factory.h>
 #include <kparts/part.h>
-#include <klibloader.h>
 #include <QWidget>
 #include <QPointer>
 #include "nspluginloader.h"
--- trunk/KDE/kdebase/apps/nsplugins/pluginscan.cpp #1195242:1195243
@@ -45,7 +45,7 @@
 #include <kdebug.h>
 #include <kglobal.h>
 #include <kstandarddirs.h>
-#include <klibloader.h>
+#include <klibrary.h>
 #include <kconfig.h>
 #include <kconfiggroup.h>
 #include <kcrash.h>
@@ -226,10 +226,10 @@
 
 static int tryCheck(int write_fd, const QString &absFile)
 {
-    KLibrary *_handle = KLibLoader::self()->library( QFile::encodeName(absFile) );
-    if (!_handle) {
+    KLibrary _handle( QFile::encodeName(absFile) );
+    if (!_handle.load()) {
         kDebug(1433) << " - open failed with message " <<
-		         KLibLoader::self()->lastErrorMessage() << ", skipping " << endl;
+		         _handle.errorString() << ", skipping " << endl;
         return 1;
     }
 
@@ -239,7 +239,7 @@
 
     NPError (*func_GetValue)(void *, NPPVariable, void *) =
         (NPError(*)(void *, NPPVariable, void *))
-        _handle->resolveFunction("NP_GetValue");
+        _handle.resolveFunction("NP_GetValue");
     if ( func_GetValue ) {
 
         // get name
@@ -262,10 +262,10 @@
 
     // get mime description function pointer
     char* (*func_GetMIMEDescription)() =
-        (char *(*)())_handle->resolveFunction("NP_GetMIMEDescription");
+        (char *(*)())_handle.resolveFunction("NP_GetMIMEDescription");
     if ( !func_GetMIMEDescription ) {
         kDebug(1433) << " - no GetMIMEDescription, skipping";
-        KLibLoader::self()->unloadLibrary( QFile::encodeName(absFile) );
+        _handle.unload();
         return 1;
     }
 
@@ -273,7 +273,7 @@
     QString mimeInfo = func_GetMIMEDescription();
     if ( mimeInfo.isEmpty() ) {
         kDebug(1433) << " - no mime info returned, skipping";
-        KLibLoader::self()->unloadLibrary( QFile::encodeName(absFile) );
+        _handle.unload();
         return 1;
     }
 
@@ -286,7 +286,7 @@
 
     // unload plugin lib
     kDebug(1433) << " - unloading plugin";
-    KLibLoader::self()->unloadLibrary( QFile::encodeName(absFile) );
+    _handle.unload();
 
     // create a QDataStream for our IPC pipe (to send plugin info back to the parent)
     QFile stream_file;
--- trunk/KDE/kdebase/apps/nsplugins/viewer/nsplugin.cpp #1195242:1195243
@@ -53,7 +53,7 @@
 #include <kglobal.h>
 #include <kio/netaccess.h>
 #include <kprotocolmanager.h>
-#include <klibloader.h>
+#include <klibrary.h>
 #include <klocale.h>
 #include <kstandarddirs.h>
 #include <ktemporaryfile.h>
@@ -1397,7 +1397,7 @@
     QDBusConnection::sessionBus().registerObject( objectName(), this );
 
     // initialize members
-    _handle = KLibLoader::self()->library(QFile::encodeName(library));
+    _handle = new KLibrary(QFile::encodeName(library), KGlobal::mainComponent(), this);
     _libname = library;
     _constructed = false;
     _error = true;
@@ -1409,7 +1409,7 @@
     connect( _timer, SIGNAL(timeout()), SLOT(timer()) );
 
     // check lib handle
-    if (!_handle) {
+    if (!_handle->load()) {
         kDebug(1431) << "Could not dlopen " << library;
         return;
     }
--- trunk/KDE/kdebase/runtime/kioslave/thumbnail/thumbnail.cpp #1195242:1195243
@@ -46,7 +46,7 @@
 #include <kglobal.h>
 #include <kiconloader.h>
 #include <kmimetype.h>
-#include <klibloader.h>
+#include <klibrary.h>
 #include <kdebug.h>
 #include <kservice.h>
 #include <kservicetype.h>
--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/keyboard_applet.cpp #1195242:1195243
@@ -18,6 +18,7 @@
 
 #include "keyboard_applet.h"
 
+#include <kdebug.h>
 #include <kglobalsettings.h>
 #include <kiconloader.h>
 #include <plasma/theme.h>
--- trunk/KDE/kdebase/workspace/khotkeys/libkhotkeysprivate/khotkeysglobal.cpp #1195242:1195243
@@ -14,7 +14,6 @@
 
 #include <kdebug.h>
 #include <kstandarddirs.h>
-#include <klibloader.h>
 
 #include "input.h"
 #include "windows_handler.h"
--- trunk/KDE/kdebase/workspace/khotkeys/libkhotkeysprivate/soundrecorder.cpp #1195242:1195243
@@ -23,7 +23,7 @@
 #include <kdebug.h>
 #include <klocale.h>
 #include <QtCore/QTimer>
-#include <klibloader.h>
+#include <klibrary.h>
 
 #include "khotkeysglobal.h"
 
--- trunk/KDE/kdebase/workspace/kstyles/oxygen/config/oxygenconfigdialog.cpp #1195242:1195243
@@ -34,7 +34,7 @@
 #include <KConfigGroup>
 #include <KGlobalSettings>
 #include <KLocale>
-#include <KLibLoader>
+#include <KLibrary>
 #include <KPushButton>
 #include <KStandardShortcut>
 #include <KVBox>
@@ -175,10 +175,9 @@
     {
 
         // load decoration from plugin
-        KLibLoader* loader( KLibLoader::self() );
-        KLibrary* library = loader->library( "kstyle_oxygen_config" );
+        KLibrary* library = new KLibrary( "kstyle_oxygen_config" );
 
-        if (library != NULL)
+        if (library->load())
         {
             KLibrary::void_function_ptr alloc_ptr = library->resolveFunction("allocate_kstyle_config");
             if (alloc_ptr != NULL)
@@ -206,6 +205,7 @@
             }
 
         } else {
+            delete library;
 
             // fall back to warning label
             QLabel* label = new QLabel();
@@ -221,10 +221,9 @@
     {
 
         // load decoration from plugin
-        KLibLoader* loader( KLibLoader::self() );
-        KLibrary* library = loader->library( "kwin_oxygen_config" );
+        KLibrary* library = new KLibrary( "kwin_oxygen_config" );
 
-        if (library != NULL)
+        if (library->load())
         {
             KLibrary::void_function_ptr alloc_ptr = library->resolveFunction("allocate_config");
             if (alloc_ptr != NULL)
@@ -252,6 +251,7 @@
             }
 
         } else {
+            delete library;
 
             // fall back to warning label
             QLabel* label = new QLabel();
--- trunk/KDE/kdebase/workspace/kwin/lib/kdecoration_plugins_p.cpp #1195242:1195243
@@ -29,7 +29,7 @@
 #include <kconfig.h>
 #include <kdebug.h>
 #include <klocale.h>
-#include <klibloader.h>
+#include <klibrary.h>
 #include <kconfiggroup.h>
 #include <assert.h>
 
@@ -116,14 +116,16 @@
     KLibrary *oldLibrary = library;
     KDecorationFactory* oldFactory = fact;
 
-    QString path = KLibLoader::findLibrary(nameStr);
+    KLibrary libToFind(nameStr);
+    QString path = libToFind.fileName();
 	kDebug(1212) << "kwin : path " << path << " for " << nameStr;
 
     // If the plugin was not found, try to find the default
     if (path.isEmpty())
         {
         nameStr = defaultPlugin;
-        path = KLibLoader::findLibrary(nameStr);
+        KLibrary libToFind(nameStr);
+        path = libToFind.fileName();
         }
 
     // If no library was found, exit kwin with an error message
@@ -148,7 +150,8 @@
         nameStr = defaultPlugin;
 	if ( pluginStr == nameStr )
 	    return true;
-        path = KLibLoader::findLibrary(nameStr);
+        KLibrary libToFind(nameStr);
+        path = libToFind.fileName();
 	if (!path.isEmpty())
             library = new KLibrary(path);
         }
--- trunk/KDE/kdebase/workspace/libs/solid/control/managerbase.cpp #1195242:1195243
@@ -21,7 +21,6 @@
 
 #include <kservicetypetrader.h>
 #include <kservice.h>
-#include <klibloader.h>
 
 #include <klocale.h>
 #include <kdebug.h>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic