From b6edfe41c9395f2e20784cbf0e630af6426950a3 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/kross/main/manager.cpp | 26 +++++++++++++------------- lib/kross/main/scriptaction.h | 2 +- lib/kross/main/scriptcontainer.cpp | 4 ++-- lib/kross/main/scriptguiclient.cpp | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'lib/kross/main') diff --git a/lib/kross/main/manager.cpp b/lib/kross/main/manager.cpp index b966a1cc..646a8746 100644 --- a/lib/kross/main/manager.cpp +++ b/lib/kross/main/manager.cpp @@ -83,10 +83,10 @@ Manager::Manager() TQString pythonlib = TQFile::encodeName( KLibLoader::self()->findLibrary(KROSS_PYTHON_LIBRARY) ); if(! pythonlib.isEmpty()) { // If the Kross Python plugin exists we offer it as supported scripting language. InterpreterInfo::Option::Map pythonoptions; - pythonoptions.tqreplace("restricted", + pythonoptions.replace("restricted", new InterpreterInfo::Option("Restricted", "Restricted Python interpreter", TQVariant(false,0)) ); - d->interpreterinfos.tqreplace("python", + d->interpreterinfos.replace("python", new InterpreterInfo("python", pythonlib, // library "*.py", // file filter-wildcard @@ -100,10 +100,10 @@ Manager::Manager() TQString rubylib = TQFile::encodeName( KLibLoader::self()->findLibrary(KROSS_RUBY_LIBRARY) ); if(! rubylib.isEmpty()) { // If the Kross Ruby plugin exists we offer it as supported scripting language. InterpreterInfo::Option::Map rubyoptions; - rubyoptions.tqreplace("safelevel", + rubyoptions.replace("safelevel", new InterpreterInfo::Option("safelevel", "Level of safety of the Ruby interpreter", TQVariant(0)) // 0 -> unsafe, 4 -> very safe ); - d->interpreterinfos.tqreplace("ruby", + d->interpreterinfos.replace("ruby", new InterpreterInfo("ruby", rubylib, // library "*.rb", // file filter-wildcard @@ -131,7 +131,7 @@ TQMap Manager::getInterpreterInfos() bool Manager::hasInterpreterInfo(const TQString& interpretername) const { - return d->interpreterinfos.tqcontains(interpretername); + return d->interpreterinfos.contains(interpretername); } InterpreterInfo* Manager::getInterpreterInfo(const TQString& interpretername) @@ -145,7 +145,7 @@ const TQString Manager::getInterpreternameForFile(const TQString& file) rx.setWildcard(true); for(TQMap::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it) { rx.setPattern((*it)->getWildcard()); - if( file.tqfind(rx) >= 0 ) + if( file.find(rx) >= 0 ) return (*it)->getInterpretername(); } return TQString(); @@ -155,11 +155,11 @@ ScriptContainer::Ptr Manager::getScriptContainer(const TQString& scriptname) { //TODO at the moment we don't share ScriptContainer instances. - //if(d->m_scriptcontainers.tqcontains(scriptname)) + //if(d->m_scriptcontainers.contains(scriptname)) // return d->m_scriptcontainers[scriptname]; ScriptContainer* scriptcontainer = new ScriptContainer(scriptname); //ScriptContainer script(this, scriptname); - //d->m_scriptcontainers.tqreplace(scriptname, scriptcontainer); + //d->m_scriptcontainers.replace(scriptname, scriptcontainer); return scriptcontainer; } @@ -168,7 +168,7 @@ Interpreter* Manager::getInterpreter(const TQString& interpretername) { setException(0); // clear previous exceptions - if(! d->interpreterinfos.tqcontains(interpretername)) { + if(! d->interpreterinfos.contains(interpretername)) { setException( new Exception(i18n("No such interpreter '%1'").tqarg(interpretername)) ); return 0; } @@ -192,8 +192,8 @@ const TQStringList Manager::getInterpreters() bool Manager::addModule(Module::Ptr module) { TQString name = module->getName(); - //if( d->modules.tqcontains(name) ) return false; - d->modules.tqreplace(name, module); + //if( d->modules.contains(name) ) return false; + d->modules.replace(name, module); return true; } @@ -201,7 +201,7 @@ Module::Ptr Manager::loadModule(const TQString& modulename) { Module::Ptr module = 0; - if(d->modules.tqcontains(modulename)) { + if(d->modules.contains(modulename)) { module = d->modules[modulename]; if(module) return module; @@ -240,7 +240,7 @@ Module::Ptr Manager::loadModule(const TQString& modulename) } // Don't remember module cause we like to have freeing it handled by the caller. - //d->modules.tqreplace(modulename, module); + //d->modules.replace(modulename, module); //krossdebug( TQString("Kross::Api::Manager::loadModule modulename='%1' module='%2'").tqarg(modulename).tqarg(module->toString()) ); return module; diff --git a/lib/kross/main/scriptaction.h b/lib/kross/main/scriptaction.h index 27f910d0..4b78d611 100644 --- a/lib/kross/main/scriptaction.h +++ b/lib/kross/main/scriptaction.h @@ -174,7 +174,7 @@ namespace Kross { namespace Api { /** * This signal got emitted after the try to execute this - * \a ScriptAction failed. The \p errormessage tqcontains + * \a ScriptAction failed. The \p errormessage contains * the error message. */ void failed(const TQString& errormessage, const TQString& tracedetails); diff --git a/lib/kross/main/scriptcontainer.cpp b/lib/kross/main/scriptcontainer.cpp index 5acde9db..a345dd02 100644 --- a/lib/kross/main/scriptcontainer.cpp +++ b/lib/kross/main/scriptcontainer.cpp @@ -151,7 +151,7 @@ TQMap& ScriptContainer::getOptions() TQVariant ScriptContainer::getOption(const TQString name, TQVariant defaultvalue, bool /*recursive*/) { - if(d->options.tqcontains(name)) + if(d->options.contains(name)) return d->options[name]; Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo( d->interpretername ); return info ? info->getOptionValue(name, defaultvalue) : defaultvalue; @@ -162,7 +162,7 @@ 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.tqreplace(name, value); + d->options.replace(name, value); return true; } 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()) ); diff --git a/lib/kross/main/scriptguiclient.cpp b/lib/kross/main/scriptguiclient.cpp index 36d81151..ebcf0b00 100644 --- a/lib/kross/main/scriptguiclient.cpp +++ b/lib/kross/main/scriptguiclient.cpp @@ -82,11 +82,11 @@ ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, TQWidget* tqparent) new KAction(i18n("Scripts Manager..."), 0, 0, this, TQT_SLOT(showScriptManager()), actionCollection(), "configurescripts"); // The predefined ScriptActionCollection's this ScriptGUIClient provides. - d->collections.tqreplace("installedscripts", + d->collections.replace("installedscripts", new ScriptActionCollection(i18n("Scripts"), actionCollection(), "installedscripts") ); - d->collections.tqreplace("loadedscripts", + d->collections.replace("loadedscripts", new ScriptActionCollection(i18n("Loaded"), actionCollection(), "loadedscripts") ); - d->collections.tqreplace("executedscripts", + d->collections.replace("executedscripts", new ScriptActionCollection(i18n("History"), actionCollection(), "executedscripts") ); reloadInstalledScripts(); @@ -102,7 +102,7 @@ ScriptGUIClient::~ScriptGUIClient() bool ScriptGUIClient::hasActionCollection(const TQString& name) { - return d->collections.tqcontains(name); + return d->collections.contains(name); } ScriptActionCollection* ScriptGUIClient::getActionCollection(const TQString& name) @@ -118,12 +118,12 @@ TQMap ScriptGUIClient::getActionCollections() void ScriptGUIClient::addActionCollection(const TQString& name, ScriptActionCollection* collection) { removeActionCollection(name); - d->collections.tqreplace(name, collection); + d->collections.replace(name, collection); } bool ScriptGUIClient::removeActionCollection(const TQString& name) { - if(d->collections.tqcontains(name)) { + if(d->collections.contains(name)) { ScriptActionCollection* c = d->collections[name]; d->collections.remove(name); delete c; -- cgit v1.2.1