diff options
Diffstat (limited to 'konq-plugins/sidebar/metabar/src/serviceloader.cpp')
-rw-r--r-- | konq-plugins/sidebar/metabar/src/serviceloader.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/konq-plugins/sidebar/metabar/src/serviceloader.cpp b/konq-plugins/sidebar/metabar/src/serviceloader.cpp index 7e3e60d..1b59527 100644 --- a/konq-plugins/sidebar/metabar/src/serviceloader.cpp +++ b/konq-plugins/sidebar/metabar/src/serviceloader.cpp @@ -20,9 +20,9 @@ #include "serviceloader.h" -#include <qdir.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqdir.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include <dcopclient.h> @@ -37,7 +37,7 @@ #include <kstandarddirs.h> -ServiceLoader::ServiceLoader(QWidget *parent, const char *name) : QObject(parent, name) +ServiceLoader::ServiceLoader(TQWidget *parent, const char *name) : TQObject(parent, name) { popups.setAutoDelete(true); } @@ -51,40 +51,40 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int popups.clear(); KURL url = item.url(); - QString mimeType = item.mimetype(); - QString mimeGroup = mimeType.left(mimeType.find('/')); + TQString mimeType = item.mimetype(); + TQString mimeGroup = mimeType.left(mimeType.find('/')); urlList.clear(); urlList.append(url); - QStringList dirs = KGlobal::dirs()->findDirs( "data", "konqueror/servicemenus/" ); + TQStringList dirs = KGlobal::dirs()->findDirs( "data", "konqueror/servicemenus/" ); KConfig config("metabarrc", true, false); config.setGroup("General"); int maxActions = config.readNumEntry("MaxActions"); bool matchAll = false; // config.readBoolEntry("MatchAll"); int id = 0; - QString idString; + TQString idString; - for(QStringList::Iterator dit = dirs.begin(); dit != dirs.end(); ++dit){ + for(TQStringList::Iterator dit = dirs.begin(); dit != dirs.end(); ++dit){ idString.setNum(id); - QDir dir(*dit); - QStringList entries = dir.entryList("*.desktop", QDir::Files); + TQDir dir(*dit); + TQStringList entries = dir.entryList("*.desktop", TQDir::Files); - for(QStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit){ + for(TQStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit){ KSimpleConfig cfg( *dit + *eit, true ); cfg.setDesktopGroup(); if(cfg.hasKey("X-KDE-ShowIfRunning" )){ - const QString app = cfg.readEntry( "X-KDE-ShowIfRunning" ); + const TQString app = cfg.readEntry( "X-KDE-ShowIfRunning" ); if(!kapp->dcopClient()->isApplicationRegistered(app.utf8())){ continue; } } if(cfg.hasKey("X-KDE-Protocol")){ - const QString protocol = cfg.readEntry( "X-KDE-Protocol" ); + const TQString protocol = cfg.readEntry( "X-KDE-Protocol" ); if(protocol != url.protocol()){ continue; } @@ -95,18 +95,18 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int } if(cfg.hasKey("X-KDE-Require")){ - const QStringList capabilities = cfg.readListEntry( "X-KDE-Require" ); + const TQStringList capabilities = cfg.readListEntry( "X-KDE-Require" ); if (capabilities.contains( "Write" )){ continue; } } if ( cfg.hasKey( "Actions" ) && cfg.hasKey( "ServiceTypes" ) ){ - const QStringList types = cfg.readListEntry( "ServiceTypes" ); - const QStringList excludeTypes = cfg.readListEntry( "ExcludeServiceTypes" ); + const TQStringList types = cfg.readListEntry( "ServiceTypes" ); + const TQStringList excludeTypes = cfg.readListEntry( "ExcludeServiceTypes" ); bool ok = false; - for (QStringList::ConstIterator it = types.begin(); it != types.end() && !ok; ++it){ + for (TQStringList::ConstIterator it = types.begin(); it != types.end() && !ok; ++it){ bool checkTheMimetypes = false; if(matchAll){ @@ -131,7 +131,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int if(checkTheMimetypes){ ok = true; - for(QStringList::ConstIterator itex = excludeTypes.begin(); itex != excludeTypes.end(); ++itex){ + for(TQStringList::ConstIterator itex = excludeTypes.begin(); itex != excludeTypes.end(); ++itex){ if( ((*itex).right(1) == "*" && (*itex).left((*itex).find('/')) == mimeGroup) || ((*itex) == mimeType)) { @@ -142,8 +142,8 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int } } if (ok){ - const QString priority = cfg.readEntry("X-KDE-Priority"); - const QString submenuName = cfg.readEntry( "X-KDE-Submenu" ); + const TQString priority = cfg.readEntry("X-KDE-Priority"); + const TQString submenuName = cfg.readEntry( "X-KDE-Submenu" ); bool usePopup = false; KPopupMenu *popup; @@ -154,7 +154,7 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int popup = popups[submenuName]; } else{ - MetabarWidget::addEntry(html, submenuName, "servicepopup://" + idString, "1rightarrow", "popup" + idString, count < maxActions ? QString::null : QString("hiddenaction"), count >= maxActions); + MetabarWidget::addEntry(html, submenuName, "servicepopup://" + idString, "1rightarrow", "popup" + idString, count < maxActions ? TQString::null : TQString("hiddenaction"), count >= maxActions); popup = new KPopupMenu(); popups.insert(idString, popup); @@ -163,16 +163,16 @@ void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int } } - QValueList<KDEDesktopMimeType::Service> list = KDEDesktopMimeType::userDefinedServices( *dit + *eit, url.isLocalFile()); + TQValueList<KDEDesktopMimeType::Service> list = KDEDesktopMimeType::userDefinedServices( *dit + *eit, url.isLocalFile()); - for (QValueList<KDEDesktopMimeType::Service>::iterator it = list.begin(); it != list.end(); ++it){ + for (TQValueList<KDEDesktopMimeType::Service>::iterator it = list.begin(); it != list.end(); ++it){ if(usePopup){ - KAction *action = new KAction((*it).m_strName, (*it).m_strIcon, KShortcut(), this, SLOT(runAction()), popup, idString.utf8()); + KAction *action = new KAction((*it).m_strName, (*it).m_strIcon, KShortcut(), this, TQT_SLOT(runAction()), popup, idString.utf8()); action->plug(popup); } else{ - MetabarWidget::addEntry(html, (*it).m_strName, "service://" + idString, (*it).m_strIcon, QString::null, count < maxActions ? QString::null : QString("hiddenaction"), count >= maxActions); + MetabarWidget::addEntry(html, (*it).m_strName, "service://" + idString, (*it).m_strIcon, TQString::null, count < maxActions ? TQString::null : TQString("hiddenaction"), count >= maxActions); count++; } @@ -194,7 +194,7 @@ void ServiceLoader::runAction() } } -void ServiceLoader::runAction(const QString& name) +void ServiceLoader::runAction(const TQString& name) { KDEDesktopMimeType::Service s = services[name]; if(!s.isEmpty()){ @@ -202,7 +202,7 @@ void ServiceLoader::runAction(const QString& name) } } -void ServiceLoader::showPopup(const QString &popup, const QPoint &point) +void ServiceLoader::showPopup(const TQString &popup, const TQPoint &point) { KPopupMenu *p = popups[popup]; if(p){ |