summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/klibloader.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdecore/klibloader.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/klibloader.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp
index 6d0475a..0b54eb6 100644
--- a/microkde/kdecore/klibloader.cpp
+++ b/microkde/kdecore/klibloader.cpp
@@ -17,15 +17,18 @@
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 <q3objectdict.h>
#include <qwidget.h>
+#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3PtrList>
#include "kapplication.h"
#include "klibloader.h"
#include "kstandarddirs.h"
#include "kdebug.h"
#include "klocale.h"
@@ -42,13 +45,13 @@
#include <qtopia/qlibrary.h>
#else
#include <qlibrary.h>
#endif
-template class QAsciiDict<KLibrary>;
+template class Q3AsciiDict<KLibrary>;
#include <stdlib.h> //getenv
/*US
#if HAVE_DLFCN_H
# include <dlfcn.h>
@@ -117,13 +120,13 @@ KLibrary::~KLibrary()
if ( m_timer && m_timer->isActive() )
m_timer->stop();
// If any object is remaining, delete
if ( m_objs.count() > 0 )
{
- QPtrListIterator<QObject> it( m_objs );
+ Q3PtrListIterator<QObject> it( m_objs );
for ( ; it.current() ; ++it )
{
kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl;
disconnect( it.current(), SIGNAL( destroyed() ),
this, SLOT( slotObjectDestroyed() ) );
}
@@ -149,13 +152,13 @@ QString KLibrary::fileName() const
KLibFactory* KLibrary::factory()
{
if ( m_factory )
return m_factory;
- QCString symname;
+ Q3CString symname;
symname.sprintf("init_%s", name().latin1() );
void* sym = symbol( symname );
if ( !sym )
{
qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data());
@@ -302,14 +305,14 @@ KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h)
}
}
class KLibLoaderPrivate
{
public:
- QPtrList<KLibWrapPrivate> loaded_stack;
- QPtrList<KLibWrapPrivate> pending_close;
+ Q3PtrList<KLibWrapPrivate> loaded_stack;
+ Q3PtrList<KLibWrapPrivate> pending_close;
enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
QString errorMessage;
};
KLibLoader* KLibLoader::s_self = 0;
@@ -345,13 +348,13 @@ KLibLoader::KLibLoader( QObject* parent, const char* name )
}
KLibLoader::~KLibLoader()
{
// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl;
- QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+ Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
for (; it.current(); ++it )
{
kdDebug(150) << "The KLibLoader contains the library " << it.current()->name
<< " (" << it.current()->lib << ")" << endl;
d->pending_close.append(it.current());
}
@@ -361,13 +364,13 @@ KLibLoader::~KLibLoader()
delete d;
}
//static
QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ )
{
- QCString libname( name );
+ Q3CString libname( name );
// only append ".la" if there is no extension
// this allows to load non-libtool libraries as well
// (mhk, 20000228)
int pos = libname.findRev('/');
if (pos < 0)
@@ -418,13 +421,13 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta
#endif
}
if ( libfile.isEmpty() )
{
#ifndef NDEBUG
kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
- 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(QString(libname));
qDebug("KLibLoader::library could not find library: %s", libname.data());
#endif
}
else
@@ -466,13 +469,13 @@ KLibrary* KLibLoader::library( const char *name )
wrap->ref_count++;
return wrap->lib;
}
/* Test if this library was loaded at some time, but got
unloaded meanwhile, whithout being dlclose()'ed. */
- QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
+ Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
for (; it.current(); ++it) {
if (it.current()->name == name)
wrap = it.current();
}
if (wrap) {
@@ -547,13 +550,13 @@ KLibFactory* KLibLoader::factory( const char* name )
}
void KLibLoader::slotLibraryDestroyed()
{
const KLibrary *lib = static_cast<const KLibrary *>( sender() );
- QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+ Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs );
for (; it.current(); ++it )
if ( it.current()->lib == lib )
{
KLibWrapPrivate *wrap = it.current();
wrap->lib = 0; /* the KLibrary object is already away */
m_libs.remove( it.currentKey() );
@@ -566,13 +569,13 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap)
{
if (wrap && !d->pending_close.containsRef( wrap ))
d->pending_close.append( wrap );
/* First delete all KLibrary objects in pending_close, but _don't_ unload
the DSO behind it. */
- QPtrListIterator<KLibWrapPrivate> it(d->pending_close);
+ Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close);
for (; it.current(); ++it) {
wrap = it.current();
if (wrap->lib) {
disconnect( wrap->lib, SIGNAL( destroyed() ),
this, SLOT( slotLibraryDestroyed() ) );
delete wrap->lib;