-rw-r--r-- | microkde/kdecore/klibloader.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index 130cc7c..c07d50f 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp @@ -17,33 +17,37 @@ Boston, MA 02111-1307, USA. */ //US #include <config.h> #include <qclipboard.h> #include <qfile.h> #include <qtimer.h> #include <qobjectdict.h> #include <qwidgetlist.h> #include <qwidget.h> #include "kapplication.h" #include "klibloader.h" #include "kstandarddirs.h" #include "kdebug.h" #include "klocale.h" -//US #include "ltdl.h" +/*US +#ifndef NDEBUG +#include "ltdl.h" +#endif +*/ //US do everything through qlibrary #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #include <qtopia/qlibrary.h> #endif /*US #ifdef Q_WS_X11 #include <X11/Xlib.h> #include <X11/Xatom.h> #endif */ template class QAsciiDict<KLibrary>; #include <stdlib.h> //getenv @@ -140,37 +144,40 @@ QString KLibrary::name() const { return m_libname; } QString KLibrary::fileName() const { return m_filename; } KLibFactory* KLibrary::factory() { if ( m_factory ) return m_factory; QCString symname; symname.sprintf("init_%s", name().latin1() ); - - void* sym = symbol( symname ); + + void* sym = symbol( symname ); if ( !sym ) { qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data()); +#ifndef NDEBUG +//US qDebug("KLibrary: errorcode: %s", lt_dlerror()); +#endif kdWarning(150) << "KLibrary: The library " << name().latin1() << " does not offer an init_" << name().latin1() << " function" << endl; return 0; } typedef KLibFactory* (*t_func)(); t_func func = (t_func)sym; m_factory = func(); if( !m_factory ) { kdWarning(150) << "KLibrary: The library " << name() << " does not offer a KDE compatible factory" << endl; return 0; } connect( m_factory, SIGNAL( objectCreated( QObject * ) ), this, SLOT( slotObjectCreated( QObject * ) ) ); @@ -394,36 +401,36 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta //US libfile = instance->dirs()->findResource( "module", libname ); libfile = KGlobal::dirs()->findResource( "module", libname ); if ( libfile.isEmpty() ) { //US libfile = instance->dirs()->findResource( "lib", libname ); libfile = KGlobal::dirs()->findResource( "lib", libname ); #ifndef NDEBUG if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; #endif } if ( libfile.isEmpty() ) { #ifndef NDEBUG kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; -#endif - self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); + self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); qDebug("KLibLoader::library could not find library: %s", libname.data()); +#endif } else self()->d->errorMessage = QString::null; } return libfile; } KLibrary* KLibLoader::globalLibrary( const char *name ) { KLibrary *tmp; /*US int olt_dlopen_flag = lt_dlopen_flag; lt_dlopen_flag |= LT_GLOBAL; |