[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Tue May 13 18:03:34 CEST 2003
CVS commit by staikos:
extract the symbol from the plugin
M +3 -0 plugin.cpp 1.6
M +2 -0 plugin.h 1.6
M +10 -0 pluginloader.cpp 1.5
--- kdeextragear-2/kst/kst/plugin.cpp #1.5:1.6
@@ -24,8 +24,11 @@
Plugin::Plugin() {
_lib = 0L;
+ _symbol = 0L;
}
Plugin::~Plugin() {
+ _symbol = 0L;
+
if (_lib) {
_lib->unload(); // this deletes it too
--- kdeextragear-2/kst/kst/plugin.h #1.5:1.6
@@ -99,4 +99,6 @@ protected:
KLibrary *_lib;
+ void *_symbol;
+
// Related files
QString _xmlFile, _soFile;
--- kdeextragear-2/kst/kst/pluginloader.cpp #1.4:1.5
@@ -53,4 +53,5 @@ Plugin *PluginLoader::loadPlugin(const Q
// First try to load the XML file.
if (_parser->parseFile(xmlfile) != 0) {
+ kdDebug() << "Couldn't parse xml file " << xmlfile << "." << endl;
return 0L;
}
@@ -63,4 +64,13 @@ Plugin *PluginLoader::loadPlugin(const Q
plug->_lib = KLibLoader::self()->library(object.local8Bit().data());
if (!plug->_lib) {
+ kdDebug() << "Couldn't find library " << object << "." << endl;
+ delete plug;
+ return 0L;
+ }
+
+ plug->_symbol = plug->_lib->symbol(plug->_data._name.latin1());
+
+ if (!plug->_symbol) {
+ kdDebug() << "Couldn't find symbol " << plug->_data._name << " in plugin." << endl;
delete plug;
return 0L;
More information about the Kst
mailing list