From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/library/pluginloader.cpp | 90 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'noatun/library/pluginloader.cpp') 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 +#include #include -#include +#include #include #include #include @@ -22,10 +22,10 @@ LibraryLoader::LibraryLoader() : mPlaylist(0) LibraryLoader::~LibraryLoader() { - QValueList l; + TQValueList l; l = loaded(); - for(QValueList::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList::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::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList::Iterator i = l.begin(); i != l.end(); ++i) { if((*i).type == "userinterface") { @@ -43,26 +43,26 @@ LibraryLoader::~LibraryLoader() } l = loaded(); - for(QValueList::Iterator i = l.begin(); i != l.end(); ++i) + for(TQValueList::Iterator i = l.begin(); i != l.end(); ++i) { removeNow((*i).specfile); } } -QValueList LibraryLoader::available() const +TQValueList LibraryLoader::available() const { - QValueList items; - QStringList files=KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); - for (QStringList::Iterator i=files.begin(); i!=files.end(); ++i) + TQValueList 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 LibraryLoader::plugins() const +TQPtrList LibraryLoader::plugins() const { - QPtrList list; - for (QDictIterator i(mLibHash); i.current(); ++i) + TQPtrList list; + for (TQDictIterator 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 l=loaded(); + TQValueList l=loaded(); // Iterate over other plugins - for (QValueList::Iterator i=l.begin(); i!=l.end(); ++i) + for (TQValueList::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 i(mLibHash); i.current(); ++i) + for (TQDictIterator 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 i(mLibHash); i.current(); ++i) + for (TQDictIterator 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 LibraryLoader::loaded() const +TQValueList LibraryLoader::loaded() const { - QValueList items; + TQValueList items; - for (QDictIterator i(mLibHash); i.current(); ++i) + for (TQDictIterator i(mLibHash); i.current(); ++i) if (isLoaded(i.currentKey())) items.append(getInfo(i.currentKey())); return items; } -QValueList LibraryLoader::loadedByType(const QString &type) const +TQValueList LibraryLoader::loadedByType(const TQString &type) const { - QValueList items; + TQValueList items; - for (QDictIterator i(mLibHash); i.current(); ++i) + for (TQDictIterator i(mLibHash); i.current(); ++i) { if (isLoaded(i.currentKey())) { @@ -337,15 +337,15 @@ QValueList 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 l = loaded(); - for (QValueList::Iterator i = l.begin(); i != l.end(); ++i) + TQValueList l = loaded(); + for (TQValueList::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); -- cgit v1.2.1