diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
commit | 70b9eea2ba01c3691497f49e4c45cb070c16193c (patch) | |
tree | 9a6df61aa247a27275aad9c5245e419e89c2c640 /kradio3/src/kradioapp.cpp | |
parent | 998c1384ace4ae4655997c181fa33242148cd0a4 (diff) | |
download | tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.tar.gz tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.zip |
TQt4 port kradio
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/src/kradioapp.cpp')
-rw-r--r-- | kradio3/src/kradioapp.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/kradio3/src/kradioapp.cpp b/kradio3/src/kradioapp.cpp index 0f2dca6..6937bcf 100644 --- a/kradio3/src/kradioapp.cpp +++ b/kradio3/src/kradioapp.cpp @@ -85,7 +85,7 @@ AboutPageInfo KRadioAbout::createAboutPage () ///////////////////////////////////////////////////////////////////////////// //// PluginLibraryInfo -PluginLibraryInfo::PluginLibraryInfo (const QString &lib_name) +PluginLibraryInfo::PluginLibraryInfo (const TQString &lib_name) : library (NULL), init_func(NULL), info_func(NULL), @@ -104,7 +104,7 @@ PluginLibraryInfo::PluginLibraryInfo (const QString &lib_name) } else { KMessageBox::error(NULL, i18n("Library %1: Plugin Entry Point is missing\n") - .arg(lib_name), + .tqarg(lib_name), i18n("Plugin Library Load Error")); library->unload(); info_func = NULL; @@ -114,8 +114,8 @@ PluginLibraryInfo::PluginLibraryInfo (const QString &lib_name) } else { KMessageBox::error(NULL, i18n("Library %1: \n%2") - .arg(lib_name) - .arg(KLibLoader::self()->lastErrorMessage()), + .tqarg(lib_name) + .tqarg(KLibLoader::self()->lastErrorMessage()), i18n("Plugin Library Load Error")); } } @@ -129,7 +129,7 @@ KRadioApp::KRadioApp() m_quitting(false) { m_Instances.setAutoDelete(true); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(slotAboutToQuit())); + connect(this, TQT_SIGNAL(aboutToQuit()), this, TQT_SLOT(slotAboutToQuit())); } @@ -150,19 +150,19 @@ void KRadioApp::saveState (KConfig *c) c->writeEntry("instances", m_Instances.count()); int i = 0; - QDictIterator<PluginManager> it(m_Instances); + TQDictIterator<PluginManager> it(m_Instances); for (; it.current(); ++it, ++i) { c->setGroup("Global"); - c->writeEntry("instance_name_" + QString::number(i), it.currentKey()); + c->writeEntry("instance_name_" + TQString::number(i), it.currentKey()); it.current()->saveState(c); } c->setGroup("Plugin Libraries"); c->writeEntry("count", m_PluginLibraries.count()); int idx = 0; - QMapConstIterator<QString, PluginLibraryInfo> end = m_PluginLibraries.end(); - for (QMapConstIterator<QString, PluginLibraryInfo> it = m_PluginLibraries.begin(); it != end; ++it, ++idx) { - c->writeEntry("library_" + QString::number(idx), it.key()); + TQMapConstIterator<TQString, PluginLibraryInfo> end = m_PluginLibraries.end(); + for (TQMapConstIterator<TQString, PluginLibraryInfo> it = m_PluginLibraries.begin(); it != end; ++it, ++idx) { + c->writeEntry("library_" + TQString::number(idx), it.key()); } c->sync(); @@ -179,12 +179,12 @@ void KRadioApp::restoreState (KConfig *c) // KProgressDialog *progress = new KProgressDialog(NULL, NULL, i18n("Loading Plugin Libraries")); // progress->setMinimumWidth(400); // progress->setAllowCancel(false); -// progress->QWidget::setCaption(i18n("KRadio - Loading Plugin Libraries")); +// progress->TQWidget::setCaption(i18n("KRadio - Loading Plugin Libraries")); // progress->show(); /* progress->progressBar()->setTotalSteps(n_libs);*/ for (int idx = 0; idx < n_libs; ++idx) { - QString lib = c->readEntry("library_" + QString::number(idx), QString::null); + TQString lib = c->readEntry("library_" + TQString::number(idx), TQString()); if (lib.length()) { LoadLibrary(lib); // progress->progressBar()->setProgress(idx+1); @@ -192,12 +192,12 @@ void KRadioApp::restoreState (KConfig *c) } if (n_libs < 6) { // this seems to be a meaningful minimum value for a working kradio setup - QStringList libs + TQStringList libs = KGlobal::dirs()->findAllResources("lib", "kradio/plugins/*.so"); - QValueListIterator<QString> end = libs.end(); + TQValueListIterator<TQString> end = libs.end(); int idx = 0; // progress->progressBar()->setTotalSteps(libs.count()); - for (QValueListIterator<QString> it = libs.begin(); it != end; ++it, ++idx) { + for (TQValueListIterator<TQString> it = libs.begin(); it != end; ++it, ++idx) { LoadLibrary(*it); // progress->progressBar()->setProgress(idx+1); } @@ -217,20 +217,20 @@ void KRadioApp::restoreState (KConfig *c) for (int i = 0; i < n; ++i) { c->setGroup("Global"); - QString name = c->readEntry("instance_name_" + QString::number(i), - n > 1 ? (i18n("Instance") + " " + QString::number(i+1)) : QString("")); + TQString name = c->readEntry("instance_name_" + TQString::number(i), + n > 1 ? (i18n("Instance") + " " + TQString::number(i+1)) : TQString("")); createNewInstance(name)->restoreState(c); } } -PluginManager *KRadioApp::createNewInstance(const QString &_name) +PluginManager *KRadioApp::createNewInstance(const TQString &_name) { BlockProfiler profiler("KRadioApp::createNewInstance"); - QString instance_name = _name; - QString title_ext = ""; - QString id = QString::number(m_Instances.count()+1); + TQString instance_name = _name; + TQString title_ext = ""; + TQString id = TQString::number(m_Instances.count()+1); if (instance_name.length() == 0) { instance_name = "Instance " + id; } @@ -253,7 +253,7 @@ PluginManager *KRadioApp::createNewInstance(const QString &_name) } -KLibrary *KRadioApp::LoadLibrary (const QString &library) +KLibrary *KRadioApp::LoadLibrary (const TQString &library) { BlockProfiler profiler("KRadioApp::LoadLibrary"); BlockProfiler libprofiler("KRadioApp::LoadLibrary - " + library); @@ -261,19 +261,19 @@ KLibrary *KRadioApp::LoadLibrary (const QString &library) PluginLibraryInfo libinfo(library); if (libinfo.valid()) { m_PluginLibraries.insert(library, libinfo); - QMapConstIterator<QString,QString> end = libinfo.plugins.end(); - for (QMapConstIterator<QString,QString> it = libinfo.plugins.begin(); it != end; ++it) { + TQMapConstIterator<TQString,TQString> end = libinfo.plugins.end(); + for (TQMapConstIterator<TQString,TQString> it = libinfo.plugins.begin(); it != end; ++it) { m_PluginInfos.insert(it.key(), PluginClassInfo (it.key(), *it, libinfo.init_func)); } } else { - kdDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) + kdDebug() << TQDateTime::tqcurrentDateTime().toString(Qt::ISODate) << " " << i18n("Error: Loading Library %1 failed: %2") - .arg(library).arg(KLibLoader::self()->lastErrorMessage()) + .tqarg(library).tqarg(KLibLoader::self()->lastErrorMessage()) << endl; } - for (QDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { + for (TQDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { it_managers.current()->noticeLibrariesChanged(); } @@ -281,16 +281,16 @@ KLibrary *KRadioApp::LoadLibrary (const QString &library) } -void KRadioApp::UnloadLibrary (const QString &library) +void KRadioApp::UnloadLibrary (const TQString &library) { - if (!m_PluginLibraries.contains(library)) + if (!m_PluginLibraries.tqcontains(library)) return; PluginLibraryInfo info = m_PluginLibraries[library]; - QMapConstIterator<QString, QString> end_classes = info.plugins.end(); - for (QMapConstIterator<QString, QString> it_classes = info.plugins.begin(); it_classes != end_classes; ++it_classes) { - for (QDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { + TQMapConstIterator<TQString, TQString> end_classes = info.plugins.end(); + for (TQMapConstIterator<TQString, TQString> it_classes = info.plugins.begin(); it_classes != end_classes; ++it_classes) { + for (TQDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { it_managers.current()->unloadPlugins(it_classes.key()); } m_PluginInfos.remove(it_classes.key()); @@ -300,13 +300,13 @@ void KRadioApp::UnloadLibrary (const QString &library) info.libunload_func(); info.library->unload(); - for (QDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { + for (TQDictIterator<PluginManager> it_managers(m_Instances); it_managers.current(); ++it_managers) { it_managers.current()->noticeLibrariesChanged(); } } -PluginBase *KRadioApp::CreatePlugin (PluginManager *manager, const QString &class_name, const QString &object_name) +PluginBase *KRadioApp::CreatePlugin (PluginManager *manager, const TQString &class_name, const TQString &object_name) { BlockProfiler all_profiler ("KRadioApp::CreatePlugin"); BlockProfiler class_profiler("KRadioApp::CreatePlugin - " + class_name); @@ -314,18 +314,18 @@ PluginBase *KRadioApp::CreatePlugin (PluginManager *manager, const QString &clas BlockProfiler create_profiler("KRadioApp::CreatePlugin - create"); PluginBase *retval = NULL; - if (m_PluginInfos.contains(class_name)) { + if (m_PluginInfos.tqcontains(class_name)) { retval = m_PluginInfos[class_name].CreateInstance(object_name); if (!retval) { - kdDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) + kdDebug() << TQDateTime::tqcurrentDateTime().toString(Qt::ISODate) << " " - << i18n("Error: Creation of instance \"%1\" of class %2 falied.").arg(object_name).arg(class_name) + << i18n("Error: Creation of instance \"%1\" of class %2 falied.").tqarg(object_name).tqarg(class_name) << endl; } } else { - kdDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) + kdDebug() << TQDateTime::tqcurrentDateTime().toString(Qt::ISODate) << " " - << i18n("Error: Cannot create instance \"%1\" of unknown class %2.").arg(object_name).arg(class_name) + << i18n("Error: Cannot create instance \"%1\" of unknown class %2.").tqarg(object_name).tqarg(class_name) << endl; } @@ -346,7 +346,7 @@ PluginBase *KRadioApp::CreatePlugin (PluginManager *manager, const QString &clas void KRadioApp::startPlugins() { - QDictIterator<PluginManager> it(m_Instances); + TQDictIterator<PluginManager> it(m_Instances); for (; it.current(); ++it) { it.current()->startPlugins(); } @@ -359,7 +359,7 @@ void KRadioApp::slotAboutToQuit() IErrorLogClient::staticLogDebug("slotAboutToQuit, m_quitting = false"); m_quitting = true; saveState(); - QDictIterator<PluginManager> it(m_Instances); + TQDictIterator<PluginManager> it(m_Instances); for (; it.current(); ++it) { it.current()->aboutToQuit(); } |