summaryrefslogtreecommitdiffstats
path: root/lib/kross/main/manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kross/main/manager.cpp')
-rw-r--r--lib/kross/main/manager.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/lib/kross/main/manager.cpp b/lib/kross/main/manager.cpp
index cdb4d3636..b966a1cc6 100644
--- a/lib/kross/main/manager.cpp
+++ b/lib/kross/main/manager.cpp
@@ -20,7 +20,7 @@
#include "manager.h"
#include "../api/interpreter.h"
-//#include "../api/qtobject.h"
+//#include "../api/tqtobject.h"
#include "../api/eventslot.h"
#include "../api/eventsignal.h"
//#include "../api/script.h"
@@ -28,9 +28,9 @@
#include "krossconfig.h"
#include "scriptcontainer.h"
-#include <qobject.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqobject.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <klibloader.h>
#include <klocale.h>
@@ -50,10 +50,10 @@ namespace Kross { namespace Api {
{
public:
/// List of \a InterpreterInfo instances.
- QMap<QString, InterpreterInfo*> interpreterinfos;
+ TQMap<TQString, InterpreterInfo*> interpreterinfos;
/// Loaded modules.
- QMap<QString, Module::Ptr> modules;
+ TQMap<TQString, Module::Ptr> modules;
};
/**
@@ -80,34 +80,34 @@ Manager::Manager()
, d( new ManagerPrivate() )
{
#ifdef KROSS_PYTHON_LIBRARY
- QString pythonlib = QFile::encodeName( KLibLoader::self()->findLibrary(KROSS_PYTHON_LIBRARY) );
+ 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.replace("restricted",
- new InterpreterInfo::Option("Restricted", "Restricted Python interpreter", QVariant(false,0))
+ pythonoptions.tqreplace("restricted",
+ new InterpreterInfo::Option("Restricted", "Restricted Python interpreter", TQVariant(false,0))
);
- d->interpreterinfos.replace("python",
+ d->interpreterinfos.tqreplace("python",
new InterpreterInfo("python",
pythonlib, // library
"*.py", // file filter-wildcard
- QStringList() << /* "text/x-python" << */ "application/x-python", // mimetypes
+ TQStringList() << /* "text/x-python" << */ "application/x-python", // mimetypes
pythonoptions // options
)
);
}
#endif
#ifdef KROSS_RUBY_LIBRARY
- QString rubylib = QFile::encodeName( KLibLoader::self()->findLibrary(KROSS_RUBY_LIBRARY) );
+ 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.replace("safelevel",
- new InterpreterInfo::Option("safelevel", "Level of safety of the Ruby interpreter", QVariant(0)) // 0 -> unsafe, 4 -> very safe
+ rubyoptions.tqreplace("safelevel",
+ new InterpreterInfo::Option("safelevel", "Level of safety of the Ruby interpreter", TQVariant(0)) // 0 -> unsafe, 4 -> very safe
);
- d->interpreterinfos.replace("ruby",
+ d->interpreterinfos.tqreplace("ruby",
new InterpreterInfo("ruby",
rubylib, // library
"*.rb", // file filter-wildcard
- QStringList() << /* "text/x-ruby" << */ "application/x-ruby", // mimetypes
+ TQStringList() << /* "text/x-ruby" << */ "application/x-ruby", // mimetypes
rubyoptions // options
)
);
@@ -119,68 +119,68 @@ Manager::Manager()
Manager::~Manager()
{
- for(QMap<QString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it)
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it)
delete it.data();
delete d;
}
-QMap<QString, InterpreterInfo*> Manager::getInterpreterInfos()
+TQMap<TQString, InterpreterInfo*> Manager::getInterpreterInfos()
{
return d->interpreterinfos;
}
-bool Manager::hasInterpreterInfo(const QString& interpretername) const
+bool Manager::hasInterpreterInfo(const TQString& interpretername) const
{
- return d->interpreterinfos.contains(interpretername);
+ return d->interpreterinfos.tqcontains(interpretername);
}
-InterpreterInfo* Manager::getInterpreterInfo(const QString& interpretername)
+InterpreterInfo* Manager::getInterpreterInfo(const TQString& interpretername)
{
return d->interpreterinfos[interpretername];
}
-const QString Manager::getInterpreternameForFile(const QString& file)
+const TQString Manager::getInterpreternameForFile(const TQString& file)
{
- QRegExp rx;
+ TQRegExp rx;
rx.setWildcard(true);
- for(QMap<QString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it) {
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it) {
rx.setPattern((*it)->getWildcard());
- if( file.find(rx) >= 0 )
+ if( file.tqfind(rx) >= 0 )
return (*it)->getInterpretername();
}
- return QString::null;
+ return TQString();
}
-ScriptContainer::Ptr Manager::getScriptContainer(const QString& scriptname)
+ScriptContainer::Ptr Manager::getScriptContainer(const TQString& scriptname)
{
//TODO at the moment we don't share ScriptContainer instances.
- //if(d->m_scriptcontainers.contains(scriptname))
+ //if(d->m_scriptcontainers.tqcontains(scriptname))
// return d->m_scriptcontainers[scriptname];
ScriptContainer* scriptcontainer = new ScriptContainer(scriptname);
//ScriptContainer script(this, scriptname);
- //d->m_scriptcontainers.replace(scriptname, scriptcontainer);
+ //d->m_scriptcontainers.tqreplace(scriptname, scriptcontainer);
return scriptcontainer;
}
-Interpreter* Manager::getInterpreter(const QString& interpretername)
+Interpreter* Manager::getInterpreter(const TQString& interpretername)
{
setException(0); // clear previous exceptions
- if(! d->interpreterinfos.contains(interpretername)) {
- setException( new Exception(i18n("No such interpreter '%1'").arg(interpretername)) );
+ if(! d->interpreterinfos.tqcontains(interpretername)) {
+ setException( new Exception(i18n("No such interpreter '%1'").tqarg(interpretername)) );
return 0;
}
return d->interpreterinfos[interpretername]->getInterpreter();
}
-const QStringList Manager::getInterpreters()
+const TQStringList Manager::getInterpreters()
{
- QStringList list;
+ TQStringList list;
- QMap<QString, InterpreterInfo*>::Iterator it( d->interpreterinfos.begin() );
+ TQMap<TQString, InterpreterInfo*>::Iterator it( d->interpreterinfos.begin() );
for(; it != d->interpreterinfos.end(); ++it)
list << it.key();
@@ -191,37 +191,37 @@ const QStringList Manager::getInterpreters()
bool Manager::addModule(Module::Ptr module)
{
- QString name = module->getName();
- //if( d->modules.contains(name) ) return false;
- d->modules.replace(name, module);
+ TQString name = module->getName();
+ //if( d->modules.tqcontains(name) ) return false;
+ d->modules.tqreplace(name, module);
return true;
}
-Module::Ptr Manager::loadModule(const QString& modulename)
+Module::Ptr Manager::loadModule(const TQString& modulename)
{
Module::Ptr module = 0;
- if(d->modules.contains(modulename)) {
+ if(d->modules.tqcontains(modulename)) {
module = d->modules[modulename];
if(module)
return module;
else
- krossdebug( QString("Manager::loadModule(%1) =======> Modulename registered, but module is invalid!").arg(modulename) );
+ krossdebug( TQString("Manager::loadModule(%1) =======> Modulename registered, but module is invalid!").tqarg(modulename) );
}
KLibLoader* loader = KLibLoader::self();
KLibrary* lib = loader->globalLibrary( modulename.latin1() );
if(! lib) {
- krosswarning( QString("Failed to load module '%1': %2").arg(modulename).arg(loader->lastErrorMessage()) );
+ krosswarning( TQString("Failed to load module '%1': %2").tqarg(modulename).tqarg(loader->lastErrorMessage()) );
return 0;
}
- krossdebug( QString("Successfully loaded module '%1'").arg(modulename) );
+ krossdebug( TQString("Successfully loaded module '%1'").tqarg(modulename) );
def_module_func func;
func = (def_module_func) lib->symbol("init_module");
if(! func) {
- krosswarning( QString("Failed to determinate init function in module '%1'").arg(modulename) );
+ krosswarning( TQString("Failed to determinate init function in module '%1'").tqarg(modulename) );
return 0;
}
@@ -235,14 +235,14 @@ Module::Ptr Manager::loadModule(const QString& modulename)
lib->unload();
if(! module) {
- krosswarning( QString("Failed to load module '%1'").arg(modulename) );
+ krosswarning( TQString("Failed to load module '%1'").tqarg(modulename) );
return 0;
}
// Don't remember module cause we like to have freeing it handled by the caller.
- //d->modules.replace(modulename, module);
+ //d->modules.tqreplace(modulename, module);
- //krossdebug( QString("Kross::Api::Manager::loadModule modulename='%1' module='%2'").arg(modulename).arg(module->toString()) );
+ //krossdebug( TQString("Kross::Api::Manager::loadModule modulename='%1' module='%2'").tqarg(modulename).tqarg(module->toString()) );
return module;
}