diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /lib/util/kscriptactionmanager.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/util/kscriptactionmanager.cpp')
-rw-r--r-- | lib/util/kscriptactionmanager.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/util/kscriptactionmanager.cpp b/lib/util/kscriptactionmanager.cpp index b06a9edf..ffc3a536 100644 --- a/lib/util/kscriptactionmanager.cpp +++ b/lib/util/kscriptactionmanager.cpp @@ -29,11 +29,11 @@ #include <kdebug.h> #include <scriptinterface.h> #include <kaction.h> -#include <qfileinfo.h> -#include <qtimer.h> +#include <tqfileinfo.h> +#include <tqtimer.h> -KScriptAction::KScriptAction( const QString &scriptDesktopFile, QObject *interface, KActionCollection *ac ) - : QObject(interface), KScriptClientInterface( ) +KScriptAction::KScriptAction( const TQString &scriptDesktopFile, TQObject *interface, KActionCollection *ac ) + : TQObject(interface), KScriptClientInterface( ) { m_interface = 0L; m_action = 0L; @@ -43,24 +43,24 @@ KScriptAction::KScriptAction( const QString &scriptDesktopFile, QObject *interfa if(KDesktopFile::isDesktopFile(scriptDesktopFile)) { KDesktopFile desktop(scriptDesktopFile, true); - QFileInfo scriptPath(scriptDesktopFile); + TQFileInfo scriptPath(scriptDesktopFile); m_scriptFile = scriptPath.dirPath(true) + "/" + desktop.readEntry("X-KDE-ScriptName", ""); m_scriptName = desktop.readName(); m_scriptType = desktop.readType(); - QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')"; + TQString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')"; KTrader::OfferList offers = KTrader::self()->query( "KScriptRunner/KScriptRunner", scriptTypeQuery ); if ( !offers.isEmpty() ) { - m_action = new KAction(m_scriptName, KShortcut(), this, SLOT(activate()), ac, "script"); + m_action = new KAction(m_scriptName, KShortcut(), this, TQT_SLOT(activate()), ac, "script"); m_isValid = true; - m_timeout = new QTimer(this); - QString icon = desktop.readIcon(); + m_timeout = new TQTimer(this); + TQString icon = desktop.readIcon(); m_action->setStatusText(desktop.readComment()); if( !icon.isEmpty() ) m_action->setIcon(icon); m_action->setShortcutConfigurable(true); - connect( m_timeout, SIGNAL(timeout()), SLOT(cleanup()) ); + connect( m_timeout, TQT_SIGNAL(timeout()), TQT_SLOT(cleanup()) ); } } } @@ -82,7 +82,7 @@ void KScriptAction::activate( ) { if( m_interface == 0L) { - QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')"; + TQString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')"; m_interface= KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>( "KScriptRunner/KScriptRunner", scriptTypeQuery, this ); if ( m_interface != 0L) { @@ -91,7 +91,7 @@ void KScriptAction::activate( ) m_interface->setScript(m_scriptFile); else m_interface->setScript(m_scriptFile, m_scriptMethod); - connect(this, SIGNAL(done(KScriptClientInterface::Result, const QVariant &)), this, SLOT(scriptFinished())); + connect(this, TQT_SIGNAL(done(KScriptClientInterface::Result, const TQVariant &)), this, TQT_SLOT(scriptFinished())); } else { @@ -100,7 +100,7 @@ void KScriptAction::activate( ) return; } } - m_interface->run(parent(), QVariant()); + m_interface->run(parent(), TQVariant()); m_timeout->start(60000,FALSE); // after 1 minute unload m_refs++; } @@ -119,7 +119,7 @@ void KScriptAction::scriptFinished() m_refs--; } -KScriptActionManager::KScriptActionManager( QObject *parent, KActionCollection * ac ) : QObject(parent), m_ac(ac) +KScriptActionManager::KScriptActionManager( TQObject *parent, KActionCollection * ac ) : TQObject(parent), m_ac(ac) { m_actions.setAutoDelete(true); } @@ -129,22 +129,22 @@ KScriptActionManager::~ KScriptActionManager( ) m_actions.clear(); } -QPtrList< KAction > KScriptActionManager::scripts( QObject * interface , const QStringList &dirs) const +TQPtrList< KAction > KScriptActionManager::scripts( TQObject * interface , const TQStringList &dirs) const { m_actions.clear(); - QPtrList<KAction> actions; - QStringList scripts; + TQPtrList<KAction> actions; + TQStringList scripts; scripts += KGlobal::dirs()->findAllResources("data", - QString(kapp->name())+"/scripts/*.desktop", false, true ); + TQString(kapp->name())+"/scripts/*.desktop", false, true ); - for( QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) + for( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) { scripts += KGlobal::dirs()->findAllResources("data", (*it)+"/*.desktop", false, true ); } - for (QStringList::Iterator it = scripts.begin(); it != scripts.end(); ++it ) + for (TQStringList::Iterator it = scripts.begin(); it != scripts.end(); ++it ) { kdDebug() << "Loading " << *it << endl; KScriptAction *script = new KScriptAction(*it, interface, m_ac); @@ -152,16 +152,16 @@ QPtrList< KAction > KScriptActionManager::scripts( QObject * interface , const Q { actions.append(script->action()); m_actions.append(script); - connect(script, SIGNAL(error( const QString&)), this, - SIGNAL(scriptError( const QString&))); - connect(script, SIGNAL(warning( const QString&)), this, - SIGNAL(scriptWarning( const QString&))); - connect(script, SIGNAL(output( const QString&)), this, - SIGNAL(scriptOutput( const QString&))); - connect(script, SIGNAL(progress( int )), this, - SIGNAL(scriptProgress(int))); - connect(script, SIGNAL(done( KScriptClientInterface::Result, const QVariant &)),this, - SIGNAL(scriptDone( KScriptClientInterface::Result, const QVariant &))); + connect(script, TQT_SIGNAL(error( const TQString&)), this, + TQT_SIGNAL(scriptError( const TQString&))); + connect(script, TQT_SIGNAL(warning( const TQString&)), this, + TQT_SIGNAL(scriptWarning( const TQString&))); + connect(script, TQT_SIGNAL(output( const TQString&)), this, + TQT_SIGNAL(scriptOutput( const TQString&))); + connect(script, TQT_SIGNAL(progress( int )), this, + TQT_SIGNAL(scriptProgress(int))); + connect(script, TQT_SIGNAL(done( KScriptClientInterface::Result, const TQVariant &)),this, + TQT_SIGNAL(scriptDone( KScriptClientInterface::Result, const TQVariant &))); } else delete script; |