diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /interfaces/kscript | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'interfaces/kscript')
-rw-r--r-- | interfaces/kscript/sample/shellscript.cpp | 16 | ||||
-rw-r--r-- | interfaces/kscript/sample/shellscript.h | 16 | ||||
-rw-r--r-- | interfaces/kscript/scriptclientinterface.h | 24 | ||||
-rw-r--r-- | interfaces/kscript/scriptinterface.h | 14 | ||||
-rw-r--r-- | interfaces/kscript/scriptloader.cpp | 18 | ||||
-rw-r--r-- | interfaces/kscript/scriptloader.h | 8 | ||||
-rw-r--r-- | interfaces/kscript/scriptmanager.cpp | 34 | ||||
-rw-r--r-- | interfaces/kscript/scriptmanager.h | 44 |
8 files changed, 87 insertions, 87 deletions
diff --git a/interfaces/kscript/sample/shellscript.cpp b/interfaces/kscript/sample/shellscript.cpp index 4e3062eb2..49aee0727 100644 --- a/interfaces/kscript/sample/shellscript.cpp +++ b/interfaces/kscript/sample/shellscript.cpp @@ -28,12 +28,12 @@ typedef KGenericFactory<ShellScript, KScriptClientInterface> ShellScriptFactory; K_EXPORT_COMPONENT_FACTORY( libshellscript, ShellScriptFactory( "ShellScript" ) ) -ShellScript::ShellScript(KScriptClientInterface *parent, const char *, const QStringList & ) : ScriptClientInterface(parent) +ShellScript::ShellScript(KScriptClientInterface *parent, const char *, const TQStringList & ) : ScriptClientInterface(parent) { m_script = new KProcess(); - connect ( m_script, SIGNAL(processExited(KProcess *)), SLOT(Exit(KProcess *))); - connect ( m_script, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(stdOut(KProcess *, char *, int ))); - connect ( m_script, SIGNAL(receivedStderr(KProcess *, char *, int)), SLOT(stdErr(KProcess *, char *, int ))); + connect ( m_script, TQT_SIGNAL(processExited(KProcess *)), TQT_SLOT(Exit(KProcess *))); + connect ( m_script, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), TQT_SLOT(stdOut(KProcess *, char *, int ))); + connect ( m_script, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), TQT_SLOT(stdErr(KProcess *, char *, int ))); // Connect feedback signals and slots //kdDebug() << "Building new script engine" << endl; } @@ -42,23 +42,23 @@ ShellScript::~ShellScript() { } -QString ShellScript::script() const +TQString ShellScript::script() const { return m_scriptName; } -void ShellScript::setScript( const QString &scriptFile ) +void ShellScript::setScript( const TQString &scriptFile ) { m_scriptName = scriptFile; *m_script << "sh" << m_scriptName << kapp->dcopClient()->appId(); } -void ShellScript::setScript( const QString &, const QString & ) +void ShellScript::setScript( const TQString &, const TQString & ) { // ### what is this? } -void ShellScript::run(QObject *, const QVariant &) +void ShellScript::run(TQObject *, const TQVariant &) { m_script->start(KProcess::NotifyOnExit,KProcess::All); } diff --git a/interfaces/kscript/sample/shellscript.h b/interfaces/kscript/sample/shellscript.h index c6bdc3c38..853a7bd12 100644 --- a/interfaces/kscript/sample/shellscript.h +++ b/interfaces/kscript/sample/shellscript.h @@ -20,20 +20,20 @@ #define __shellscript_h__ #include <scriptinterface.h> -#include <qvariant.h> -#include <qobject.h> +#include <tqvariant.h> +#include <tqobject.h> #include <kprocess.h> //using namespace KScriptInterface; class ShellScript : public KScriptInterface { Q_OBJECT public: - ShellScript(KScriptClientInterface *parent, const char *name, const QStringList &args); + ShellScript(KScriptClientInterface *parent, const char *name, const TQStringList &args); virtual ~ShellScript(); - QString script() const; - void setScript( const QString &scriptFile ); - void setScript( const QString &scriptLibFile, const QString &method ); - void run(QObject *context = 0, const QVariant &arg = 0); + TQString script() const; + void setScript( const TQString &scriptFile ); + void setScript( const TQString &scriptLibFile, const TQString &method ); + void run(TQObject *context = 0, const TQVariant &arg = 0); void kill(); private slots: void Exit(KProcess *proc); @@ -42,7 +42,7 @@ private slots: private: KProcess *m_script; KScriptClientInterface *ScriptClientInterface; - QString m_scriptName; + TQString m_scriptName; }; #endif diff --git a/interfaces/kscript/scriptclientinterface.h b/interfaces/kscript/scriptclientinterface.h index adeaa6424..ae5672a35 100644 --- a/interfaces/kscript/scriptclientinterface.h +++ b/interfaces/kscript/scriptclientinterface.h @@ -18,7 +18,7 @@ */ #ifndef __scriptclientinterface_h__ #define __scriptclientinterface_h__ -#include <qvariant.h> +#include <tqvariant.h> class QString; @@ -32,11 +32,11 @@ class QString; * There are currently a few implementations of script managers around but developers can implement their own custom * interfaces with this class. * @code - * class MyScript : public QObject, public KScriptClientInterface { + * class MyScript : public TQObject, public KScriptClientInterface { * Q_OBJECT * public: * - * MyScript(QObject *parent) + * MyScript(TQObject *parent) * { * // Create your @ref KScriptInterface here. * m_interface = KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>( @@ -49,14 +49,14 @@ class QString; * } * * signals: - * void error ( const QString &msg ); - * void warning ( const QString &msg ); - * void output ( const QString &msg ); + * void error ( const TQString &msg ); + * void warning ( const TQString &msg ); + * void output ( const TQString &msg ); * void progress ( int percent ); - * void done ( KScriptClientInterface::Result result, const QVariant &returned ); + * void done ( KScriptClientInterface::Result result, const TQVariant &returned ); * * public slots: - * void activate(const QVariant &args) + * void activate(const TQVariant &args) * { * m_interface->run(parent(), args); * } @@ -80,21 +80,21 @@ class QString; * For script clients its best to implement this as a signal so feedback * can be sent to the main application. */ - virtual void error( const QString &msg ) =0; + virtual void error( const TQString &msg ) =0; /** * This function will allow the main application of any warnings * that have occurred during the processing of the script. * For script clients its best to implement this as a signal so feedback * can be sent to the main application. */ - virtual void warning( const QString &msg ) =0; + virtual void warning( const TQString &msg ) =0; /** * This function will allow the main application of any normal * output that has occurred during the processing of the script. * For script clients its best to implement this as a signal so feedback * can be sent to the main application. */ - virtual void output( const QString &msg ) =0; + virtual void output( const TQString &msg ) =0; /** * This function will allow feedback to any progress bars in the main * application as to how far along the script is. This is very useful when @@ -111,7 +111,7 @@ class QString; * For script clients its best to implement this as a signal so feedback * can be sent to the main application. */ - virtual void done( KScriptClientInterface::Result result, const QVariant &returned ) =0; + virtual void done( KScriptClientInterface::Result result, const TQVariant &returned ) =0; /** * Returned when the script has finished running. * For script clients its best to implement this as a signal so feedback diff --git a/interfaces/kscript/scriptinterface.h b/interfaces/kscript/scriptinterface.h index de387ecc6..9ca3a45bd 100644 --- a/interfaces/kscript/scriptinterface.h +++ b/interfaces/kscript/scriptinterface.h @@ -27,8 +27,8 @@ **/ #ifndef __scriptinterface_h__ #define __scriptinterface_h__ -#include <qvariant.h> -#include <qobject.h> +#include <tqvariant.h> +#include <tqobject.h> #include <kdemacros.h> //#include <scripclientinterface.h> @@ -50,25 +50,25 @@ class KScriptClientInterface; public: /** * Return the current script code data - * @returns QString containing the currenly runable code + * @returns TQString containing the currenly runable code **/ - virtual QString script() const = 0; + virtual TQString script() const = 0; /** * Sets the path to the script library that we are going to embed. **/ - virtual void setScript( const QString &scriptFile ) = 0; + virtual void setScript( const TQString &scriptFile ) = 0; /** * Sets the path to the script library that we are going to embed. * The second argument is the function from the script library that * we wish to call. **/ - virtual void setScript( const QString &scriptLibFile, const QString &method ) = 0; + virtual void setScript( const TQString &scriptLibFile, const TQString &method ) = 0; /** * Run the actual script code * This can both take a context object that will be shared between the * main application and a variant that will contain the arguments. **/ - virtual void run(QObject *context = 0, const QVariant &arg = 0) = 0; + virtual void run(TQObject *context = 0, const TQVariant &arg = 0) = 0; /** * Abort the scripts run **/ diff --git a/interfaces/kscript/scriptloader.cpp b/interfaces/kscript/scriptloader.cpp index 6ab7e091c..621ceb5d1 100644 --- a/interfaces/kscript/scriptloader.cpp +++ b/interfaces/kscript/scriptloader.cpp @@ -29,18 +29,18 @@ #include <kstdaccel.h> #include <kdebug.h> -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> -ScriptLoader::ScriptLoader(KMainWindow *parent) : QObject (parent) +ScriptLoader::ScriptLoader(KMainWindow *parent) : TQObject (parent) { m_parent = parent; m_scripts.clear(); m_theAction = new KSelectAction ( i18n("KDE Scripts"), 0, this, - SLOT(runAction()), + TQT_SLOT(runAction()), m_parent->actionCollection(), "scripts"); } @@ -54,15 +54,15 @@ ScriptLoader::~ScriptLoader() KSelectAction * ScriptLoader::getScripts() { // Get the available scripts for this application. - QStringList pluginList = ""; + TQStringList pluginList = ""; // Find plugins - QString searchPath = kapp->name(); + TQString searchPath = kapp->name(); searchPath += "/scripts/"; - QDir d(locate( "data", searchPath)); + TQDir d(locate( "data", searchPath)); kdDebug() << "loading plugin from " << locate( "data", searchPath) << endl; const QFileInfoList *fileList = d.entryInfoList("*.desktop"); QFileInfoListIterator it ( *fileList ); - QFileInfo *fi; + TQFileInfo *fi; // Find all available script desktop files while( (fi=it.current())) { @@ -92,7 +92,7 @@ KSelectAction * ScriptLoader::getScripts() void ScriptLoader::runAction() { - QString scriptName = m_theAction->currentText(); + TQString scriptName = m_theAction->currentText(); } diff --git a/interfaces/kscript/scriptloader.h b/interfaces/kscript/scriptloader.h index c6b2848de..20b135231 100644 --- a/interfaces/kscript/scriptloader.h +++ b/interfaces/kscript/scriptloader.h @@ -18,7 +18,7 @@ */ #ifndef _script_loader_h #define _script_loader_h -#include <qptrlist.h> +#include <tqptrlist.h> #include <kmainwindow.h> #include <kaction.h> #include <kscript/scriptinterface.h> @@ -47,11 +47,11 @@ class ScriptLoader : virtual public QObject */ void stopAction(); signals: - virtual void errors(QString messages); - virtual void output(QString messages); + virtual void errors(TQString messages); + virtual void output(TQString messages); virtual void done(int errorCode); private: - QPtrList<KScriptInterface> m_scripts; + TQPtrList<KScriptInterface> m_scripts; KSelectAction *m_theAction; int m_currentSelection; KMainWindow *m_parent; diff --git a/interfaces/kscript/scriptmanager.cpp b/interfaces/kscript/scriptmanager.cpp index 48592e2cf..5cdbd7459 100644 --- a/interfaces/kscript/scriptmanager.cpp +++ b/interfaces/kscript/scriptmanager.cpp @@ -13,9 +13,9 @@ class ScriptInfo { public: - QString scriptType; - QString scriptFile; - QString scriptMethod; + TQString scriptType; + TQString scriptFile; + TQString scriptMethod; ScriptInfo(); ~ScriptInfo(){} }; @@ -25,8 +25,8 @@ ScriptInfo::ScriptInfo() scriptFile = ""; scriptMethod = ""; } -KScriptManager::KScriptManager(QObject *parent, const char *name) : - QObject(parent,name), KScriptClientInterface() +KScriptManager::KScriptManager(TQObject *parent, const char *name) : + TQObject(parent,name), KScriptClientInterface() { } @@ -36,14 +36,14 @@ KScriptManager::~KScriptManager() m_scriptCache.setAutoDelete(true); } -bool KScriptManager::addScript( const QString &scriptDesktopFile) +bool KScriptManager::addScript( const TQString &scriptDesktopFile) { //m_scriptNames.append(scriptName); // lets get some information about the script we are going to run... bool success = false; - QString tmpScriptType = ""; - QString tmpScriptFile = ""; - QString tmpScriptMethod = ""; + TQString tmpScriptType = ""; + TQString tmpScriptFile = ""; + TQString tmpScriptMethod = ""; // Read the desktop file if(KDesktopFile::isDesktopFile(scriptDesktopFile)) @@ -51,24 +51,24 @@ bool KScriptManager::addScript( const QString &scriptDesktopFile) KDesktopFile desktop(scriptDesktopFile, true); m_scripts.insert(desktop.readName(), new ScriptInfo()); m_scripts[desktop.readName()]->scriptType = desktop.readType(); - QString localpath = QString(kapp->name()) + "/scripts/" + desktop.readEntry("X-KDE-ScriptName", ""); + TQString localpath = TQString(kapp->name()) + "/scripts/" + desktop.readEntry("X-KDE-ScriptName", ""); m_scripts[desktop.readName()]->scriptFile = locate("data", localpath); // m_scripts[desktop.readName()]->scriptMethod = tmpScriptMethod; success = true; } return success; } -bool KScriptManager::removeScript( const QString &scriptName ) +bool KScriptManager::removeScript( const TQString &scriptName ) { bool result = m_scriptCache.remove(scriptName); result = m_scripts.remove(scriptName); return result; } -QStringList KScriptManager::scripts() +TQStringList KScriptManager::scripts() { - QDictIterator<ScriptInfo> it( m_scripts ); + TQDictIterator<ScriptInfo> it( m_scripts ); // return m_scriptNames; - QStringList scriptList; + TQStringList scriptList; while ( it.current() ) { scriptList.append(it.currentKey()); @@ -81,19 +81,19 @@ void KScriptManager::clear() m_scriptCache.clear(); m_scripts.clear(); } -void KScriptManager::runScript( const QString &scriptName, QObject *context, const QVariant &arg) +void KScriptManager::runScript( const TQString &scriptName, TQObject *context, const TQVariant &arg) { ScriptInfo *newScript = m_scripts[scriptName]; if (newScript) { - QString scriptType = "([X-KDE-Script-Runner] == '" + newScript->scriptType + "')"; + TQString scriptType = "([X-KDE-Script-Runner] == '" + newScript->scriptType + "')"; kdDebug()<<"running script, type = '"<<scriptType<<"'"<<endl; // See if the script is already cached... if ( !m_scriptCache[scriptName] ) { // via some magic we will let the old script engine go away after // some minutes... - // currently i am thinking a QTimer that will throw a signal in 10 minutes + // currently i am thinking a TQTimer that will throw a signal in 10 minutes // to remove m_scriptCache[m_currentScript] KScriptInterface *ksif = KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>( "KScriptRunner/KScriptRunner", scriptType, this ); if ( ksif ) diff --git a/interfaces/kscript/scriptmanager.h b/interfaces/kscript/scriptmanager.h index 8ace6dcff..77a447c44 100644 --- a/interfaces/kscript/scriptmanager.h +++ b/interfaces/kscript/scriptmanager.h @@ -19,11 +19,11 @@ #ifndef __scriptmanager_h__ #define __scriptmanager_h__ -#include <qvariant.h> +#include <tqvariant.h> #include <scriptclientinterface.h> #include <scriptinterface.h> -#include <qdict.h> -#include <qobject.h> +#include <tqdict.h> +#include <tqobject.h> #include <kdelibs_export.h> @@ -36,7 +36,7 @@ class ScriptInfo; * @author Ian Reinhart Geiser <geiseri@kde.org> * **/ - class KDE_EXPORT KScriptManager : public QObject, public KScriptClientInterface + class KDE_EXPORT KScriptManager : public TQObject, public KScriptClientInterface { Q_OBJECT friend class KScriptInterface; @@ -44,7 +44,7 @@ class ScriptInfo; /** * Create a new instance of the script engine. */ - KScriptManager(QObject *parent, const char *name); + KScriptManager(TQObject *parent, const char *name); /** * Destroy the current script engine. */ @@ -54,17 +54,17 @@ class ScriptInfo; * This should be the full name and path to the desktop * file. */ - bool addScript( const QString &scriptDesktopFile); + bool addScript( const TQString &scriptDesktopFile); /** * Remove a script instance from the script engine. * @returns the success of the operation. */ - bool removeScript( const QString &scriptName ); + bool removeScript( const TQString &scriptName ); /** * Access the names of script instances from the script engine. - * @returns a QStringList of the current scripts. + * @returns a TQStringList of the current scripts. */ - QStringList scripts(); + TQStringList scripts(); /** * Clear all script intstances in memory */ @@ -73,17 +73,17 @@ class ScriptInfo; * This function will allow the main application of any errors * that have occurred during processing of the script. */ - void error( const QString &msg ) {emit scriptError(msg);} + void error( const TQString &msg ) {emit scriptError(msg);} /** * This function will allow the main application of any warnings * that have occurred during the processing of the script. */ - void warning( const QString &msg ) {emit scriptWarning(msg);} + void warning( const TQString &msg ) {emit scriptWarning(msg);} /** * This function will allow the main application of any normal * output that has occurred during the processing of the script. */ - void output( const QString &msg ) {emit scriptOutput(msg);} + void output( const TQString &msg ) {emit scriptOutput(msg);} /** * This function will allow feedback to any progress bars in the main * application as to how far along the script is. This is very useful when @@ -96,29 +96,29 @@ class ScriptInfo; * It turns the result as a KScriptInteface::Result, and a return * value as a QVariant */ - void done( KScriptClientInterface::Result result, const QVariant &returned ) {emit scriptDone(result, returned);} + void done( KScriptClientInterface::Result result, const TQVariant &returned ) {emit scriptDone(result, returned);} public slots: /** * Run the selected script */ - void runScript( const QString &scriptName, QObject *context = 0, const QVariant &arg = 0 ); + void runScript( const TQString &scriptName, TQObject *context = 0, const TQVariant &arg = 0 ); signals: /** * Send out a signal of the error message from the current running * script. */ - void scriptError( const QString &msg ); + void scriptError( const TQString &msg ); /** * Send out a signal of the warning message from the current running * script. */ - void scriptWarning( const QString &msg ); + void scriptWarning( const TQString &msg ); /** * Send out a signal of the output message from the current running * script. */ - void scriptOutput( const QString &msg ); + void scriptOutput( const TQString &msg ); /** * Send out a signal of the progress of the current running * script. @@ -128,12 +128,12 @@ class ScriptInfo; * Send out a signal of the exit status of the script * */ - void scriptDone( KScriptClientInterface::Result result, const QVariant &returned); + void scriptDone( KScriptClientInterface::Result result, const TQVariant &returned); protected: - QDict<ScriptInfo> m_scripts; - QDict<KScriptInterface> m_scriptCache; - //QStringList m_scriptNames; - QString m_currentScript; + TQDict<ScriptInfo> m_scripts; + TQDict<KScriptInterface> m_scriptCache; + //TQStringList m_scriptNames; + TQString m_currentScript; }; //}; #endif |