diff options
Diffstat (limited to 'noatun/library/pluginloader.cpp')
-rw-r--r-- | noatun/library/pluginloader.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/noatun/library/pluginloader.cpp b/noatun/library/pluginloader.cpp index c367228a..0897e76d 100644 --- a/noatun/library/pluginloader.cpp +++ b/noatun/library/pluginloader.cpp @@ -1,6 +1,6 @@ -#include <qfile.h> +#include <tqfile.h> #include <kglobal.h> -#include <qdir.h> +#include <tqdir.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <knotifyclient.h> @@ -22,10 +22,10 @@ LibraryLoader::LibraryLoader() : mPlaylist(0) LibraryLoader::~LibraryLoader() { - QValueList<NoatunLibraryInfo> l; + TQValueList<NoatunLibraryInfo> l; l = loaded(); - for(QValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) { if((*i).type != "userinterface" && (*i).type != "playlist" && (*i).type != "systray") { @@ -34,7 +34,7 @@ LibraryLoader::~LibraryLoader() } l = loaded(); - for(QValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) { if((*i).type == "userinterface") { @@ -43,26 +43,26 @@ LibraryLoader::~LibraryLoader() } l = loaded(); - for(QValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) { removeNow((*i).specfile); } } -QValueList<NoatunLibraryInfo> LibraryLoader::available() const +TQValueList<NoatunLibraryInfo> LibraryLoader::available() const { - QValueList<NoatunLibraryInfo> items; - QStringList files=KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); - for (QStringList::Iterator i=files.begin(); i!=files.end(); ++i) + TQValueList<NoatunLibraryInfo> items; + TQStringList files=KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); + for (TQStringList::Iterator i=files.begin(); i!=files.end(); ++i) items.append(getInfo(*i)); return items; } -QPtrList<Plugin> LibraryLoader::plugins() const +TQPtrList<Plugin> LibraryLoader::plugins() const { - QPtrList<Plugin> list; - for (QDictIterator<LibraryLoader::PluginLibrary> i(mLibHash); i.current(); ++i) + TQPtrList<Plugin> list; + for (TQDictIterator<LibraryLoader::PluginLibrary> i(mLibHash); i.current(); ++i) list.append(i.current()->plugin); return list; } @@ -71,14 +71,14 @@ bool LibraryLoader::loadAll() { KConfig *config=KGlobal::config(); config->setGroup(""); - QStringList modules = config->readListEntry("Modules"); + TQStringList modules = config->readListEntry("Modules"); return loadAll(modules); } -bool LibraryLoader::loadAll(const QStringList &modules) +bool LibraryLoader::loadAll(const TQStringList &modules) { // Session management... - for(QStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) + for(TQStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) { NoatunLibraryInfo info=getInfo(*i); if (!info.type.contains("sm")) @@ -87,7 +87,7 @@ bool LibraryLoader::loadAll(const QStringList &modules) } // load all the playlists in the first - for(QStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) + for(TQStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) { NoatunLibraryInfo info=getInfo(*i); if (!info.type.contains("playlist")) @@ -103,7 +103,7 @@ bool LibraryLoader::loadAll(const QStringList &modules) } // load all the user interfaces now - for(QStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) + for(TQStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) { NoatunLibraryInfo info=getInfo(*i); if (!info.type.contains("userinterface")) @@ -118,7 +118,7 @@ bool LibraryLoader::loadAll(const QStringList &modules) return false; } - for(QStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) + for(TQStringList::ConstIterator i=modules.begin(); i!=modules.end(); ++i) { NoatunLibraryInfo info=getInfo(*i); if((!info.type.contains("playlist")) @@ -132,11 +132,11 @@ bool LibraryLoader::loadAll(const QStringList &modules) return true; } -NoatunLibraryInfo LibraryLoader::getInfo(const QString &spec) const +NoatunLibraryInfo LibraryLoader::getInfo(const TQString &spec) const { NoatunLibraryInfo info; - QString specPath = (spec[0]=='/') ? spec : KGlobal::dirs()->findResource("appdata", spec); - if (!QFile::exists(specPath)) + TQString specPath = (spec[0]=='/') ? spec : KGlobal::dirs()->findResource("appdata", spec); + if (!TQFile::exists(specPath)) return info; KSimpleConfig file(specPath); if (spec.find('/')>=0) @@ -155,14 +155,14 @@ NoatunLibraryInfo LibraryLoader::getInfo(const QString &spec) const return info; } -bool LibraryLoader::isLoaded(const QString &spec) const +bool LibraryLoader::isLoaded(const TQString &spec) const { PluginLibrary *lib=mLibHash[spec]; if (!lib) return false; return lib->plugin; } -bool LibraryLoader::loadSO(const QString &spec) +bool LibraryLoader::loadSO(const TQString &spec) { if(!isLoaded(spec)) { @@ -170,7 +170,7 @@ bool LibraryLoader::loadSO(const QString &spec) if (info.specfile != spec) return false; - for (QStringList::ConstIterator it = info.require.begin(); it != info.require.end(); ++it) + for (TQStringList::ConstIterator it = info.require.begin(); it != info.require.end(); ++it) loadSO(*it); // get the library loader instance @@ -180,8 +180,8 @@ bool LibraryLoader::loadSO(const QString &spec) if (!listitem) { - QString filename = KGlobal::dirs()->findResource("module", info.filename); - KLibrary *lib = loader->library(QFile::encodeName(filename)); + TQString filename = KGlobal::dirs()->findResource("module", info.filename); + KLibrary *lib = loader->library(TQFile::encodeName(filename)); if (!lib) return false; listitem=new PluginLibrary; @@ -210,7 +210,7 @@ bool LibraryLoader::loadSO(const QString &spec) return false; } -void LibraryLoader::add(const QString &spec) +void LibraryLoader::add(const TQString &spec) { PluginLibrary *lib=mLibHash[spec]; if (lib) @@ -219,7 +219,7 @@ void LibraryLoader::add(const QString &spec) loadSO(spec); } -void LibraryLoader::setModules(const QStringList &mods) +void LibraryLoader::setModules(const TQStringList &mods) { KConfig *config=KGlobal::config(); config->setGroup(0); @@ -227,7 +227,7 @@ void LibraryLoader::setModules(const QStringList &mods) config->sync(); } -bool LibraryLoader::remove(const QString& spec, bool terminateOnLastUI) +bool LibraryLoader::remove(const TQString& spec, bool terminateOnLastUI) { bool SystrayPluginEnabled=false; @@ -235,10 +235,10 @@ bool LibraryLoader::remove(const QString& spec, bool terminateOnLastUI) // exit if this is the last UI if (info.type=="userinterface" && terminateOnLastUI) { - QValueList<NoatunLibraryInfo> l=loaded(); + TQValueList<NoatunLibraryInfo> l=loaded(); // Iterate over other plugins - for (QValueList<NoatunLibraryInfo>::Iterator i=l.begin(); i!=l.end(); ++i) + for (TQValueList<NoatunLibraryInfo>::Iterator i=l.begin(); i!=l.end(); ++i) { // Is this a UI plugin? if ((*i).specfile!=spec && (*i).type=="userinterface") @@ -275,7 +275,7 @@ bool LibraryLoader::remove(const QString& spec, bool terminateOnLastUI) return true; } -bool LibraryLoader::remove(const QString &spec) +bool LibraryLoader::remove(const TQString &spec) { remove(spec, true); return true; @@ -283,7 +283,7 @@ bool LibraryLoader::remove(const QString &spec) bool LibraryLoader::remove(const PluginLibrary *pl) { - for (QDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) + for (TQDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) { if (i.current()==pl) return remove(i.currentKey()); @@ -293,7 +293,7 @@ bool LibraryLoader::remove(const PluginLibrary *pl) bool LibraryLoader::remove(const Plugin *plugin) { - for (QDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) + for (TQDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) { if (i.current()->plugin==plugin) return remove(i.currentKey()); @@ -309,22 +309,22 @@ Playlist *LibraryLoader::playlist() const return mPlaylist; } -QValueList<NoatunLibraryInfo> LibraryLoader::loaded() const +TQValueList<NoatunLibraryInfo> LibraryLoader::loaded() const { - QValueList<NoatunLibraryInfo> items; + TQValueList<NoatunLibraryInfo> items; - for (QDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) + for (TQDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) if (isLoaded(i.currentKey())) items.append(getInfo(i.currentKey())); return items; } -QValueList<NoatunLibraryInfo> LibraryLoader::loadedByType(const QString &type) const +TQValueList<NoatunLibraryInfo> LibraryLoader::loadedByType(const TQString &type) const { - QValueList<NoatunLibraryInfo> items; + TQValueList<NoatunLibraryInfo> items; - for (QDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) + for (TQDictIterator<PluginLibrary> i(mLibHash); i.current(); ++i) { if (isLoaded(i.currentKey())) { @@ -337,15 +337,15 @@ QValueList<NoatunLibraryInfo> LibraryLoader::loadedByType(const QString &type) c return items; } -void LibraryLoader::removeNow(const QString &spec) +void LibraryLoader::removeNow(const TQString &spec) { NoatunLibraryInfo info = getInfo(spec); if (info.specfile == spec) { - QValueList<NoatunLibraryInfo> l = loaded(); - for (QValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) + TQValueList<NoatunLibraryInfo> l = loaded(); + for (TQValueList<NoatunLibraryInfo>::Iterator i = l.begin(); i != l.end(); ++i) { - for (QStringList::ConstIterator it = (*i).require.begin(); it != (*i).require.end(); ++it) + for (TQStringList::ConstIterator it = (*i).require.begin(); it != (*i).require.end(); ++it) { if (*it == spec) removeNow((*i).specfile); |