diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross/main/scriptcontainer.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kross/main/scriptcontainer.cpp')
-rw-r--r-- | lib/kross/main/scriptcontainer.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/kross/main/scriptcontainer.cpp b/lib/kross/main/scriptcontainer.cpp index 56c9bb8e..5acde9db 100644 --- a/lib/kross/main/scriptcontainer.cpp +++ b/lib/kross/main/scriptcontainer.cpp @@ -25,7 +25,7 @@ #include "../main/manager.h" #include "mainmodule.h" -#include <qfile.h> +#include <tqfile.h> #include <klocale.h> @@ -50,19 +50,19 @@ namespace Kross { namespace Api { * The unique name the \a ScriptContainer is * reachable as. */ - QString name; + TQString name; /** * The scripting code. */ - QString code; + TQString code; /** * The name of the interpreter. This could be * something like "python" for the python * binding. */ - QString interpretername; + TQString interpretername; /** * The name of the scriptfile that should be @@ -71,23 +71,23 @@ namespace Kross { namespace Api { * scripting code and, if not defined, the * used interpreter. */ - QString scriptfile; + TQString scriptfile; /** * Map of options that overwritte the \a InterpreterInfo::Option::Map * standard options. */ - QMap<QString, QVariant> options; + TQMap<TQString, TQVariant> options; }; }} -ScriptContainer::ScriptContainer(const QString& name) +ScriptContainer::ScriptContainer(const TQString& name) : MainModule(name) , d( new ScriptContainerPrivate() ) // initialize d-pointer class { - //krossdebug( QString("ScriptContainer::ScriptContainer() Ctor name='%1'").arg(name) ); + //krossdebug( TQString("ScriptContainer::ScriptContainer() Ctor name='%1'").tqarg(name) ); d->script = 0; d->name = name; @@ -95,77 +95,77 @@ ScriptContainer::ScriptContainer(const QString& name) ScriptContainer::~ScriptContainer() { - //krossdebug( QString("ScriptContainer::~ScriptContainer() Dtor name='%1'").arg(d->name) ); + //krossdebug( TQString("ScriptContainer::~ScriptContainer() Dtor name='%1'").tqarg(d->name) ); finalize(); delete d; } -const QString ScriptContainer::getName() const +const TQString ScriptContainer::getName() const { return d->name; } -void ScriptContainer::setName(const QString& name) +void ScriptContainer::setName(const TQString& name) { d->name = name; } -QString ScriptContainer::getCode() const +TQString ScriptContainer::getCode() const { return d->code; } -void ScriptContainer::setCode(const QString& code) +void ScriptContainer::setCode(const TQString& code) { finalize(); d->code = code; } -QString ScriptContainer::getInterpreterName() const +TQString ScriptContainer::getInterpreterName() const { return d->interpretername; } -void ScriptContainer::setInterpreterName(const QString& interpretername) +void ScriptContainer::setInterpreterName(const TQString& interpretername) { finalize(); d->interpretername = interpretername; } -QString ScriptContainer::getFile() const +TQString ScriptContainer::getFile() const { return d->scriptfile; } -void ScriptContainer::setFile(const QString& scriptfile) +void ScriptContainer::setFile(const TQString& scriptfile) { finalize(); d->scriptfile = scriptfile; } -QMap<QString, QVariant>& ScriptContainer::getOptions() +TQMap<TQString, TQVariant>& ScriptContainer::getOptions() { return d->options; } -QVariant ScriptContainer::getOption(const QString name, QVariant defaultvalue, bool /*recursive*/) +TQVariant ScriptContainer::getOption(const TQString name, TQVariant defaultvalue, bool /*recursive*/) { - if(d->options.contains(name)) + if(d->options.tqcontains(name)) return d->options[name]; Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo( d->interpretername ); return info ? info->getOptionValue(name, defaultvalue) : defaultvalue; } -bool ScriptContainer::setOption(const QString name, const QVariant& value) +bool ScriptContainer::setOption(const TQString name, const TQVariant& value) { Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo( d->interpretername ); if(info) { if(info->hasOption(name)) { - d->options.replace(name, value); + d->options.tqreplace(name, value); return true; - } else krosswarning( QString("Kross::Api::ScriptContainer::setOption(%1, %2): No such option").arg(name).arg(value.toString()) ); - } else krosswarning( QString("Kross::Api::ScriptContainer::setOption(%1, %2): No such interpreterinfo").arg(name).arg(value.toString()) ); + } else krosswarning( TQString("Kross::Api::ScriptContainer::setOption(%1, %2): No such option").tqarg(name).tqarg(value.toString()) ); + } else krosswarning( TQString("Kross::Api::ScriptContainer::setOption(%1, %2): No such interpreterinfo").tqarg(name).tqarg(value.toString()) ); return false; } @@ -187,12 +187,12 @@ Object::Ptr ScriptContainer::execute() return r; } -const QStringList ScriptContainer::getFunctionNames() +const TQStringList ScriptContainer::getFunctionNames() { - return d->script ? d->script->getFunctionNames() : QStringList(); //FIXME init before if needed? + return d->script ? d->script->getFunctionNames() : TQStringList(); //FIXME init before if needed? } -Object::Ptr ScriptContainer::callFunction(const QString& functionname, List::Ptr arguments) +Object::Ptr ScriptContainer::callFunction(const TQString& functionname, List::Ptr arguments) { if(! d->script) if(! initialize()) @@ -216,12 +216,12 @@ Object::Ptr ScriptContainer::callFunction(const QString& functionname, List::Ptr return r; } -QStringList ScriptContainer::getClassNames() +TQStringList ScriptContainer::getClassNames() { - return d->script ? d->script->getClassNames() : QStringList(); //FIXME init before if needed? + return d->script ? d->script->getClassNames() : TQStringList(); //FIXME init before if needed? } -Object::Ptr ScriptContainer::classInstance(const QString& classname) +Object::Ptr ScriptContainer::classInstance(const TQString& classname) { if(! d->script) if(! initialize()) @@ -244,34 +244,34 @@ bool ScriptContainer::initialize() finalize(); if(! d->scriptfile.isNull()) { - krossdebug( QString("Kross::Api::ScriptContainer::initialize() file=%1").arg(d->scriptfile) ); + krossdebug( TQString("Kross::Api::ScriptContainer::initialize() file=%1").tqarg(d->scriptfile) ); if(d->interpretername.isNull()) { d->interpretername = Manager::scriptManager()->getInterpreternameForFile( d->scriptfile ); if(d->interpretername.isNull()) { - setException( new Exception(i18n("Failed to determinate interpreter for scriptfile '%1'").arg(d->scriptfile)) ); + setException( new Exception(i18n("Failed to determinate interpreter for scriptfile '%1'").tqarg(d->scriptfile)) ); return false; } } - QFile f( d->scriptfile ); + TQFile f( d->scriptfile ); if(! f.open(IO_ReadOnly)) { - setException( new Exception(i18n("Failed to open scriptfile '%1'").arg(d->scriptfile)) ); + setException( new Exception(i18n("Failed to open scriptfile '%1'").tqarg(d->scriptfile)) ); return false; } - d->code = QString( f.readAll() ); + d->code = TQString( f.readAll() ); f.close(); } Interpreter* interpreter = Manager::scriptManager()->getInterpreter(d->interpretername); if(! interpreter) { - setException( new Exception(i18n("Unknown interpreter '%1'").arg(d->interpretername)) ); + setException( new Exception(i18n("Unknown interpreter '%1'").tqarg(d->interpretername)) ); return false; } d->script = interpreter->createScript(this); if(! d->script) { - setException( new Exception(i18n("Failed to create script for interpreter '%1'").arg(d->interpretername)) ); + setException( new Exception(i18n("Failed to create script for interpreter '%1'").tqarg(d->interpretername)) ); return false; } if(d->script->hadException()) { |