summaryrefslogtreecommitdiffstats
path: root/lib/kross
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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')
-rw-r--r--lib/kross/api/callable.cpp52
-rw-r--r--lib/kross/api/callable.h32
-rw-r--r--lib/kross/api/class.h14
-rw-r--r--lib/kross/api/dict.cpp14
-rw-r--r--lib/kross/api/dict.h14
-rw-r--r--lib/kross/api/event.h56
-rw-r--r--lib/kross/api/eventaction.cpp8
-rw-r--r--lib/kross/api/eventaction.h10
-rw-r--r--lib/kross/api/eventscript.cpp8
-rw-r--r--lib/kross/api/eventscript.h10
-rw-r--r--lib/kross/api/eventsignal.cpp24
-rw-r--r--lib/kross/api/eventsignal.h28
-rw-r--r--lib/kross/api/eventslot.cpp172
-rw-r--r--lib/kross/api/eventslot.h54
-rw-r--r--lib/kross/api/exception.cpp20
-rw-r--r--lib/kross/api/exception.h20
-rw-r--r--lib/kross/api/function.h2
-rw-r--r--lib/kross/api/interpreter.cpp22
-rw-r--r--lib/kross/api/interpreter.h42
-rw-r--r--lib/kross/api/list.cpp20
-rw-r--r--lib/kross/api/list.h42
-rw-r--r--lib/kross/api/module.h10
-rw-r--r--lib/kross/api/object.cpp14
-rw-r--r--lib/kross/api/object.h22
-rw-r--r--lib/kross/api/proxy.h10
-rw-r--r--lib/kross/api/qtobject.cpp116
-rw-r--r--lib/kross/api/qtobject.h50
-rw-r--r--lib/kross/api/script.h12
-rw-r--r--lib/kross/api/value.h4
-rw-r--r--lib/kross/api/variant.cpp110
-rw-r--r--lib/kross/api/variant.h82
-rw-r--r--lib/kross/main/krossconfig.cpp4
-rw-r--r--lib/kross/main/krossconfig.h8
-rw-r--r--lib/kross/main/mainmodule.cpp22
-rw-r--r--lib/kross/main/mainmodule.h46
-rw-r--r--lib/kross/main/manager.cpp94
-rw-r--r--lib/kross/main/manager.h28
-rw-r--r--lib/kross/main/scriptaction.cpp66
-rw-r--r--lib/kross/main/scriptaction.h49
-rw-r--r--lib/kross/main/scriptcontainer.cpp74
-rw-r--r--lib/kross/main/scriptcontainer.h40
-rw-r--r--lib/kross/main/scriptguiclient.cpp156
-rw-r--r--lib/kross/main/scriptguiclient.h45
-rw-r--r--lib/kross/main/wdgscriptsmanager.cpp110
-rw-r--r--lib/kross/main/wdgscriptsmanager.h7
-rw-r--r--lib/kross/main/wdgscriptsmanagerbase.ui22
-rw-r--r--lib/kross/python/cxx/Objects.hxx16
-rw-r--r--lib/kross/python/cxx/PyCXX.html14
-rw-r--r--lib/kross/python/cxx/cxxsupport.cxx2
-rw-r--r--lib/kross/python/pythonextension.cpp154
-rw-r--r--lib/kross/python/pythonextension.h54
-rw-r--r--lib/kross/python/pythoninterpreter.cpp36
-rw-r--r--lib/kross/python/pythoninterpreter.h2
-rw-r--r--lib/kross/python/pythonmodule.cpp18
-rw-r--r--lib/kross/python/pythonmodule.h2
-rw-r--r--lib/kross/python/pythonobject.cpp20
-rw-r--r--lib/kross/python/pythonobject.h12
-rw-r--r--lib/kross/python/pythonscript.cpp94
-rw-r--r--lib/kross/python/pythonscript.h10
-rw-r--r--lib/kross/python/pythonsecurity.cpp30
-rw-r--r--lib/kross/python/pythonsecurity.h10
-rw-r--r--lib/kross/python/scripts/RestrictedPython/Guards.py2
-rwxr-xr-xlib/kross/python/scripts/gui.py134
-rw-r--r--lib/kross/ruby/rubyextension.cpp92
-rw-r--r--lib/kross/ruby/rubyextension.h42
-rw-r--r--lib/kross/ruby/rubyinterpreter.cpp14
-rw-r--r--lib/kross/ruby/rubymodule.cpp8
-rw-r--r--lib/kross/ruby/rubymodule.h4
-rw-r--r--lib/kross/ruby/rubyscript.cpp16
-rw-r--r--lib/kross/ruby/rubyscript.h8
-rw-r--r--lib/kross/runner/main.cpp26
-rw-r--r--lib/kross/test/main.cpp36
-rw-r--r--lib/kross/test/testaction.cpp6
-rw-r--r--lib/kross/test/testaction.h9
-rw-r--r--lib/kross/test/testcase.py8
-rw-r--r--lib/kross/test/testgui.py28
-rw-r--r--lib/kross/test/testobject.cpp46
-rw-r--r--lib/kross/test/testobject.h35
-rw-r--r--lib/kross/test/testplugin.cpp28
-rw-r--r--lib/kross/test/testplugin.h30
-rw-r--r--lib/kross/test/testwindow.cpp48
-rw-r--r--lib/kross/test/testwindow.h15
82 files changed, 1490 insertions, 1484 deletions
diff --git a/lib/kross/api/callable.cpp b/lib/kross/api/callable.cpp
index 261a1bf0..a7a394ba 100644
--- a/lib/kross/api/callable.cpp
+++ b/lib/kross/api/callable.cpp
@@ -25,7 +25,7 @@
using namespace Kross::Api;
-Callable::Callable(const QString& name)
+Callable::Callable(const TQString& name)
: Object()
, m_name(name)
{
@@ -35,38 +35,38 @@ Callable::~Callable()
{
}
-const QString Callable::getName() const
+const TQString Callable::getName() const
{
return m_name;
}
-const QString Callable::getClassName() const
+const TQString Callable::getClassName() const
{
return "Kross::Api::Callable";
}
-bool Callable::hasChild(const QString& name) const
+bool Callable::hasChild(const TQString& name) const
{
- return m_children.contains(name);
+ return m_tqchildren.tqcontains(name);
}
-Object::Ptr Callable::getChild(const QString& name) const
+Object::Ptr Callable::getChild(const TQString& name) const
{
- return m_children[name];
+ return m_tqchildren[name];
}
-QMap<QString, Object::Ptr> Callable::getChildren() const
+TQMap<TQString, Object::Ptr> Callable::getChildren() const
{
- return m_children;
+ return m_tqchildren;
}
-bool Callable::addChild(const QString& name, Object* object)
+bool Callable::addChild(const TQString& name, Object* object)
{
#ifdef KROSS_API_OBJECT_ADDCHILD_DEBUG
- krossdebug( QString("Kross::Api::Callable::addChild() object.name='%1' object.classname='%2'")
- .arg(name).arg(object->getClassName()) );
+ krossdebug( TQString("Kross::Api::Callable::addChild() object.name='%1' object.classname='%2'")
+ .tqarg(name).tqarg(object->getClassName()) );
#endif
- m_children.replace(name, Object::Ptr(object));
+ m_tqchildren.tqreplace(name, Object::Ptr(object));
return true;
}
@@ -75,12 +75,12 @@ bool Callable::addChild(Callable* object)
return addChild(object->getName(), object);
}
-void Callable::removeChild(const QString& name)
+void Callable::removeChild(const TQString& name)
{
#ifdef KROSS_API_OBJECT_REMCHILD_DEBUG
- krossdebug( QString("Kross::Api::Callable::removeChild() name='%1'").arg(name) );
+ krossdebug( TQString("Kross::Api::Callable::removeChild() name='%1'").tqarg(name) );
#endif
- m_children.remove(name);
+ m_tqchildren.remove(name);
}
void Callable::removeAllChildren()
@@ -88,13 +88,13 @@ void Callable::removeAllChildren()
#ifdef KROSS_API_OBJECT_REMCHILD_DEBUG
krossdebug( "Kross::Api::Callable::removeAllChildren()" );
#endif
- m_children.clear();
+ m_tqchildren.clear();
}
-Object::Ptr Callable::call(const QString& name, List::Ptr args)
+Object::Ptr Callable::call(const TQString& name, List::Ptr args)
{
#ifdef KROSS_API_CALLABLE_CALL_DEBUG
- krossdebug( QString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").arg(name).arg(getName()).arg(args ? args->toString() : QString("")) );
+ krossdebug( TQString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").tqarg(name).tqarg(getName()).tqarg(args ? args->toString() : TQString("")) );
#endif
if(name.isEmpty()) // return a self-reference if no functionname is defined.
@@ -108,10 +108,10 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
}
if(name == "get") {
- QString s = Variant::toString(args->item(0));
+ TQString s = Variant::toString(args->item(0));
Object::Ptr obj = getChild(s);
if(! obj)
- throw Exception::Ptr( new Exception(QString("The object '%1' has no child object '%2'").arg(getName()).arg(s)) );
+ throw Exception::Ptr( new Exception(TQString("The object '%1' has no child object '%2'").tqarg(getName()).tqarg(s)) );
return obj;
}
else if(name == "has") {
@@ -122,10 +122,10 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
return Object::call(Variant::toString(args->item(0)), args);
}
else if(name == "list") {
- QStringList list;
- QMap<QString, Object::Ptr> children = getChildren();
- QMap<QString, Object::Ptr>::Iterator it( children.begin() );
- for(; it != children.end(); ++it)
+ TQStringList list;
+ TQMap<TQString, Object::Ptr> tqchildren = getChildren();
+ TQMap<TQString, Object::Ptr>::Iterator it( tqchildren.begin() );
+ for(; it != tqchildren.end(); ++it)
list.append( it.key() );
return new Variant(list);
}
@@ -134,6 +134,6 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
}
// If there exists no such object return NULL.
- krossdebug( QString("Object '%1' has no callable object named '%2'.").arg(getName()).arg(name) );
+ krossdebug( TQString("Object '%1' has no callable object named '%2'.").tqarg(getName()).tqarg(name) );
return 0;
}
diff --git a/lib/kross/api/callable.h b/lib/kross/api/callable.h
index 4d25bd91..63edb067 100644
--- a/lib/kross/api/callable.h
+++ b/lib/kross/api/callable.h
@@ -24,8 +24,8 @@
#include "list.h"
//#include "exception.h"
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* \param name The name this callable object has and
* it is reachable as via \a getChild() .
*/
- Callable(const QString& name);
+ Callable(const TQString& name);
/**
* Destructor.
@@ -63,7 +63,7 @@ namespace Kross { namespace Api {
* has a name which is used e.g. on \a addChild to be able
* to identify the object itself.
*/
- const QString getName() const;
+ const TQString getName() const;
/**
* Return the class name. This could be something
@@ -72,14 +72,14 @@ namespace Kross { namespace Api {
*
* \return The name of this class.
*/
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* Returns if the defined child is avaible.
*
* \return true if child exists else false.
*/
- bool hasChild(const QString& name) const;
+ bool hasChild(const TQString& name) const;
/**
* Return the defined child or NULL if there is
@@ -89,14 +89,14 @@ namespace Kross { namespace Api {
* \return The Object matching to the defined
* name or NULL if there is no such Object.
*/
- Object::Ptr getChild(const QString& name) const;
+ Object::Ptr getChild(const TQString& name) const;
/**
- * Return all children.
+ * Return all tqchildren.
*
- * \return A \a ObjectMap of children this Object has.
+ * \return A \a ObjectMap of tqchildren this Object has.
*/
- QMap<QString, Object::Ptr> getChildren() const;
+ TQMap<TQString, Object::Ptr> getChildren() const;
/**
* Add a new child. Replaces a possible already existing
@@ -107,7 +107,7 @@ namespace Kross { namespace Api {
* \return true if the Object was added successfully
* else false.
*/
- bool addChild(const QString& name, Object* object);
+ bool addChild(const TQString& name, Object* object);
/**
* Same as the \a addChild method above but for callable
@@ -122,23 +122,23 @@ namespace Kross { namespace Api {
* If there doesn't exists an Object with
* such name just nothing will be done.
*/
- void removeChild(const QString& name);
+ void removeChild(const TQString& name);
/**
- * Remove all children.
+ * Remove all tqchildren.
*/
void removeAllChildren();
/**
* Call the object.
*/
- virtual Object::Ptr call(const QString& name, List::Ptr arguments);
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments);
private:
/// Name this callable object has.
- QString m_name;
+ TQString m_name;
/// A list of childobjects.
- QMap<QString, Object::Ptr> m_children;
+ TQMap<TQString, Object::Ptr> m_tqchildren;
};
}}
diff --git a/lib/kross/api/class.h b/lib/kross/api/class.h
index afcfe425..de1d898c 100644
--- a/lib/kross/api/class.h
+++ b/lib/kross/api/class.h
@@ -20,10 +20,10 @@
#ifndef KROSS_API_CLASS_H
#define KROSS_API_CLASS_H
-#include <qstring.h>
-//#include <qvaluelist.h>
-//#include <qmap.h>
-#include <qobject.h>
+#include <tqstring.h>
+//#include <tqvaluelist.h>
+//#include <tqmap.h>
+#include <tqobject.h>
//#include "../main/krossconfig.h"
#include "object.h"
@@ -55,7 +55,7 @@ namespace Kross { namespace Api {
*
* \param name The name this class has.
*/
- Class(const QString& name)
+ Class(const TQString& name)
: Event<T>(name)
{
}
@@ -74,9 +74,9 @@ namespace Kross { namespace Api {
//operator Ptr () { return (T*)this; }
/*
- virtual Object::Ptr call(const QString& name, List::Ptr arguments)
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
{
- krossdebug( QString("Class::call(%1)").arg(name) );
+ krossdebug( TQString("Class::call(%1)").tqarg(name) );
return Event<T>::call(name, arguments);
}
*/
diff --git a/lib/kross/api/dict.cpp b/lib/kross/api/dict.cpp
index b9fa5ddc..7084c199 100644
--- a/lib/kross/api/dict.cpp
+++ b/lib/kross/api/dict.cpp
@@ -22,8 +22,8 @@
using namespace Kross::Api;
-Dict::Dict(const QMap<QString, Object::Ptr> value)
- : Value< List, QMap<QString, Object::Ptr> >(value)
+Dict::Dict(const TQMap<TQString, Object::Ptr> value)
+ : Value< List, TQMap<TQString, Object::Ptr> >(value)
{
}
@@ -31,16 +31,16 @@ Dict::~Dict()
{
}
-const QString Dict::getClassName() const
+const TQString Dict::getClassName() const
{
return "Kross::Api::Dict";
}
-const QString Dict::toString()
+const TQString Dict::toString()
{
- QString s = "[";
- QMap<QString, Object::Ptr> list = getValue();
- for(QMap<QString, Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
+ TQString s = "[";
+ TQMap<TQString, Object::Ptr> list = getValue();
+ for(TQMap<TQString, Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
s += "'" + it.key() + "' = '" + it.data()->toString() + "', ";
return (s.endsWith(", ") ? s.left(s.length() - 2) : s) + "]";
}
diff --git a/lib/kross/api/dict.h b/lib/kross/api/dict.h
index 773f36ac..80619448 100644
--- a/lib/kross/api/dict.h
+++ b/lib/kross/api/dict.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_DICT_H
#define KROSS_API_DICT_H
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include "object.h"
#include "value.h"
@@ -32,9 +32,9 @@ namespace Kross { namespace Api {
* The Dict class implementates \a Value to handle
* key=value base dictonaries/maps.
*/
- class Dict : public Value< List, QMap<QString, Object::Ptr> >
+ class Dict : public Value< List, TQMap<TQString, Object::Ptr> >
{
- friend class Value< List, QMap<QString, Object::Ptr> >;
+ friend class Value< List, TQMap<TQString, Object::Ptr> >;
public:
/**
@@ -44,7 +44,7 @@ namespace Kross { namespace Api {
* via there string-identifier that is in this
* \a Dict intialy.
*/
- explicit Dict(const QMap<QString, Object::Ptr> value);
+ explicit Dict(const TQMap<TQString, Object::Ptr> value);
/**
* Destructor.
@@ -52,14 +52,14 @@ namespace Kross { namespace Api {
virtual ~Dict();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the whole dictonary.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
};
diff --git a/lib/kross/api/event.h b/lib/kross/api/event.h
index 2df5a331..e378052b 100644
--- a/lib/kross/api/event.h
+++ b/lib/kross/api/event.h
@@ -29,9 +29,9 @@
#include "proxy.h"
#include "variant.h"
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
namespace Kross { namespace Api {
@@ -39,7 +39,7 @@ namespace Kross { namespace Api {
* Template class for all kinds of callable events. An
* event is the abstract base for callable objects like
* methodfunctions in \a Class instances or \a EventSlot
- * and \a EventSignal to access Qt signals and slots.
+ * and \a EventSignal to access TQt signals and slots.
*/
template<class T>
class Event : public Callable
@@ -55,7 +55,7 @@ namespace Kross { namespace Api {
* List of memberfunctions. Each function is accessible
* by the functionname.
*/
- QMap<QString, Function* > m_functions;
+ TQMap<TQString, Function* > m_functions;
public:
@@ -64,7 +64,7 @@ namespace Kross { namespace Api {
*
* \param name The name this \a Event has.
*/
- Event(const QString& name)
+ Event(const TQString& name)
: Callable(name)
{
}
@@ -74,8 +74,8 @@ namespace Kross { namespace Api {
*/
virtual ~Event()
{
- QMapConstIterator<QString, Function* > endit = m_functions.constEnd();
- for(QMapConstIterator<QString, Function* > it = m_functions.constBegin(); it != endit; ++it)
+ TQMapConstIterator<TQString, Function* > endit = m_functions.constEnd();
+ for(TQMapConstIterator<TQString, Function* > it = m_functions.constBegin(); it != endit; ++it)
delete it.data();
}
@@ -95,9 +95,9 @@ namespace Kross { namespace Api {
*
* \todo Remove this method as soon as there is no code using it
*/
- inline void addFunction(const QString& name, FunctionPtr function)
+ inline void addFunction(const TQString& name, FunctionPtr function)
{
- m_functions.replace(name, new Function0<T>(static_cast<T*>(this), function));
+ m_functions.tqreplace(name, new Function0<T>(static_cast<T*>(this), function));
}
/**
@@ -112,9 +112,9 @@ namespace Kross { namespace Api {
* owner of the \a Function instance and will take
* care of deleting it if this \a Event got deleted.
*/
- inline void addFunction(const QString& name, Function* function)
+ inline void addFunction(const TQString& name, Function* function)
{
- m_functions.replace(name, function);
+ m_functions.tqreplace(name, function);
}
/**
@@ -122,9 +122,9 @@ namespace Kross { namespace Api {
* to this \a Event instance.
*/
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
- inline void addFunction4(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0, ARG4OBJ* arg4 = 0)
+ inline void addFunction4(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0, ARG4OBJ* arg4 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ, ARG3OBJ, ARG4OBJ>
(instance, method, arg1, arg2, arg3, arg4)
);
@@ -132,9 +132,9 @@ namespace Kross { namespace Api {
/// Same as above with three arguments.
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
- inline void addFunction3(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0)
+ inline void addFunction3(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ, ARG3OBJ>
(instance, method, arg1, arg2, arg3)
);
@@ -142,9 +142,9 @@ namespace Kross { namespace Api {
/// Same as above with two arguments.
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
- inline void addFunction2(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0)
+ inline void addFunction2(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ>
(instance, method, arg1, arg2)
);
@@ -152,9 +152,9 @@ namespace Kross { namespace Api {
/// Same as above, but with one argument.
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
- inline void addFunction1(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0)
+ inline void addFunction1(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ>
(instance, method, arg1)
);
@@ -162,9 +162,9 @@ namespace Kross { namespace Api {
/// Same as above with no arguments.
template<class RETURNOBJ, class INSTANCE, typename METHOD>
- inline void addFunction0(const QString& name, INSTANCE* instance, METHOD method)
+ inline void addFunction0(const TQString& name, INSTANCE* instance, METHOD method)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ>
(instance, method)
);
@@ -175,9 +175,9 @@ namespace Kross { namespace Api {
* \param name the function name
* \return true if the function is available in this \a Callable
*/
- bool isAFunction(const QString & name) const
+ bool isAFunction(const TQString & name) const
{
- return m_functions.contains(name);
+ return m_functions.tqcontains(name);
}
/**
@@ -190,7 +190,7 @@ namespace Kross { namespace Api {
* \param name The functionname. Each function this
* Object holds should have a different
* name cause they are access by they name.
- * If name is QString::null or empty, a
+ * If name is TQString() or empty, a
* self-reference to this instance is
* returned.
* \param arguments The list of arguments.
@@ -198,16 +198,16 @@ namespace Kross { namespace Api {
* or NULL if there doesn't exists such a
* function with defined name.
*/
- virtual Object::Ptr call(const QString& name, List::Ptr arguments)
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
{
#ifdef KROSS_API_EVENT_CALL_DEBUG
- krossdebug( QString("Event::call() name='%1' getName()='%2'").arg(name).arg(getName()) );
+ krossdebug( TQString("Event::call() name='%1' getName()='%2'").tqarg(name).tqarg(getName()) );
#endif
Function* function = m_functions[name];
if(function) {
#ifdef KROSS_API_EVENT_CALL_DEBUG
- krossdebug( QString("Event::call() name='%1' is a builtin function.").arg(name) );
+ krossdebug( TQString("Event::call() name='%1' is a builtin function.").tqarg(name) );
#endif
return function->call(arguments);
}
diff --git a/lib/kross/api/eventaction.cpp b/lib/kross/api/eventaction.cpp
index fffaec5c..4210fb0e 100644
--- a/lib/kross/api/eventaction.cpp
+++ b/lib/kross/api/eventaction.cpp
@@ -20,13 +20,13 @@
#include "eventaction.h"
#include "variant.h"
-//#include <qobject.h>
+//#include <tqobject.h>
//#include <kaction.h>
using namespace Kross::Api;
-EventAction::EventAction(const QString& name, KAction* action)
- : Event<EventAction>(name.isEmpty() ? action->name() : name)
+EventAction::EventAction(const TQString& name, KAction* action)
+ : Event<EventAction>(name.isEmpty() ? TQString(action->name()) : name)
, m_action(action)
{
addFunction("getText", &EventAction::getText);
@@ -42,7 +42,7 @@ EventAction::~EventAction()
{
}
-const QString EventAction::getClassName() const
+const TQString EventAction::getClassName() const
{
return "Kross::Api::EventAction";
}
diff --git a/lib/kross/api/eventaction.h b/lib/kross/api/eventaction.h
index 8f09c116..659240fa 100644
--- a/lib/kross/api/eventaction.h
+++ b/lib/kross/api/eventaction.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTACTION_H
#define KROSS_API_EVENTACTION_H
-#include <qstring.h>
-//#include <qobject.h>
+#include <tqstring.h>
+//#include <tqobject.h>
#include <kaction.h>
#include <ksharedptr.h>
@@ -50,7 +50,7 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventAction(const QString& name, KAction* action);
+ EventAction(const TQString& name, KAction* action);
/**
* Destructor.
@@ -58,10 +58,10 @@ namespace Kross { namespace Api {
virtual ~EventAction();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Event::call()
- //virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ //virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
private:
KAction* m_action;
diff --git a/lib/kross/api/eventscript.cpp b/lib/kross/api/eventscript.cpp
index 39ceb59d..43c4c1cb 100644
--- a/lib/kross/api/eventscript.cpp
+++ b/lib/kross/api/eventscript.cpp
@@ -24,7 +24,7 @@
using namespace Kross::Api;
-EventScript::EventScript(const QString& name)
+EventScript::EventScript(const TQString& name)
: Event<EventScript>(name)
{
}
@@ -33,14 +33,14 @@ EventScript::~EventScript()
{
}
-const QString EventScript::getClassName() const
+const TQString EventScript::getClassName() const
{
return "Kross::Api::EventScript";
}
-Object::Ptr EventScript::call(const QString& name, KSharedPtr<List> arguments)
+Object::Ptr EventScript::call(const TQString& name, KSharedPtr<List> arguments)
{
- krossdebug( QString("EventScript::call() name=%1 arguments=%2").arg(name).arg(arguments->toString()) );
+ krossdebug( TQString("EventScript::call() name=%1 arguments=%2").tqarg(name).tqarg(arguments->toString()) );
//TODO
return 0;
}
diff --git a/lib/kross/api/eventscript.h b/lib/kross/api/eventscript.h
index 8ef9b7eb..0f62ddfc 100644
--- a/lib/kross/api/eventscript.h
+++ b/lib/kross/api/eventscript.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTSCRIPT_H
#define KROSS_API_EVENTSCRIPT_H
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include "event.h"
@@ -43,16 +43,16 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventScript(const QString& name);
+ EventScript(const TQString& name);
/**
* Destructor.
*/
virtual ~EventScript();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
private:
//ScriptContainer* m_scriptcontainer;
diff --git a/lib/kross/api/eventsignal.cpp b/lib/kross/api/eventsignal.cpp
index 455ca61f..c3e94620 100644
--- a/lib/kross/api/eventsignal.cpp
+++ b/lib/kross/api/eventsignal.cpp
@@ -22,15 +22,15 @@
#include "variant.h"
#include "qtobject.h"
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-EventSignal::EventSignal(const QString& name, QObject* sender, QCString signal)
+EventSignal::EventSignal(const TQString& name, TQObject* sender, TQCString signal)
: Event<EventSignal>(name)
, m_sender(sender)
- , m_signal(signal) //QObject::normalizeSignalSlot(signal)
+ , m_signal(signal) //TQObject::normalizeSignalSlot(signal)
{
}
@@ -38,29 +38,29 @@ EventSignal::~EventSignal()
{
}
-const QString EventSignal::getClassName() const
+const TQString EventSignal::getClassName() const
{
return "Kross::Api::EventSignal";
}
-Object::Ptr EventSignal::call(const QString& /*name*/, KSharedPtr<List> arguments)
+Object::Ptr EventSignal::call(const TQString& /*name*/, KSharedPtr<List> arguments)
{
#ifdef KROSS_API_EVENTSIGNAL_CALL_DEBUG
- krossdebug( QString("EventSignal::call() m_signal=%1 arguments=%2").arg(m_signal).arg(arguments->toString()) );
+ krossdebug( TQString("EventSignal::call() m_signal=%1 arguments=%2").tqarg(m_signal).tqarg(arguments->toString()) );
#endif
- QString n = m_signal;
+ TQString n = m_signal;
if(n.startsWith("2")) // Remove prefix of SIGNAL-macros
n.remove(0,1);
- int signalid = m_sender->metaObject()->findSignal(n.latin1(), false);
+ int signalid = m_sender->tqmetaObject()->tqfindSignal(n.latin1(), false);
if(signalid < 0)
- throw new Exception(QString("No such signal '%1'.").arg(n));
+ throw new Exception(TQString("No such signal '%1'.").tqarg(n));
- QUObject* uo = QtObject::toQUObject(n, arguments);
+ TQUObject* uo = QtObject::toTQUObject(n, arguments);
m_sender->qt_emit(signalid, uo); // emit the signal
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
diff --git a/lib/kross/api/eventsignal.h b/lib/kross/api/eventsignal.h
index aea58b12..6117014e 100644
--- a/lib/kross/api/eventsignal.h
+++ b/lib/kross/api/eventsignal.h
@@ -20,13 +20,13 @@
#ifndef KROSS_API_EVENTSIGNAL_H
#define KROSS_API_EVENTSIGNAL_H
-//#include <qstring.h>
-//#include <qvaluelist.h>
-//#include <qmap.h>
-//#include <qvariant.h>
-//#include <qsignalmapper.h>
-//#include <qguardedptr.h>
-#include <qobject.h>
+//#include <tqstring.h>
+//#include <tqvaluelist.h>
+//#include <tqmap.h>
+//#include <tqvariant.h>
+//#include <tqsignalmapper.h>
+//#include <tqguardedptr.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "event.h"
@@ -34,7 +34,7 @@
namespace Kross { namespace Api {
/**
- * Each Qt signal and slot connection between a QObject
+ * Each TQt signal and slot connection between a TQObject
* instance and a functionname is represented with
* a EventSignal and handled by \a EventManager.
*/
@@ -50,27 +50,27 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventSignal(const QString& name, QObject* sender, QCString signal);
+ EventSignal(const TQString& name, TQObject* sender, TQCString signal);
/**
* Destructor.
*/
virtual ~EventSignal();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/*
signals:
void callback();
- void callback(const QString&);
+ void callback(const TQString&);
void callback(int);
void callback(bool);
*/
private:
- QObject* m_sender;
- QCString m_signal;
+ TQObject* m_sender;
+ TQCString m_signal;
};
}}
diff --git a/lib/kross/api/eventslot.cpp b/lib/kross/api/eventslot.cpp
index df70c9c8..fed92ea0 100644
--- a/lib/kross/api/eventslot.cpp
+++ b/lib/kross/api/eventslot.cpp
@@ -22,15 +22,15 @@
#include "variant.h"
#include "qtobject.h"
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-EventSlot::EventSlot(const QString& name, QObject* receiver, QCString slot)
+EventSlot::EventSlot(const TQString& name, TQObject* receiver, TQCString slot)
: Event<EventSlot>(name)
, m_receiver(receiver)
- , m_slot(slot) //QObject::normalizeSignalSlot(slot)
+ , m_slot(slot) //TQObject::normalizeSignalSlot(slot)
{
}
@@ -38,75 +38,75 @@ EventSlot::~EventSlot()
{
}
-const QString EventSlot::getClassName() const
+const TQString EventSlot::getClassName() const
{
return "Kross::Api::EventSlot";
}
-Object::Ptr EventSlot::call(const QString& /*name*/, List::Ptr arguments)
+Object::Ptr EventSlot::call(const TQString& /*name*/, List::Ptr arguments)
{
#ifdef KROSS_API_EVENTSLOT_CALL_DEBUG
- krossdebug( QString("EventSlot::call() m_slot=%1 arguments=%2").arg(m_slot).arg(arguments->toString()) );
+ krossdebug( TQString("EventSlot::call() m_slot=%1 arguments=%2").tqarg(m_slot).tqarg(arguments->toString()) );
#endif
- QString n = m_slot; //TODO name; //Variant::toString(args->item(0));
+ TQString n = m_slot; //TODO name; //Variant::toString(args->item(0));
if(n.startsWith("1")) // Remove prefix of SLOT-macros
n.remove(0,1);
- int slotid = m_receiver->metaObject()->findSlot(n.latin1(), false);
+ int slotid = m_receiver->tqmetaObject()->tqfindSlot(n.latin1(), false);
if(slotid < 0)
- throw Exception::Ptr( new Exception(QString("No such slot '%1'.").arg(n)) );
+ throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(n)) );
- QUObject* uo = QtObject::toQUObject(n, arguments);
+ TQUObject* uo = QtObject::toTQUObject(n, arguments);
m_receiver->qt_invoke(slotid, uo); // invoke the slot
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
/*
-QCString EventSlot::getSlot(const QCString& signal)
+TQCString EventSlot::getSlot(const TQCString& signal)
{
- QString signature = QString(signal).mid(1);
- int startpos = signature.find("(");
- int endpos = signature.findRev(")");
+ TQString signature = TQString(signal).mid(1);
+ int startpos = signature.tqfind("(");
+ int endpos = signature.tqfindRev(")");
if(startpos < 0 || startpos > endpos) {
- krosswarning( QString("EventSlot::getSlot(%1) Invalid signal.").arg(signal) );
- return QCString();
+ krosswarning( TQString("EventSlot::getSlot(%1) Invalid signal.").tqarg(signal) );
+ return TQCString();
}
- QString signalname = signature.left(startpos);
- QString params = signature.mid(startpos + 1, endpos - startpos - 1);
- //QStringList paramlist = QStringList::split(",", params);
- QCString slot = QString("callback(" + params + ")").latin1(); //normalizeSignalSlot();
+ TQString signalname = signature.left(startpos);
+ TQString params = signature.mid(startpos + 1, endpos - startpos - 1);
+ //TQStringList paramlist = TQStringList::split(",", params);
+ TQCString slot = TQString("callback(" + params + ")").latin1(); //normalizeSignalSlot();
- QMetaObject* mo = metaObject();
+ TQMetaObject* mo = tqmetaObject();
int slotid = mo->findSlot(slot, false);
if(slotid < 0) {
- krossdebug( QString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").arg(signal).arg(slot) );
- return QCString();
+ krossdebug( TQString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").tqarg(signal).tqarg(slot) );
+ return TQCString();
}
- const QMetaData* md = mo->slot(slotid, false);
- if(md->access != QMetaData::Public) {
- krossdebug( QString("EventSlot::getSlot(%1) The slot '%2' is not public.").arg(signal).arg(slot) );
- return QCString();
+ const TQMetaData* md = mo->slot(slotid, false);
+ if(md->access != TQMetaData::Public) {
+ krossdebug( TQString("EventSlot::getSlot(%1) The slot '%2' is not public.").tqarg(signal).tqarg(slot) );
+ return TQCString();
}
-//QMember* member = md->member;
-//const QUMethod *method = md->method;
+//TQMember* member = md->member;
+//const TQUMethod *method = md->method;
- krossdebug( QString("signal=%1 slot=%2 slotid=%3 params=%4 mdname=%5")
- .arg(signal).arg(slot).arg(slotid).arg(params).arg(md->name) );
- return QCString("1" + slot); // Emulate the SLOT(...) macro by adding as first char a "1".
+ krossdebug( TQString("signal=%1 slot=%2 slotid=%3 params=%4 mdname=%5")
+ .tqarg(signal).tqarg(slot).tqarg(slotid).tqarg(params).tqarg(md->name) );
+ return TQCString("1" + slot); // Emulate the TQT_SLOT(...) macro by adding as first char a "1".
}
-bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QCString& signal, QString function, const QCString& slot)
+bool EventSlot::connect(EventManager* eventmanager, TQObject* senderobj, const TQCString& signal, TQString function, const TQCString& slot)
{
if(m_sender && ! disconnect())
return false;
- const QCString& myslot = slot.isEmpty() ? getSlot(signal) : slot;
+ const TQCString& myslot = slot.isEmpty() ? getSlot(signal) : slot;
if(! myslot)
return false;
@@ -114,18 +114,18 @@ bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QC
EventSlot* eventslot = create(eventmanager);
eventslot->connect(eventmanager, senderobj, signal, function, slot);
m_slots.append(eventslot);
- krossdebug( QString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").arg(senderobj->name()).arg(signal).arg(function) );
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
}
else {
m_sender = senderobj;
m_signal = signal;
m_function = function;
m_slot = myslot;
- if(! QObject::connect((QObject*)senderobj, signal, this, myslot)) {
- krossdebug( QString("EventSlot::connect(%1, %2, %3) failed.").arg(senderobj->name()).arg(signal).arg(function) );
+ if(! TQObject::connect((TQObject*)senderobj, signal, this, myslot)) {
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) failed.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
return false;
}
- krossdebug( QString("EventSlot::connect(%1, %2, %3) successfully connected.").arg(senderobj->name()).arg(signal).arg(function) );
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) successfully connected.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
}
return true;
}
@@ -133,22 +133,22 @@ bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QC
bool EventSlot::disconnect()
{
if(! m_sender) return false;
- QObject::disconnect((QObject*)m_sender, m_signal, this, m_slot);
+ TQObject::disconnect((TQObject*)m_sender, m_signal, this, m_slot);
m_sender = 0;
m_signal = 0;
m_slot = 0;
- m_function = QString::null;
+ m_function = TQString();
return true;
}
-void EventSlot::call(const QVariant& variant)
+void EventSlot::call(const TQVariant& variant)
{
- krossdebug( QString("EventSlot::call() sender='%1' signal='%2' function='%3'")
- .arg(m_sender->name()).arg(m_signal).arg(m_function) );
+ krossdebug( TQString("EventSlot::call() sender='%1' signal='%2' function='%3'")
+ .tqarg(m_sender->name()).tqarg(m_signal).tqarg(m_function) );
Kross::Api::List* arglist = 0;
- QValueList<Kross::Api::Object*> args;
+ TQValueList<Kross::Api::Object*> args;
if(variant.isValid()) {
args.append(Kross::Api::Variant::create(variant));
arglist = Kross::Api::List::create(args);
@@ -159,64 +159,64 @@ void EventSlot::call(const QVariant& variant)
}
catch(Exception& e) {
//TODO add hadError(), getError() and setError()
- krossdebug( QString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").arg(variant.toString()).arg(e.type()).arg(e.description()) );
+ krossdebug( TQString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").tqarg(variant.toString()).tqarg(e.type()).tqarg(e.description()) );
}
}
void EventSlot::callback() {
- call(QVariant()); }
+ call(TQVariant()); }
void EventSlot::callback(short s) {
- call(QVariant(s)); }
+ call(TQVariant(s)); }
void EventSlot::callback(int i) {
- call(QVariant(i)); }
+ call(TQVariant(i)); }
void EventSlot::callback(int i1, int i2) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 )); }
void EventSlot::callback(int i1, int i2, int i3) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4, int i5) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 << i5 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 << i5 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 << b )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 << b )); }
void EventSlot::callback(int i1, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << b )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << b )); }
void EventSlot::callback(int i1, int i2, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << b )); }
-void EventSlot::callback(int i1, int i2, const QString& s) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << s )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << b )); }
+void EventSlot::callback(int i1, int i2, const TQString& s) {
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << s )); }
void EventSlot::callback(uint i) {
- call(QVariant(i)); }
+ call(TQVariant(i)); }
void EventSlot::callback(long l) {
- call(QVariant((Q_LLONG)l)); }
+ call(TQVariant((TQ_LLONG)l)); }
void EventSlot::callback(ulong l) {
- call(QVariant((Q_ULLONG)l)); }
+ call(TQVariant((TQ_ULLONG)l)); }
void EventSlot::callback(double d) {
- call(QVariant(d)); }
+ call(TQVariant(d)); }
void EventSlot::callback(const char* c) {
- call(QVariant(c)); }
+ call(TQVariant(c)); }
void EventSlot::callback(bool b) {
- call(QVariant(b)); }
-void EventSlot::callback(const QString& s) {
- call(QVariant(s)); }
-void EventSlot::callback(const QString& s, int i) {
- call(QVariant( QValueList<QVariant>() << s << i )); }
-void EventSlot::callback(const QString& s, int i1, int i2) {
- call(QVariant( QValueList<QVariant>() << s << i1 << i2 )); }
-void EventSlot::callback(const QString& s, uint i) {
- call(QVariant( QValueList<QVariant>() << s << i )); }
-void EventSlot::callback(const QString& s, bool b) {
- call(QVariant( QValueList<QVariant>() << s << b )); }
-void EventSlot::callback(const QString& s, bool b1, bool b2) {
- call(QVariant( QValueList<QVariant>() << s << b1 << b2 )); }
-void EventSlot::callback(const QString& s, bool b, int i) {
- call(QVariant( QValueList<QVariant>() << s << b << i )); }
-void EventSlot::callback(const QString& s1, const QString& s2) {
- call(QVariant( QValueList<QVariant>() << s1 << s2 )); }
-void EventSlot::callback(const QString& s1, const QString& s2, const QString& s3) {
- call(QVariant( QValueList<QVariant>() << s1 << s2 << s3 )); }
-void EventSlot::callback(const QStringList& sl) {
- call(QVariant(sl)); }
-void EventSlot::callback(const QVariant& variant) {
+ call(TQVariant(b)); }
+void EventSlot::callback(const TQString& s) {
+ call(TQVariant(s)); }
+void EventSlot::callback(const TQString& s, int i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i )); }
+void EventSlot::callback(const TQString& s, int i1, int i2) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i1 << i2 )); }
+void EventSlot::callback(const TQString& s, uint i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i )); }
+void EventSlot::callback(const TQString& s, bool b) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b )); }
+void EventSlot::callback(const TQString& s, bool b1, bool b2) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b1 << b2 )); }
+void EventSlot::callback(const TQString& s, bool b, int i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b << i )); }
+void EventSlot::callback(const TQString& s1, const TQString& s2) {
+ call(TQVariant( TQValueList<TQVariant>() << s1 << s2 )); }
+void EventSlot::callback(const TQString& s1, const TQString& s2, const TQString& s3) {
+ call(TQVariant( TQValueList<TQVariant>() << s1 << s2 << s3 )); }
+void EventSlot::callback(const TQStringList& sl) {
+ call(TQVariant(sl)); }
+void EventSlot::callback(const TQVariant& variant) {
call(variant); }
*/
diff --git a/lib/kross/api/eventslot.h b/lib/kross/api/eventslot.h
index 8f564103..f9736fd0 100644
--- a/lib/kross/api/eventslot.h
+++ b/lib/kross/api/eventslot.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTSLOT_H
#define KROSS_API_EVENTSLOT_H
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "event.h"
@@ -29,7 +29,7 @@
namespace Kross { namespace Api {
/**
- * Each Qt signal and slot connection between a QObject
+ * Each TQt signal and slot connection between a TQObject
* instance and a functionname is represented with
* a EventSlot and handled by the \a EventManager.
*/
@@ -47,12 +47,12 @@ namespace Kross { namespace Api {
*
* \param name The name of the EventSlot. The EventSlot
* will be accessible by that unique name via
- * it's parent.
+ * it's tqparent.
* \param receiver The receiver of the event.
* \param slot The slot of the receiver which this
* EventSlot points to.
*/
- EventSlot(const QString& name, QObject* receiver, QCString slot);
+ EventSlot(const TQString& name, TQObject* receiver, TQCString slot);
/**
* Destructor.
@@ -60,21 +60,21 @@ namespace Kross { namespace Api {
virtual ~EventSlot();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Event::call()
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/*
private:
EventManager* m_eventmanager;
- QGuardedPtr<QObject> m_sender;
- QCString m_signal;
- QCString m_slot;
- QString m_function;
- QValueList<EventSlot*> m_slots;
+ TQGuardedPtr<TQObject> m_sender;
+ TQCString m_signal;
+ TQCString m_slot;
+ TQString m_function;
+ TQValueList<EventSlot*> m_slots;
protected:
- void call(const QVariant&);
+ void call(const TQVariant&);
public slots:
// Stupid signals and slots. To get the passed
// arguments we need to have all cases of slots
@@ -89,32 +89,32 @@ namespace Kross { namespace Api {
void callback(int, int, int, int, bool);
void callback(int, bool);
void callback(int, int, bool);
- void callback(int, int, const QString&);
+ void callback(int, int, const TQString&);
void callback(uint);
void callback(long);
void callback(ulong);
void callback(double);
void callback(const char*);
void callback(bool);
- void callback(const QString&);
- void callback(const QString&, int);
- void callback(const QString&, int, int);
- void callback(const QString&, uint);
- void callback(const QString&, bool);
- void callback(const QString&, bool, bool);
- void callback(const QString&, bool, int);
- void callback(const QString&, const QString&);
- void callback(const QString&, const QString&, const QString&);
- void callback(const QStringList&);
- void callback(const QVariant&);
+ void callback(const TQString&);
+ void callback(const TQString&, int);
+ void callback(const TQString&, int, int);
+ void callback(const TQString&, uint);
+ void callback(const TQString&, bool);
+ void callback(const TQString&, bool, bool);
+ void callback(const TQString&, bool, int);
+ void callback(const TQString&, const TQString&);
+ void callback(const TQString&, const TQString&, const TQString&);
+ void callback(const TQStringList&);
+ void callback(const TQVariant&);
// The following both slots are more generic to
// handle Kross::Api::Object instances.
//void callback(Kross::Api::Object*);
//void callback(Kross::Api::List*);
*/
private:
- QObject* m_receiver;
- QCString m_slot;
+ TQObject* m_receiver;
+ TQCString m_slot;
};
}}
diff --git a/lib/kross/api/exception.cpp b/lib/kross/api/exception.cpp
index a54bae88..c6a0198f 100644
--- a/lib/kross/api/exception.cpp
+++ b/lib/kross/api/exception.cpp
@@ -20,46 +20,46 @@
#include "object.h"
#include "exception.h"
-//#include <qstring.h>
+//#include <tqstring.h>
//#include <ksharedptr.h>
using namespace Kross::Api;
-Exception::Exception(const QString& error, long lineno)
+Exception::Exception(const TQString& error, long lineno)
: Object()
, m_error(error)
, m_lineno(lineno)
{
- krosswarning( QString("Kross::Api::Exception error='%1' lineno='%3'").arg(m_error).arg(m_lineno) );
+ krosswarning( TQString("Kross::Api::Exception error='%1' lineno='%3'").tqarg(m_error).tqarg(m_lineno) );
}
Exception::~Exception()
{
}
-const QString Exception::getClassName() const
+const TQString Exception::getClassName() const
{
return "Kross::Api::Exception";
}
-const QString Exception::toString()
+const TQString Exception::toString()
{
return (m_lineno != -1)
- ? QString("Exception at line %1: %2").arg(m_lineno).arg(m_error)
- : QString("Exception: %1").arg(m_error);
+ ? TQString("Exception at line %1: %2").tqarg(m_lineno).tqarg(m_error)
+ : TQString("Exception: %1").tqarg(m_error);
}
-const QString Exception::getError() const
+const TQString Exception::getError() const
{
return m_error;
}
-const QString Exception::getTrace() const
+const TQString Exception::getTrace() const
{
return m_trace;
}
-void Exception::setTrace(const QString& tracemessage)
+void Exception::setTrace(const TQString& tracemessage)
{
m_trace = tracemessage;
}
diff --git a/lib/kross/api/exception.h b/lib/kross/api/exception.h
index 6ee9597b..b0699bfb 100644
--- a/lib/kross/api/exception.h
+++ b/lib/kross/api/exception.h
@@ -22,7 +22,7 @@
#include "object.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* \param lineno The liner number in the scripting
* code where this exception got thrown.
*/
- Exception(const QString& error, long lineno = -1);
+ Exception(const TQString& error, long lineno = -1);
/**
* Destructor.
@@ -59,26 +59,26 @@ namespace Kross { namespace Api {
virtual ~Exception();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Object::toString()
- virtual const QString toString();
+ virtual const TQString toString();
/**
* \return the error message.
*/
- const QString getError() const;
+ const TQString getError() const;
/**
- * \return a more detailed tracemessage or QString::null if
+ * \return a more detailed tracemessage or TQString() if
* there is no trace avaiable.
*/
- const QString getTrace() const;
+ const TQString getTrace() const;
/**
* Set a more detailed tracemessage.
*/
- void setTrace(const QString& tracemessage);
+ void setTrace(const TQString& tracemessage);
/**
* \return the line number in the scripting code
@@ -89,9 +89,9 @@ namespace Kross { namespace Api {
private:
/// The error message.
- QString m_error;
+ TQString m_error;
/// The trace message.
- QString m_trace;
+ TQString m_trace;
/// The line number where the exception got thrown
long m_lineno;
};
diff --git a/lib/kross/api/function.h b/lib/kross/api/function.h
index 6b75752a..edfab094 100644
--- a/lib/kross/api/function.h
+++ b/lib/kross/api/function.h
@@ -24,7 +24,7 @@
#include "object.h"
#include "list.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Api {
diff --git a/lib/kross/api/interpreter.cpp b/lib/kross/api/interpreter.cpp
index 439063cd..c6796e1f 100644
--- a/lib/kross/api/interpreter.cpp
+++ b/lib/kross/api/interpreter.cpp
@@ -35,7 +35,7 @@ using namespace Kross::Api;
* InterpreterInfo
*/
-InterpreterInfo::InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options)
+InterpreterInfo::InterpreterInfo(const TQString& interpretername, const TQString& library, const TQString& wildcard, TQStringList mimetypes, Option::Map options)
: m_interpretername(interpretername)
, m_library(library)
, m_wildcard(wildcard)
@@ -54,32 +54,32 @@ InterpreterInfo::~InterpreterInfo()
m_interpreter = 0;
}
-const QString InterpreterInfo::getInterpretername()
+const TQString InterpreterInfo::getInterpretername()
{
return m_interpretername;
}
-const QString InterpreterInfo::getWildcard()
+const TQString InterpreterInfo::getWildcard()
{
return m_wildcard;
}
-const QStringList InterpreterInfo::getMimeTypes()
+const TQStringList InterpreterInfo::getMimeTypes()
{
return m_mimetypes;
}
-bool InterpreterInfo::hasOption(const QString& key)
+bool InterpreterInfo::hasOption(const TQString& key)
{
- return m_options.contains(key);
+ return m_options.tqcontains(key);
}
-InterpreterInfo::Option* InterpreterInfo::getOption(const QString name)
+InterpreterInfo::Option* InterpreterInfo::getOption(const TQString name)
{
return m_options[name];
}
-const QVariant InterpreterInfo::getOptionValue(const QString name, QVariant defaultvalue)
+const TQVariant InterpreterInfo::getOptionValue(const TQString name, TQVariant defaultvalue)
{
Option* o = m_options[name];
return o ? o->value : defaultvalue;
@@ -95,7 +95,7 @@ Interpreter* InterpreterInfo::getInterpreter()
if(m_interpreter) // buffered
return m_interpreter;
- krossdebug( QString("Loading the interpreter library for %1").arg(m_interpretername) );
+ krossdebug( TQString("Loading the interpreter library for %1").tqarg(m_interpretername) );
// Load the krosspython library.
KLibLoader *libloader = KLibLoader::self();
@@ -104,10 +104,10 @@ Interpreter* InterpreterInfo::getInterpreter()
if(! library) {
/*
setException(
- new Exception( QString("Could not load library \"%1\" for the \"%2\" interpreter.").arg(m_library).arg(m_interpretername) )
+ new Exception( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").tqarg(m_library).tqarg(m_interpretername) )
);
*/
- krosswarning( QString("Could not load library \"%1\" for the \"%2\" interpreter.").arg(m_library).arg(m_interpretername) );
+ krosswarning( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").tqarg(m_library).tqarg(m_interpretername) );
return 0;
}
diff --git a/lib/kross/api/interpreter.h b/lib/kross/api/interpreter.h
index 5c73c303..443585e3 100644
--- a/lib/kross/api/interpreter.h
+++ b/lib/kross/api/interpreter.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_INTERPRETER_H
#define KROSS_API_INTERPRETER_H
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include "object.h"
@@ -53,7 +53,7 @@ namespace Kross { namespace Api {
/**
* Map of options.
*/
- typedef QMap<QString, Option*> Map;
+ typedef TQMap<TQString, Option*> Map;
/**
* Constructor.
@@ -61,25 +61,25 @@ namespace Kross { namespace Api {
* \param name The name the option has. This is the
* displayed title and isn't used internaly.
* \param comment A comment that describes the option.
- * \param value The QVariant value this option has.
+ * \param value The TQVariant value this option has.
*/
- Option(const QString& name, const QString& comment, const QVariant& value)
+ Option(const TQString& name, const TQString& comment, const TQVariant& value)
: name(name), comment(comment), value(value) {}
/// The short name of the option.
- QString name;
+ TQString name;
/// A description of the option.
- QString comment;
+ TQString comment;
/// The value the option has.
- QVariant value;
+ TQVariant value;
};
/**
* Constructor.
*/
- InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options);
+ InterpreterInfo(const TQString& interpretername, const TQString& library, const TQString& wildcard, TQStringList mimetypes, Option::Map options);
/**
* Destructor.
@@ -89,40 +89,40 @@ namespace Kross { namespace Api {
/**
* \return the name of the interpreter. For example "python" or "kjs".
*/
- const QString getInterpretername();
+ const TQString getInterpretername();
/**
* \return the file-wildcard used to determinate by this interpreter
* used scriptingfiles. Those filter will be used e.g. with
- * KGlobal::dirs()->findAllResources() as filtermask. For example
+ * KGlobal::dirs()->findAllResources() as filtertqmask. For example
* python just defines it as "*py".
*/
- const QString getWildcard();
+ const TQString getWildcard();
/**
* List of mimetypes this interpreter supports.
*
- * \return QStringList with mimetypes like
+ * \return TQStringList with mimetypes like
* "application/x-javascript".
*/
- const QStringList getMimeTypes();
+ const TQStringList getMimeTypes();
/**
* \return true if an \a Option with that \p key exists else false.
*/
- bool hasOption(const QString& key);
+ bool hasOption(const TQString& key);
/**
* \return the option defined with \p name .
*/
- Option* getOption(const QString name);
+ Option* getOption(const TQString name);
/**
* \return the value of the option defined with \p name . If there
* doesn't exists an option with such a name, the \p defaultvalue
* is returned.
*/
- const QVariant getOptionValue(const QString name, QVariant defaultvalue = QVariant());
+ const TQVariant getOptionValue(const TQString name, TQVariant defaultvalue = TQVariant());
/**
* \return a map of options.
@@ -137,13 +137,13 @@ namespace Kross { namespace Api {
private:
/// The name the interpreter has. Could be something like "python" or "kjs".
- QString m_interpretername;
+ TQString m_interpretername;
/// The name of the library to load for the interpreter.
- QString m_library;
+ TQString m_library;
/// The file wildcard used to determinate extensions.
- QString m_wildcard;
+ TQString m_wildcard;
/// List of mimetypes this interpreter supports.
- QStringList m_mimetypes;
+ TQStringList m_mimetypes;
/// A \a Option::Map with options.
Option::Map m_options;
/// The \a Interpreter instance.
diff --git a/lib/kross/api/list.cpp b/lib/kross/api/list.cpp
index ad901e5e..3d894116 100644
--- a/lib/kross/api/list.cpp
+++ b/lib/kross/api/list.cpp
@@ -22,8 +22,8 @@
using namespace Kross::Api;
-List::List(QValueList<Object::Ptr> value)
- : Value< List, QValueList<Object::Ptr> >(value)
+List::List(TQValueList<Object::Ptr> value)
+ : Value< List, TQValueList<Object::Ptr> >(value)
{
}
@@ -31,28 +31,28 @@ List::~List()
{
}
-const QString List::getClassName() const
+const TQString List::getClassName() const
{
return "Kross::Api::List";
}
-const QString List::toString()
+const TQString List::toString()
{
- QString s = "[";
- QValueList<Object::Ptr> list = getValue();
- for(QValueList<Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
+ TQString s = "[";
+ TQValueList<Object::Ptr> list = getValue();
+ for(TQValueList<Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
s += "'" + (*it)->toString() + "', ";
return (s.endsWith(", ") ? s.left(s.length() - 2) : s) + "]";
}
Object::Ptr List::item(uint idx, Object* defaultobject)
{
- QValueList<Object::Ptr>& list = getValue();
+ TQValueList<Object::Ptr>& list = getValue();
if(idx >= list.count()) {
if(defaultobject)
return defaultobject;
- krossdebug( QString("List::item index=%1 is out of bounds. Raising TypeException.").arg(idx) );
- throw Exception::Ptr( new Exception(QString("List-index %1 out of bounds.").arg(idx)) );
+ krossdebug( TQString("List::item index=%1 is out of bounds. Raising TypeException.").tqarg(idx) );
+ throw Exception::Ptr( new Exception(TQString("List-index %1 out of bounds.").tqarg(idx)) );
}
return list[idx];
}
diff --git a/lib/kross/api/list.h b/lib/kross/api/list.h
index d74246a0..2620c688 100644
--- a/lib/kross/api/list.h
+++ b/lib/kross/api/list.h
@@ -20,9 +20,9 @@
#ifndef KROSS_API_LIST_H
#define KROSS_API_LIST_H
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qintdict.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqintdict.h>
#include "object.h"
#include "value.h"
@@ -33,9 +33,9 @@ namespace Kross { namespace Api {
* The List class implementates \a Value to handle
* lists and collections.
*/
- class List : public Value< List, QValueList<Object::Ptr> >
+ class List : public Value< List, TQValueList<Object::Ptr> >
{
- friend class Value< List, QValueList<Object::Ptr> >;
+ friend class Value< List, TQValueList<Object::Ptr> >;
public:
/**
@@ -44,10 +44,10 @@ namespace Kross { namespace Api {
typedef KSharedPtr<List> Ptr;
/*
- operator QStringList () {
- //QValueList<Object::Ptr> getValue()
+ operator TQStringList () {
+ //TQValueList<Object::Ptr> getValue()
krossdebug("999999999999 ...........................");
- return QStringList();
+ return TQStringList();
}
*/
@@ -57,7 +57,7 @@ namespace Kross { namespace Api {
* \param value The list of \a Object instances this
* list has initialy.
*/
- List(QValueList<Object::Ptr> value = QValueList<Object::Ptr>());
+ List(TQValueList<Object::Ptr> value = TQValueList<Object::Ptr>());
/**
* Destructor.
@@ -67,21 +67,21 @@ namespace Kross { namespace Api {
/**
* See \see Kross::Api::Object::getClassName()
*/
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the whole list.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Return the \a Object with defined index from the
- * QValueList this list holds.
+ * TQValueList this list holds.
*
* \throw TypeException If index is out of bounds.
- * \param idx The QValueList-index.
+ * \param idx The TQValueList-index.
* \param defaultobject The default \a Object which should
* be used if there exists no item with such an
* index. This \a Object instance will be returned
@@ -92,7 +92,7 @@ namespace Kross { namespace Api {
Object::Ptr item(uint idx, Object* defaultobject = 0);
/**
- * Return the number of items in the QValueList this
+ * Return the number of items in the TQValueList this
* list holds.
*
* \return The number of items.
@@ -120,20 +120,20 @@ namespace Kross { namespace Api {
{
public:
ListT() : List() {}
- ListT(QValueList<OBJECT> values) : List(values) {}
+ ListT(TQValueList<OBJECT> values) : List(values) {}
template< typename TYPE >
- ListT(QValueList<TYPE> values) : List()
+ ListT(TQValueList<TYPE> values) : List()
{
- QValueListIterator<TYPE> it(values.begin()), end(values.end());
+ TQValueListIterator<TYPE> it(values.begin()), end(values.end());
for(; it != end; ++it)
this->append( new OBJECT(*it) );
}
template< typename TYPE >
- ListT(QIntDict<TYPE> values) : List()
+ ListT(TQIntDict<TYPE> values) : List()
{
- QIntDictIterator<TYPE> it( values );
+ TQIntDictIterator<TYPE> it( values );
TYPE *t;
while( (t = it.current()) != 0 ) {
this->append( new OBJECT(t) );
@@ -142,9 +142,9 @@ namespace Kross { namespace Api {
}
template< typename TYPE >
- ListT(const QPtrList<TYPE> values) : List()
+ ListT(const TQPtrList<TYPE> values) : List()
{
- QPtrListIterator<TYPE> it(values);
+ TQPtrListIterator<TYPE> it(values);
TYPE *t;
while( (t = it.current()) != 0 ) {
this->append( new OBJECT(t) );
diff --git a/lib/kross/api/module.h b/lib/kross/api/module.h
index 127609e0..3e58305a 100644
--- a/lib/kross/api/module.h
+++ b/lib/kross/api/module.h
@@ -20,7 +20,7 @@
#ifndef KROSS_API_MODULE_H
#define KROSS_API_MODULE_H
-#include <qstring.h>
+#include <tqstring.h>
#include "class.h"
@@ -48,10 +48,10 @@ namespace Kross { namespace Api {
* the application using Kross identifies
* modules with there names.
*/
- explicit Module(const QString& name)
+ explicit Module(const TQString& name)
: Class<Module>(name)
{
- krossdebug( QString("Kross::Api::Module %1 created").arg(name) );
+ krossdebug( TQString("Kross::Api::Module %1 created").tqarg(name) );
}
/**
@@ -59,14 +59,14 @@ namespace Kross { namespace Api {
*/
virtual ~Module()
{
- krossdebug( QString("Kross::Api::Module %1 destroyed").arg(getName()) );
+ krossdebug( TQString("Kross::Api::Module %1 destroyed").tqarg(getName()) );
}
/**
* Method to load from \a Kross::Api::Object inherited classes
* this module implements from within other modules.
*/
- virtual Kross::Api::Object::Ptr get(const QString& /*name*/, void* /*pointer*/ = 0)
+ virtual Kross::Api::Object::Ptr get(const TQString& /*name*/, void* /*pointer*/ = 0)
{
return 0;
}
diff --git a/lib/kross/api/object.cpp b/lib/kross/api/object.cpp
index ff2e2fbd..06ec55d5 100644
--- a/lib/kross/api/object.cpp
+++ b/lib/kross/api/object.cpp
@@ -30,34 +30,34 @@ Object::Object()
: KShared()
{
#ifdef KROSS_API_OBJECT_CTOR_DEBUG
- krossdebug( QString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
+ krossdebug( TQString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) );
#endif
}
Object::~Object()
{
#ifdef KROSS_API_OBJECT_DTOR_DEBUG
- krossdebug( QString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
+ krossdebug( TQString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) );
#endif
//removeAllChildren(); // not needed cause we use KShared to handle ref-couting and freeing.
}
-const QString Object::toString()
+const TQString Object::toString()
{
- return QString("%1").arg(getClassName());
+ return TQString("%1").tqarg(getClassName());
}
-Object::Ptr Object::call(const QString& name, List::Ptr arguments)
+Object::Ptr Object::call(const TQString& name, List::Ptr arguments)
{
Q_UNUSED(arguments);
#ifdef KROSS_API_OBJECT_CALL_DEBUG
- krossdebug( QString("Kross::Api::Object::call(%1) name=%2 class=%3").arg(name).arg(getName()).arg(getClassName()) );
+ krossdebug( TQString("Kross::Api::Object::call(%1) name=%2 class=%3").tqarg(name).tqarg(getName()).tqarg(getClassName()) );
#endif
if(name.isEmpty()) // return a self-reference if no functionname is defined.
return this;
- throw Exception::Ptr( new Exception(QString("No callable object named '%2'").arg(name)) );
+ throw Exception::Ptr( new Exception(TQString("No callable object named '%2'").tqarg(name)) );
}
diff --git a/lib/kross/api/object.h b/lib/kross/api/object.h
index 3c86ca4b..87bd2132 100644
--- a/lib/kross/api/object.h
+++ b/lib/kross/api/object.h
@@ -20,11 +20,11 @@
#ifndef KROSS_API_OBJECT_H
#define KROSS_API_OBJECT_H
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qmap.h>
-#include <qvariant.h>
-//#include <qobject.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
+#include <tqvariant.h>
+//#include <tqobject.h>
#include <ksharedptr.h>
#include "../main/krossconfig.h"
@@ -40,7 +40,7 @@ namespace Kross { namespace Api {
*
* The Object class is used as base class to provide
* common functionality. It's similar to what we know
- * in Python as PyObject or in Qt as QObject.
+ * in Python as PyObject or in TQt as TQObject.
*
* Inherited from e.g. \a Value, \a Module and \a Class .
*
@@ -73,14 +73,14 @@ namespace Kross { namespace Api {
*
* \return The name of this class.
*/
- virtual const QString getClassName() const = 0;
+ virtual const TQString getClassName() const = 0;
/**
* \return a string representation of the object or
* it's content. This method is mainly used for
* debugging and testing purposes.
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Pass a call to the object and evaluated it recursive
@@ -99,14 +99,14 @@ namespace Kross { namespace Api {
* \return The call-result as \a Object::Ptr instance or
* NULL if the call has no result.
*/
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/**
* Return a list of supported callable objects.
*
* \return List of supported calls.
*/
- virtual QStringList getCalls() { return QStringList(); }
+ virtual TQStringList getCalls() { return TQStringList(); }
//FIXME replace function with getChildren() functionality ?
/**
@@ -142,7 +142,7 @@ template<class T> inline T* Object::fromObject(Object::Ptr object)
{
T* t = (T*) object.data();
if(! t)
- throw KSharedPtr<Exception>( new Exception(QString("Object \"%1\" invalid.").arg(object ? object->getClassName() : "")) );
+ throw KSharedPtr<Exception>( new Exception(TQString("Object \"%1\" invalid.").tqarg(object ? object->getClassName() : "")) );
return t;
}
diff --git a/lib/kross/api/proxy.h b/lib/kross/api/proxy.h
index f25a4845..a7d37380 100644
--- a/lib/kross/api/proxy.h
+++ b/lib/kross/api/proxy.h
@@ -25,7 +25,7 @@
#include "variant.h"
#include "list.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Api {
@@ -71,21 +71,21 @@ namespace Kross { namespace Api {
* // The class which should be published.
* class MyClass : public Kross::Api::Class<MyClass> {
* public:
- * MyClass(const QString& name) : Kross::Api::Class<MyClass>(name) {
+ * MyClass(const TQString& name) : Kross::Api::Class<MyClass>(name) {
* // publish the function myfunc, so that scripting-code is able
* // to call that method.
* this->addProxyFunction <
* Kross::Api::Variant, // the uint returnvalue is handled with Variant.
- * Kross::Api::Variant, // the QString argument is handled with Variant too.
+ * Kross::Api::Variant, // the TQString argument is handled with Variant too.
* MyClass // the MyClass* is handled implicit by our class.
* > ( "myfuncname", // the name the function should be published as.
* this, // pointer to the class-instance which has the method.
* &TestPluginObject::myfunc ); // pointer to the method itself.
* }
* virtual ~MyClass() {}
- * virtual const QString getClassName() const { return "MyClass"; }
+ * virtual const TQString getClassName() const { return "MyClass"; }
* private:
- * uint myfunc(const QCString&, MyClass* myotherclass) {
+ * uint myfunc(const TQCString&, MyClass* myotherclass) {
* // This method will be published to the scripting backend. So, scripting
* // code is able to call this method.
* }
diff --git a/lib/kross/api/qtobject.cpp b/lib/kross/api/qtobject.cpp
index c6eb082a..2aa8f408 100644
--- a/lib/kross/api/qtobject.cpp
+++ b/lib/kross/api/qtobject.cpp
@@ -26,35 +26,35 @@
#include "eventslot.h"
#include "eventsignal.h"
-#include <qobject.h>
-#include <qsignal.h>
-//#include <qglobal.h>
-//#include <qobjectdefs.h>
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqobject.h>
+#include <tqsignal.h>
+//#include <tqglobal.h>
+//#include <tqobjectdefs.h>
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-QtObject::QtObject(QObject* object, const QString& name)
- : Kross::Api::Class<QtObject>(name.isEmpty() ? object->name() : name)
+QtObject::QtObject(TQObject* object, const TQString& name)
+ : Kross::Api::Class<QtObject>(name.isEmpty() ? TQString(object->name()) : name)
, m_object(object)
{
- // Walk through the signals and slots the QObject has
+ // Walk through the signals and slots the TQObject has
// and attach them as events to this QtObject.
- QStrList slotnames = m_object->metaObject()->slotNames(false);
+ TQStrList slotnames = m_object->tqmetaObject()->slotNames(false);
for(char* c = slotnames.first(); c; c = slotnames.next()) {
- QCString s = c;
+ TQCString s = c;
addChild(s, new EventSlot(s, object, s) );
}
- QStrList signalnames = m_object->metaObject()->signalNames(false);
+ TQStrList signalnames = m_object->tqmetaObject()->signalNames(false);
for(char* c = signalnames.first(); c; c = signalnames.next()) {
- QCString s = c;
+ TQCString s = c;
addChild(s, new EventSignal(s, object, s) );
}
- // Add functions to wrap QObject methods into callable
+ // Add functions to wrap TQObject methods into callable
// Kross objects.
addFunction("propertyNames", &QtObject::propertyNames);
@@ -78,48 +78,48 @@ QtObject::~QtObject()
{
}
-const QString QtObject::getClassName() const
+const TQString QtObject::getClassName() const
{
return "Kross::Api::QtObject";
}
-QObject* QtObject::getObject()
+TQObject* QtObject::getObject()
{
return m_object;
}
-QUObject* QtObject::toQUObject(const QString& signature, List::Ptr arguments)
+TQUObject* QtObject::toTQUObject(const TQString& signature, List::Ptr arguments)
{
- int startpos = signature.find("(");
- int endpos = signature.findRev(")");
+ int startpos = signature.tqfind("(");
+ int endpos = signature.tqfindRev(")");
if(startpos < 0 || startpos > endpos)
- throw Exception::Ptr( new Exception(QString("Invalid Qt signal or slot signature '%1'").arg(signature)) );
+ throw Exception::Ptr( new Exception(TQString("Invalid TQt signal or slot signature '%1'").tqarg(signature)) );
- //QString sig = signature.left(startpos);
- QString params = signature.mid(startpos + 1, endpos - startpos - 1);
- QStringList paramlist = QStringList::split(",", params); // this will fail on something like myslot(QMap<QString,QString> arg), but we don't care jet.
+ //TQString sig = signature.left(startpos);
+ TQString params = signature.mid(startpos + 1, endpos - startpos - 1);
+ TQStringList paramlist = TQStringList::split(",", params); // this will fail on something like myslot(TQMap<TQString,TQString> arg), but we don't care jet.
uint paramcount = paramlist.size();
- // The first item in the QUObject-array is for the returnvalue
+ // The first item in the TQUObject-array is for the returnvalue
// while everything >=1 are the passed parameters.
- QUObject* uo = new QUObject[ paramcount + 1 ];
- uo[0] = QUObject(); // empty placeholder for the returnvalue.
+ TQUObject* uo = new TQUObject[ paramcount + 1 ];
+ uo[0] = TQUObject(); // empty placeholder for the returnvalue.
-//QString t;
+//TQString t;
//for(int j=0; j<argcount; j++) t += "'" + Variant::toString(arguments->item(j)) + "' ";
-//krossdebug( QString("1 ---------------------: (%1) %2").arg(argcount).arg(t) );
+//krossdebug( TQString("1 ---------------------: (%1) %2").tqarg(argcount).tqarg(t) );
// Fill parameters.
uint argcount = arguments ? arguments->count() : 0;
for(uint i = 0; i < paramcount; i++) {
- if(paramlist[i].find("QString") >= 0) {
- const QString s = (argcount > i) ? Variant::toString(arguments->item(i)) : QString::null;
- //krossdebug(QString("EventSlot::toQUObject s=%1").arg(s));
- static_QUType_QString.set( &(uo[i + 1]), s );
+ if(paramlist[i].tqfind(TQSTRING_OBJECT_NAME_STRING) >= 0) {
+ const TQString s = (argcount > i) ? Variant::toString(arguments->item(i)) : TQString();
+ //krossdebug(TQString("EventSlot::toTQUObject s=%1").tqarg(s));
+ static_TQUType_TQString.set( &(uo[i + 1]), s );
}
- //TODO handle int, long, char*, QStringList, etc.
+ //TODO handle int, long, char*, TQStringList, etc.
else {
- throw Exception::Ptr( new Exception(QString("Unknown Qt signal or slot argument '%1' in signature '%2'.").arg(paramlist[i]).arg(signature)) );
+ throw Exception::Ptr( new Exception(TQString("Unknown TQt signal or slot argument '%1' in signature '%2'.").tqarg(paramlist[i]).tqarg(signature)) );
}
}
@@ -129,19 +129,19 @@ QUObject* QtObject::toQUObject(const QString& signature, List::Ptr arguments)
Kross::Api::Object::Ptr QtObject::propertyNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->propertyNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->propertyNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasProperty(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- m_object->metaObject()->findProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false));
+ m_object->tqmetaObject()->tqfindProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false));
}
Kross::Api::Object::Ptr QtObject::getProperty(Kross::Api::List::Ptr args)
{
- QVariant variant = m_object->property(Kross::Api::Variant::toString(args->item(0)).latin1());
- if(variant.type() == QVariant::Invalid)
+ TQVariant variant = m_object->property(Kross::Api::Variant::toString(args->item(0)).latin1());
+ if(variant.type() == TQVariant::Invalid)
return 0;
return new Kross::Api::Variant(variant);
}
@@ -158,13 +158,13 @@ Kross::Api::Object::Ptr QtObject::setProperty(Kross::Api::List::Ptr args)
Kross::Api::Object::Ptr QtObject::slotNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->slotNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->slotNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasSlot(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- bool(m_object->metaObject()->slotNames(false).find(
+ bool(m_object->tqmetaObject()->slotNames(false).tqfind(
Kross::Api::Variant::toString(args->item(0)).latin1()
) != -1));
}
@@ -172,59 +172,59 @@ Kross::Api::Object::Ptr QtObject::hasSlot(Kross::Api::List::Ptr args)
Kross::Api::Object::Ptr QtObject::callSlot(Kross::Api::List::Ptr args)
{
//TODO just call the child event ?!
- QString name = Kross::Api::Variant::toString(args->item(0));
- int slotid = m_object->metaObject()->findSlot(name.latin1(), false);
+ TQString name = Kross::Api::Variant::toString(args->item(0));
+ int slotid = m_object->tqmetaObject()->tqfindSlot(name.latin1(), false);
if(slotid < 0)
- throw Exception::Ptr( new Exception(QString("No such slot '%1'.").arg(name)) );
+ throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(name)) );
- QUObject* uo = QtObject::toQUObject(name, args);
+ TQUObject* uo = QtObject::toTQUObject(name, args);
m_object->qt_invoke(slotid, uo);
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
Kross::Api::Object::Ptr QtObject::signalNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->signalNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->signalNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasSignal(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- bool(m_object->metaObject()->signalNames(false).find(
+ bool(m_object->tqmetaObject()->signalNames(false).tqfind(
Kross::Api::Variant::toString(args->item(0)).latin1()
) != -1));
}
Kross::Api::Object::Ptr QtObject::emitSignal(Kross::Api::List::Ptr args)
{
- QString name = Kross::Api::Variant::toString(args->item(0));
- int signalid = m_object->metaObject()->findSignal(name.latin1(), false);
+ TQString name = Kross::Api::Variant::toString(args->item(0));
+ int signalid = m_object->tqmetaObject()->tqfindSignal(name.latin1(), false);
if(signalid < 0)
- throw Exception::Ptr( new Exception(QString("No such signal '%1'.").arg(name)) );
- m_object->qt_invoke(signalid, 0); //TODO convert Kross::Api::List::Ptr => QUObject*
+ throw Exception::Ptr( new Exception(TQString("No such signal '%1'.").tqarg(name)) );
+ m_object->qt_invoke(signalid, 0); //TODO convert Kross::Api::List::Ptr => TQUObject*
return 0;
}
Kross::Api::Object::Ptr QtObject::connectSignal(Kross::Api::List::Ptr args)
{
- QString signalname = Kross::Api::Variant::toString(args->item(0));
- QString signalsignatur = QString("2%1").arg(signalname);
+ TQString signalname = Kross::Api::Variant::toString(args->item(0));
+ TQString signalsignatur = TQString("2%1").tqarg(signalname);
const char* signalsig = signalsignatur.latin1();
QtObject* obj = Kross::Api::Object::fromObject<Kross::Api::QtObject>(args->item(1));
- QObject* o = obj->getObject();
+ TQObject* o = obj->getObject();
if(! o)
- throw Exception::Ptr( new Exception(QString("No such QObject receiver in '%1'.").arg(obj->getName())) );
+ throw Exception::Ptr( new Exception(TQString("No such TQObject receiver in '%1'.").tqarg(obj->getName())) );
- QString slotname = Kross::Api::Variant::toString(args->item(2));
- QString slotsignatur = QString("1%1").arg(slotname);
+ TQString slotname = Kross::Api::Variant::toString(args->item(2));
+ TQString slotsignatur = TQString("1%1").tqarg(slotname);
const char* slotsig = slotsignatur.latin1();
return new Kross::Api::Variant(
- QObject::connect(m_object, signalsig, o, slotsig));
+ TQObject::connect(m_object, signalsig, o, slotsig));
}
Kross::Api::Object::Ptr QtObject::disconnectSignal(Kross::Api::List::Ptr)
diff --git a/lib/kross/api/qtobject.h b/lib/kross/api/qtobject.h
index 29f493a4..119a579e 100644
--- a/lib/kross/api/qtobject.h
+++ b/lib/kross/api/qtobject.h
@@ -17,16 +17,16 @@
* Boston, MA 02110-1301, USA.
***************************************************************************/
-#ifndef KROSS_API_QTOBJECT_H
-#define KROSS_API_QTOBJECT_H
+#ifndef KROSS_API_TQTOBJECT_H
+#define KROSS_API_TQTOBJECT_H
#include "class.h"
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
-// Forward-declaration of the builtin Qt QUObject struct.
-struct QUObject;
+// Forward-declaration of the builtin TQt TQUObject struct.
+struct TQUObject;
namespace Kross { namespace Api {
@@ -37,10 +37,10 @@ namespace Kross { namespace Api {
class ScriptContrainer;
/**
- * Class to wrap \a QObject or inherited instances.
+ * Class to wrap \a TQObject or inherited instances.
*
- * This class publishs all SIGNAL's, SLOT's and Q_PROPERTY's
- * the QObject has.
+ * This class publishs all SIGNAL's, SLOT's and TQ_PROPERTY's
+ * the TQObject has.
*/
class QtObject : public Kross::Api::Class<QtObject>
{
@@ -54,13 +54,13 @@ namespace Kross { namespace Api {
/**
* Constructor.
*
- * \param object The \a QObject instance this
+ * \param object The \a TQObject instance this
* class wraps.
* \param name The unique name this \a QtObject
* instance has. If not defined then the
- * \a QObject::name() will be used.
+ * \a TQObject::name() will be used.
*/
- QtObject(QObject* object, const QString& name = QString::null);
+ QtObject(TQObject* object, const TQString& name = TQString());
/**
* Destructor.
@@ -68,32 +68,32 @@ namespace Kross { namespace Api {
virtual ~QtObject();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
- * Return the \a QObject instance this class wraps.
+ * Return the \a TQObject instance this class wraps.
*
- * \return The wrapped QObject.
+ * \return The wrapped TQObject.
*/
- QObject* getObject();
+ TQObject* getObject();
/**
- * Build a Qt QUObject struct out of the Qt signal or
+ * Build a TQt TQUObject struct out of the TQt signal or
* slot signature and the passed \a List arguments.
*
* \throw RuntimeException If the try to translate \p arguments
* failed.
- * \param signature The Qt signal or slot signature.
+ * \param signature The TQt signal or slot signature.
* \param arguments The optional \a List of arguments.
- * \return A QUObject array.
+ * \return A TQUObject array.
*/
- static QUObject* toQUObject(const QString& signature, List::Ptr arguments);
+ static TQUObject* toTQUObject(const TQString& signature, List::Ptr arguments);
private:
- /// The wrapped QObject.
- QObject* m_object;
+ /// The wrapped TQObject.
+ TQObject* m_object;
- // QProperty's
+ // TQProperty's
/// Return a list of property names.
Kross::Api::Object::Ptr propertyNames(Kross::Api::List::Ptr);
@@ -122,9 +122,9 @@ namespace Kross { namespace Api {
/// Emit a signal.
Kross::Api::Object::Ptr emitSignal(Kross::Api::List::Ptr);
- /// Connect signal with a QObject slot.
+ /// Connect signal with a TQObject slot.
Kross::Api::Object::Ptr connectSignal(Kross::Api::List::Ptr);
- /// Disconnect signal from QObject slot.
+ /// Disconnect signal from TQObject slot.
Kross::Api::Object::Ptr disconnectSignal(Kross::Api::List::Ptr);
};
diff --git a/lib/kross/api/script.h b/lib/kross/api/script.h
index 4f7d0c04..708e9058 100644
--- a/lib/kross/api/script.h
+++ b/lib/kross/api/script.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_SCRIPT_H
#define KROSS_API_SCRIPT_H
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include "class.h"
@@ -97,7 +97,7 @@ namespace Kross { namespace Api {
* \return a list of callable functionnames this
* script spends.
*/
- virtual const QStringList& getFunctionNames() = 0;
+ virtual const TQStringList& getFunctionNames() = 0;
/**
* Call a function.
@@ -107,12 +107,12 @@ namespace Kross { namespace Api {
* \param args Optional arguments passed to the function.
* \return The result of the called function. Could be NULL.
*/
- virtual Kross::Api::Object::Ptr callFunction(const QString& name, Kross::Api::List::Ptr args) = 0;
+ virtual Kross::Api::Object::Ptr callFunction(const TQString& name, Kross::Api::List::Ptr args) = 0;
/**
* \return a list of classnames.
*/
- virtual const QStringList& getClassNames() = 0;
+ virtual const TQStringList& getClassNames() = 0;
/**
* Create and return a new class instance.
@@ -121,7 +121,7 @@ namespace Kross { namespace Api {
* \param name The name of the class to create a instance of.
* \return The new classinstance.
*/
- virtual Kross::Api::Object::Ptr classInstance(const QString& name) = 0;
+ virtual Kross::Api::Object::Ptr classInstance(const TQString& name) = 0;
protected:
/// The \a Interpreter used to create this Script instance.
diff --git a/lib/kross/api/value.h b/lib/kross/api/value.h
index 544d4a36..db3854be 100644
--- a/lib/kross/api/value.h
+++ b/lib/kross/api/value.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_VALUE_H
#define KROSS_API_VALUE_H
-#include <qstring.h>
-#include <qvariant.h>
+#include <tqstring.h>
+#include <tqvariant.h>
#include "object.h"
diff --git a/lib/kross/api/variant.cpp b/lib/kross/api/variant.cpp
index 92c0e3cb..e8d8bc1b 100644
--- a/lib/kross/api/variant.cpp
+++ b/lib/kross/api/variant.cpp
@@ -24,8 +24,8 @@
using namespace Kross::Api;
-Variant::Variant(const QVariant& value)
- : Value<Variant, QVariant>(value)
+Variant::Variant(const TQVariant& value)
+ : Value<Variant, TQVariant>(value)
{
}
@@ -33,38 +33,38 @@ Variant::~Variant()
{
}
-const QString Variant::getClassName() const
+const TQString Variant::getClassName() const
{
return "Kross::Api::Variant";
}
-const QString Variant::toString()
+const TQString Variant::toString()
{
return getValue().toString();
}
/*
-const QString Variant::getVariantType(Object::Ptr object)
+const TQString Variant::getVariantType(Object::Ptr object)
{
switch( toVariant(object).type() ) {
- case QVariant::CString:
- case QVariant::String:
+ case TQVariant::CString:
+ case TQVariant::String:
return "Kross::Api::Variant::String";
- case QVariant::Map:
+ case TQVariant::Map:
return "Kross::Api::Variant::Dict";
- case QVariant::StringList:
- case QVariant::List:
+ case TQVariant::StringList:
+ case TQVariant::List:
return "Kross::Api::Variant::List";
- case QVariant::Double:
+ case TQVariant::Double:
//return "Kross::Api::Variant::Double";
- case QVariant::UInt:
+ case TQVariant::UInt:
//return "Kross::Api::Variant::UInt"; // python isn't able to differ between int and uint :-(
- case QVariant::LongLong:
- case QVariant::ULongLong:
- case QVariant::Int:
+ case TQVariant::LongLong:
+ case TQVariant::ULongLong:
+ case TQVariant::Int:
return "Kross::Api::Variant::Integer";
- case QVariant::Bool:
+ case TQVariant::Bool:
return "Kross::Api::Variant::Bool";
default: //Date, Time, DateTime, ByteArray, BitArray, Rect, Size, Color, Invalid, etc.
return "Kross::Api::Variant";
@@ -72,97 +72,97 @@ const QString Variant::getVariantType(Object::Ptr object)
}
*/
-const QVariant& Variant::toVariant(Object::Ptr object)
+const TQVariant& Variant::toVariant(Object::Ptr object)
{
return Object::fromObject<Variant>( object.data() )->getValue();
}
-const QString Variant::toString(Object::Ptr object)
+const TQString Variant::toString(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::String))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::String expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::String))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::String expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toString();
}
int Variant::toInt(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Int))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Int expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Int))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Int expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toInt();
}
uint Variant::toUInt(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::UInt))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::UInt expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::UInt))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::UInt expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toUInt();
}
double Variant::toDouble(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Double))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Double expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Double))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Double expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toDouble();
}
-Q_LLONG Variant::toLLONG(Object::Ptr object)
+TQ_LLONG Variant::toLLONG(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::LongLong))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::LLONG expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::LongLong))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::LLONG expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toLongLong();
}
-Q_ULLONG Variant::toULLONG(Object::Ptr object)
+TQ_ULLONG Variant::toULLONG(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::ULongLong))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::ULLONG expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::ULongLong))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::ULLONG expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toULongLong();
}
bool Variant::toBool(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Bool))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Bool expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Bool))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Bool expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toBool();
}
-QStringList Variant::toStringList(Object::Ptr object)
+TQStringList Variant::toStringList(Object::Ptr object)
{
List* list = dynamic_cast< List* >( object.data() );
if(list) {
- QStringList l;
- QValueList<Object::Ptr> valuelist = list->getValue();
- QValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
+ TQStringList l;
+ TQValueList<Object::Ptr> valuelist = list->getValue();
+ TQValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
for(; it != end; ++it)
l.append( toString(*it) );
return l;
}
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::StringList))
- throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::StringList expected, but got '%1'.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::StringList))
+ throw Exception::Ptr( new Exception(TQString("Kross::Api::Variant::StringList expected, but got '%1'.").tqarg(variant.typeName()).latin1()) );
return variant.toStringList();
}
-QValueList<QVariant> Variant::toList(Object::Ptr object)
+TQValueList<TQVariant> Variant::toList(Object::Ptr object)
{
List* list = dynamic_cast< List* >( object.data() );
if(list) {
- QValueList<QVariant> l;
- QValueList<Object::Ptr> valuelist = list->getValue();
- QValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
+ TQValueList<TQVariant> l;
+ TQValueList<Object::Ptr> valuelist = list->getValue();
+ TQValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
for(; it != end; ++it)
l.append( toVariant(*it) );
return l;
}
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::List))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::List expected, but got '%1'.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::List))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::List expected, but got '%1'.").tqarg(variant.typeName()).latin1()) );
return variant.toList();
}
diff --git a/lib/kross/api/variant.h b/lib/kross/api/variant.h
index 020e6e51..65b4c4e8 100644
--- a/lib/kross/api/variant.h
+++ b/lib/kross/api/variant.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_VARIANT_H
#define KROSS_API_VARIANT_H
-#include <qstring.h>
-#include <qvariant.h>
+#include <tqstring.h>
+#include <tqvariant.h>
#include "object.h"
#include "value.h"
@@ -32,22 +32,22 @@ namespace Kross { namespace Api {
class List;
/**
- * Variant value to wrap a QVariant into a \a Kross::Api::Value
+ * Variant value to wrap a TQVariant into a \a Kross::Api::Value
* to enable primitive types like strings or numerics.
*/
- class Variant : public Value<Variant, QVariant>
+ class Variant : public Value<Variant, TQVariant>
{
- friend class Value<Variant, QVariant>;
+ friend class Value<Variant, TQVariant>;
public:
/**
* Constructor.
*
- * \param value The initial QVariant-value
+ * \param value The initial TQVariant-value
* this Variant-Object has.
* \param name The name this Value has.
*/
- Variant(const QVariant& value);
+ Variant(const TQVariant& value);
inline operator bool () { return getValue().toBool(); }
inline operator int () { return getValue().toInt(); }
@@ -55,32 +55,32 @@ namespace Kross { namespace Api {
inline operator double () { return getValue().toDouble(); }
inline operator const char* () { return getValue().toString().latin1(); }
- inline operator QString () { return getValue().toString(); }
- inline operator const QString () { return getValue().toString(); }
- inline operator const QString& () { return getValue().asString(); }
+ inline operator TQString () { return getValue().toString(); }
+ inline operator const TQString () { return getValue().toString(); }
+ inline operator const TQString& () { return getValue().asString(); }
- inline operator QCString () { return getValue().toCString(); }
- inline operator const QCString () { return getValue().toCString(); }
- inline operator const QCString& () { return getValue().asCString(); }
+ inline operator TQCString () { return getValue().toCString(); }
+ inline operator const TQCString () { return getValue().toCString(); }
+ inline operator const TQCString& () { return getValue().asCString(); }
- inline operator QVariant () { return getValue(); }
- inline operator const QVariant () { return getValue(); }
- inline operator const QVariant& () { return getValue(); }
+ inline operator TQVariant () { return getValue(); }
+ inline operator const TQVariant () { return getValue(); }
+ inline operator const TQVariant& () { return getValue(); }
/**
- * Operator to return a QStringList.
+ * Operator to return a TQStringList.
*
* We can not just use getValue().toStringList() here cause maybe
* this Kross::Api::Variant is a Kross::Api::List which could be
* internaly used for list of strings as well. So, we use the
* toStringList() function which will take care of translating a
- * Kross::Api::List to a QStringList if possible or to throw an
- * exception if the Kross::Api::List isn't a QStringList.
+ * Kross::Api::List to a TQStringList if possible or to throw an
+ * exception if the Kross::Api::List isn't a TQStringList.
*/
- inline operator QStringList () {
+ inline operator TQStringList () {
return toStringList(this);
}
- inline operator QValueList<QVariant> () {
+ inline operator TQValueList<TQVariant> () {
return toList(this);
}
@@ -90,34 +90,34 @@ namespace Kross { namespace Api {
virtual ~Variant();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the variant.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Try to convert the given \a Object into
- * a QVariant.
+ * a TQVariant.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QVariant converted object.
+ * \return The to a TQVariant converted object.
*/
- static const QVariant& toVariant(Object::Ptr object);
+ static const TQVariant& toVariant(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a QString.
+ * a TQString.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QString converted object.
+ * \return The to a TQString converted object.
*/
- static const QString toString(Object::Ptr object);
+ static const TQString toString(Object::Ptr object);
/**
* Try to convert the given \a Object into
@@ -151,23 +151,23 @@ namespace Kross { namespace Api {
/**
* Try to convert the given \a Object into
- * a Q_LLONG.
+ * a TQ_LLONG.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a Q_LLONG converted object.
+ * \return The to a TQ_LLONG converted object.
*/
- static Q_LLONG toLLONG(Object::Ptr object);
+ static TQ_LLONG toLLONG(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a Q_ULLONG.
+ * a TQ_ULLONG.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a Q_ULLONG converted object.
+ * \return The to a TQ_ULLONG converted object.
*/
- static Q_ULLONG toULLONG(Object::Ptr object);
+ static TQ_ULLONG toULLONG(Object::Ptr object);
/**
* Try to convert the given \a Object into
@@ -181,23 +181,23 @@ namespace Kross { namespace Api {
/**
* Try to convert the given \a Object into
- * a QStringList.
+ * a TQStringList.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QValueList converted object.
+ * \return The to a TQValueList converted object.
*/
- static QStringList toStringList(Object::Ptr object);
+ static TQStringList toStringList(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a QValueList of QVariant's.
+ * a TQValueList of TQVariant's.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QValueList converted object.
+ * \return The to a TQValueList converted object.
*/
- static QValueList<QVariant> toList(Object::Ptr object);
+ static TQValueList<TQVariant> toList(Object::Ptr object);
};
diff --git a/lib/kross/main/krossconfig.cpp b/lib/kross/main/krossconfig.cpp
index 61984532..edc8d0f1 100644
--- a/lib/kross/main/krossconfig.cpp
+++ b/lib/kross/main/krossconfig.cpp
@@ -23,12 +23,12 @@
#include <kdebug.h>
-void Kross::krossdebug(const QString &s)
+void Kross::krossdebug(const TQString &s)
{
kdDebug() << "Kross: " << s << endl;
}
-void Kross::krosswarning(const QString &s)
+void Kross::krosswarning(const TQString &s)
{
kdWarning() << "Kross: " << s << endl;
}
diff --git a/lib/kross/main/krossconfig.h b/lib/kross/main/krossconfig.h
index 6b8bb25d..b99dc35f 100644
--- a/lib/kross/main/krossconfig.h
+++ b/lib/kross/main/krossconfig.h
@@ -20,7 +20,7 @@
#ifndef KROSS_MAIN_KROSSCONFIG_H
#define KROSS_MAIN_KROSSCONFIG_H
-#include <qstring.h>
+#include <tqstring.h>
/**
* The Kross scripting bridge to embed scripting functionality
@@ -39,7 +39,7 @@
* \a Kross::KexiDB together with interpreters like \a Kross::Python.
* - Introspection where needed to be able to manipulate
* behaviours and functionality on runtime.
- * - Qt/KDE based, so use the extended techs both spends.
+ * - TQt/KDE based, so use the extended techs both spends.
* - integrate nicly as powerfull scripting system into the
* Kexi application.
*
@@ -57,12 +57,12 @@ namespace Kross {
/**
* Debugging function.
*/
- void krossdebug(const QString &s);
+ void krossdebug(const TQString &s);
/**
* Warning function.
*/
- void krosswarning(const QString &s);
+ void krosswarning(const TQString &s);
#else
// Define these to an empty statement if debugging is disabled.
diff --git a/lib/kross/main/mainmodule.cpp b/lib/kross/main/mainmodule.cpp
index 0630e81a..dde74502 100644
--- a/lib/kross/main/mainmodule.cpp
+++ b/lib/kross/main/mainmodule.cpp
@@ -36,7 +36,7 @@ namespace Kross { namespace Api {
}}
-MainModule::MainModule(const QString& name)
+MainModule::MainModule(const TQString& name)
: Module(name)
, d(new MainModulePrivate())
{
@@ -48,7 +48,7 @@ MainModule::~MainModule()
delete d;
}
-const QString MainModule::getClassName() const
+const TQString MainModule::getClassName() const
{
return "Kross::Api::MainModule";
}
@@ -69,47 +69,47 @@ void MainModule::setException(Exception::Ptr exception)
}
#if 0
-bool MainModule::hasChild(const QString& name) const
+bool MainModule::hasChild(const TQString& name) const
{
return Callable::hasChild(name);
}
#endif
-EventSignal::Ptr MainModule::addSignal(const QString& name, QObject* sender, QCString signal)
+EventSignal::Ptr MainModule::addSignal(const TQString& name, TQObject* sender, TQCString signal)
{
EventSignal* event = new EventSignal(name, sender, signal);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add signal name='%1' signature='%2'").arg(name).arg(signal) );
+ krosswarning( TQString("Failed to add signal name='%1' signature='%2'").tqarg(name).tqarg(signal.data()) );
return 0;
}
return event;
}
-EventSlot::Ptr MainModule::addSlot(const QString& name, QObject* receiver, QCString slot)
+EventSlot::Ptr MainModule::addSlot(const TQString& name, TQObject* receiver, TQCString slot)
{
EventSlot* event = new EventSlot(name, receiver, slot);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add slot name='%1' signature='%2'").arg(name).arg(slot) );
+ krosswarning( TQString("Failed to add slot name='%1' signature='%2'").tqarg(name).tqarg(slot.data()) );
return 0;
}
return event;
}
-QtObject::Ptr MainModule::addQObject(QObject* object, const QString& name)
+QtObject::Ptr MainModule::addTQObject(TQObject* object, const TQString& name)
{
QtObject* qtobject = new QtObject(object, name);
if(! addChild(name, qtobject)) {
- krosswarning( QString("Failed to add QObject name='%1'").arg(object->name()) );
+ krosswarning( TQString("Failed to add TQObject name='%1'").tqarg(object->name()) );
return 0;
}
return qtobject;
}
-EventAction::Ptr MainModule::addKAction(KAction* action, const QString& name)
+EventAction::Ptr MainModule::addKAction(KAction* action, const TQString& name)
{
EventAction* event = new EventAction(name, action);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add KAction name='%1'").arg(action->name()) );
+ krosswarning( TQString("Failed to add KAction name='%1'").tqarg(action->name()) );
return 0;
}
return event;
diff --git a/lib/kross/main/mainmodule.h b/lib/kross/main/mainmodule.h
index 116e098d..bc7efc45 100644
--- a/lib/kross/main/mainmodule.h
+++ b/lib/kross/main/mainmodule.h
@@ -29,9 +29,9 @@
#include "../api/qtobject.h"
#include "../api/eventaction.h"
-#include <qstring.h>
-#include <qvariant.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include <kaction.h>
@@ -65,7 +65,7 @@ namespace Kross { namespace Api {
* the \a ScriptContainer instances are accessible
* by there \a ScriptContainer::getName() name.
*/
- explicit MainModule(const QString& name);
+ explicit MainModule(const TQString& name);
/**
* Destructor.
@@ -73,7 +73,7 @@ namespace Kross { namespace Api {
virtual ~MainModule();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return true if the script throwed an exception
@@ -101,54 +101,54 @@ namespace Kross { namespace Api {
*
* \return true if child exists else false.
*/
- bool hasChild(const QString& name) const;
+ bool hasChild(const TQString& name) const;
#endif
/**
- * Add a Qt signal to the \a Module by creating
+ * Add a TQt signal to the \a Module by creating
* an \a EventSignal for it.
*
* \param name the name the \a EventSignal is
* reachable as
- * \param sender the QObject instance which
+ * \param sender the TQObject instance which
* is the sender of the \p signal
- * \param signal the Qt signal macro the \p sender
+ * \param signal the TQt signal macro the \p sender
* emits to call the \a EventSignal
* \return the newly added \a EventSignal instance
* which is now a child of this \a MainModule
*/
- EventSignal::Ptr addSignal(const QString& name, QObject* sender, QCString signal);
+ EventSignal::Ptr addSignal(const TQString& name, TQObject* sender, TQCString signal);
/**
- * Add a Qt slot to the \a Module by creating
+ * Add a TQt slot to the \a Module by creating
* an \a EventSlot for it.
*
* \param name the name the \a EventSlot is
* reachable as
- * \param receiver the QObject instance which
+ * \param receiver the TQObject instance which
* is the receiver of the \p signal
- * \param slot the Qt slot macro of the \p receiver
+ * \param slot the TQt slot macro of the \p receiver
* to invoke if the \a EventSlot got called.
* \return the newly added \a EventSlot instance
* which is now a child of this \a MainModule
*/
- EventSlot::Ptr addSlot(const QString& name, QObject* receiver, QCString slot);
+ EventSlot::Ptr addSlot(const TQString& name, TQObject* receiver, TQCString slot);
/**
- * Add a \a QObject to the eventcollection. All
- * signals and slots the QObject has will be
+ * Add a \a TQObject to the eventcollection. All
+ * signals and slots the TQObject has will be
* added to a new \a EventCollection instance
* which is child of this \a EventCollection
* instance.
*
- * \param object the QObject instance that should
+ * \param object the TQObject instance that should
* be added to this \a MainModule
- * \param name the name under which this QObject instance
+ * \param name the name under which this TQObject instance
* should be registered as
* \return the newly added \a QtObject instance
* which is now a child of this \a MainModule
*/
- QtObject::Ptr addQObject(QObject* object, const QString& name = QString::null);
+ QtObject::Ptr addTQObject(TQObject* object, const TQString& name = TQString());
/**
* Add a \a KAction to the eventcollection. The
@@ -163,12 +163,12 @@ namespace Kross { namespace Api {
*
* \todo check \a name dox.
*/
- EventAction::Ptr addKAction(KAction* action, const QString& name = QString::null);
+ EventAction::Ptr addKAction(KAction* action, const TQString& name = TQString());
- //typedef QValueList<Callable::Ptr> EventList;
+ //typedef TQValueList<Callable::Ptr> EventList;
//EventList getEvents();
- //const QString& serializeToXML();
- //void unserializeFromXML(const QString& xml);
+ //const TQString& serializeToXML();
+ //void unserializeFromXML(const TQString& xml);
private:
/// Private d-pointer class.
diff --git a/lib/kross/main/manager.cpp b/lib/kross/main/manager.cpp
index cdb4d363..b966a1cc 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;
}
diff --git a/lib/kross/main/manager.h b/lib/kross/main/manager.h
index 0de5833f..fe815e7c 100644
--- a/lib/kross/main/manager.h
+++ b/lib/kross/main/manager.h
@@ -20,13 +20,13 @@
#ifndef KROSS_API_MANAGER_H
#define KROSS_API_MANAGER_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qmap.h>
-//#include <qvariant.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+//#include <tqvariant.h>
#include <ksharedptr.h>
-class QObject;
+class TQObject;
#include "../api/object.h"
#include "mainmodule.h"
@@ -78,20 +78,20 @@ namespace Kross { namespace Api {
* \return a map with \a InterpreterInfo* instances
* used to describe interpreters.
*/
- QMap<QString, InterpreterInfo*> getInterpreterInfos();
+ TQMap<TQString, InterpreterInfo*> getInterpreterInfos();
/**
* \return true if there exists an interpreter with the
* name \p interpretername else false.
*/
- bool hasInterpreterInfo(const QString& interpretername) const;
+ bool hasInterpreterInfo(const TQString& interpretername) const;
/**
* \return the \a InterpreterInfo* matching to the defined
* \p interpretername or NULL if there does not exists such
* a interpreter.
*/
- InterpreterInfo* getInterpreterInfo(const QString& interpretername);
+ InterpreterInfo* getInterpreterInfo(const TQString& interpretername);
/**
* \return the name of the \a Interpreter that feels responsible
@@ -100,10 +100,10 @@ namespace Kross { namespace Api {
* \param file The filename we should try to determinate the
* interpretername for.
* \return The name of the \a Interpreter which will be used
- * to execute the file or QString::null if we failed
+ * to execute the file or TQString() if we failed
* to determinate a matching interpreter for the file.
*/
- const QString getInterpreternameForFile(const QString& file);
+ const TQString getInterpreternameForFile(const TQString& file);
/**
* Return the existing \a ScriptContainer with scriptname
@@ -116,7 +116,7 @@ namespace Kross { namespace Api {
* \return The \a ScriptContainer instance matching to
* scriptname.
*/
- KSharedPtr<ScriptContainer> getScriptContainer(const QString& scriptname);
+ KSharedPtr<ScriptContainer> getScriptContainer(const TQString& scriptname);
/**
* Return the \a Interpreter instance defined by
@@ -128,13 +128,13 @@ namespace Kross { namespace Api {
* does not exists an interpreter with such
* an interpretername.
*/
- Interpreter* getInterpreter(const QString& interpretername);
+ Interpreter* getInterpreter(const TQString& interpretername);
/**
* \return a list of names of the at the backend
* supported interpreters.
*/
- const QStringList getInterpreters();
+ const TQStringList getInterpreters();
/**
* Add the an external module to the global shared list of
@@ -155,7 +155,7 @@ namespace Kross { namespace Api {
* failed. The loaded Module isn't added to the global
* shared list of modules.
*/
- Module::Ptr loadModule(const QString& modulename);
+ Module::Ptr loadModule(const TQString& modulename);
private:
/// Private d-pointer class.
diff --git a/lib/kross/main/scriptaction.cpp b/lib/kross/main/scriptaction.cpp
index 06ee9dd7..b658a0b1 100644
--- a/lib/kross/main/scriptaction.cpp
+++ b/lib/kross/main/scriptaction.cpp
@@ -20,10 +20,10 @@
#include "scriptaction.h"
#include "manager.h"
-#include <qstylesheet.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqstylesheet.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <kurl.h>
#include <kstandarddirs.h>
#include <kmimetype.h>
@@ -42,7 +42,7 @@ namespace Kross { namespace Api {
* to a scriptfile the packagepath will be the directory
* the scriptfile is located in.
*/
- QString packagepath;
+ TQString packagepath;
/**
* List of logs this \a ScriptAction has. Initialization,
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* more detailed visual information to the user what
* our \a ScriptAction did so far.
*/
- QStringList logs;
+ TQStringList logs;
/**
* The versionnumber this \a ScriptAction has. We are using
@@ -66,13 +66,13 @@ namespace Kross { namespace Api {
* The description used to provide a way to the user to describe
* the \a ScriptAction with a longer string.
*/
- QString description;
+ TQString description;
/**
* List of \a ScriptActionCollection instances this \a ScriptAction
* is attached to.
*/
- QValueList<ScriptActionCollection*> collections;
+ TQValueList<ScriptActionCollection*> collections;
/**
* Constructor.
@@ -82,7 +82,7 @@ namespace Kross { namespace Api {
}}
-ScriptAction::ScriptAction(const QString& file)
+ScriptAction::ScriptAction(const TQString& file)
: KAction(0, file.latin1())
, Kross::Api::ScriptContainer(file)
, d( new ScriptActionPrivate() ) // initialize d-pointer class
@@ -101,18 +101,18 @@ ScriptAction::ScriptAction(const QString& file)
setEnabled(false);
}
-ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& element)
+ScriptAction::ScriptAction(const TQString& scriptconfigfile, const TQDomElement& element)
: KAction()
, Kross::Api::ScriptContainer()
, d( new ScriptActionPrivate() ) // initialize d-pointer class
{
- QString name = element.attribute("name");
- QString text = element.attribute("text");
- QString description = element.attribute("description");
- QString file = element.attribute("file");
- QString icon = element.attribute("icon");
+ TQString name = element.attribute("name");
+ TQString text = element.attribute("text");
+ TQString description = element.attribute("description");
+ TQString file = element.attribute("file");
+ TQString icon = element.attribute("icon");
- QString version = element.attribute("version");
+ TQString version = element.attribute("version");
bool ok;
int v = version.toInt(&ok);
if(ok) d->version = v;
@@ -130,7 +130,7 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
//d->scriptcontainer = Manager::scriptManager()->getScriptContainer(name);
- QString interpreter = element.attribute("interpreter");
+ TQString interpreter = element.attribute("interpreter");
if(interpreter.isNull())
setEnabled(false);
else
@@ -143,18 +143,18 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
ScriptContainer::setName(name);
}
else {
- QDir dir = QFileInfo(scriptconfigfile).dir(true);
+ TQDir dir = TQFileInfo(scriptconfigfile).dir(true);
d->packagepath = dir.absPath();
- QFileInfo fi(dir, file);
+ TQFileInfo fi(dir, file);
file = fi.absFilePath();
setEnabled(fi.exists());
setFile(file);
if(icon.isNull())
icon = KMimeType::iconForURL( KURL(file) );
if(description.isEmpty())
- description = QString("%1<br>%2").arg(text.isEmpty() ? name : text).arg(file);
+ description = TQString("%1<br>%2").tqarg(text.isEmpty() ? name : text).tqarg(file);
else
- description += QString("<br>%1").arg(file);
+ description += TQString("<br>%1").tqarg(file);
ScriptContainer::setName(file);
}
@@ -164,7 +164,7 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
KAction::setIcon(icon);
// connect signal
- connect(this, SIGNAL(activated()), this, SLOT(activate()));
+ connect(this, TQT_SIGNAL(activated()), this, TQT_SLOT(activate()));
}
ScriptAction::~ScriptAction()
@@ -178,30 +178,30 @@ int ScriptAction::version() const
return d->version;
}
-const QString ScriptAction::getDescription() const
+const TQString ScriptAction::getDescription() const
{
return d->description;
}
-void ScriptAction::setDescription(const QString& description)
+void ScriptAction::setDescription(const TQString& description)
{
d->description = description;
setToolTip( description );
setWhatsThis( description );
}
-void ScriptAction::setInterpreterName(const QString& name)
+void ScriptAction::setInterpreterName(const TQString& name)
{
setEnabled( Manager::scriptManager()->hasInterpreterInfo(name) );
Kross::Api::ScriptContainer::setInterpreterName(name);
}
-const QString ScriptAction::getPackagePath() const
+const TQString ScriptAction::getPackagePath() const
{
return d->packagepath;
}
-const QStringList& ScriptAction::getLogs() const
+const TQStringList& ScriptAction::getLogs() const
{
return d->logs;
}
@@ -218,7 +218,7 @@ void ScriptAction::detach(ScriptActionCollection* collection)
void ScriptAction::detachAll()
{
- for(QValueList<ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
+ for(TQValueList<ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
(*it)->detach( this );
}
@@ -227,11 +227,11 @@ void ScriptAction::activate()
emit activated(this);
Kross::Api::ScriptContainer::execute();
if( Kross::Api::ScriptContainer::hadException() ) {
- QString errormessage = Kross::Api::ScriptContainer::getException()->getError();
- QString tracedetails = Kross::Api::ScriptContainer::getException()->getTrace();
- d->logs << QString("<b>%1</b><br>%2")
- .arg( QStyleSheet::escape(errormessage) )
- .arg( QStyleSheet::escape(tracedetails) );
+ TQString errormessage = Kross::Api::ScriptContainer::getException()->getError();
+ TQString tracedetails = Kross::Api::ScriptContainer::getException()->getTrace();
+ d->logs << TQString("<b>%1</b><br>%2")
+ .tqarg( TQStyleSheet::escape(errormessage) )
+ .tqarg( TQStyleSheet::escape(tracedetails) );
emit failed(errormessage, tracedetails);
}
else {
diff --git a/lib/kross/main/scriptaction.h b/lib/kross/main/scriptaction.h
index 22bb37ec..27f910d0 100644
--- a/lib/kross/main/scriptaction.h
+++ b/lib/kross/main/scriptaction.h
@@ -20,7 +20,7 @@
#ifndef KROSS_API_SCRIPTACTION_H
#define KROSS_API_SCRIPTACTION_H
-#include <qdom.h>
+#include <tqdom.h>
#include <kaction.h>
#include "scriptcontainer.h"
@@ -41,18 +41,19 @@ namespace Kross { namespace Api {
, public Kross::Api::ScriptContainer
{
Q_OBJECT
+ TQ_OBJECT
/// The name of the interpreter used to execute the scripting code.
- //Q_PROPERTY(QString interpretername READ getInterpreterName WRITE setInterpreterName)
+ //TQ_PROPERTY(TQString interpretername READ getInterpreterName WRITE setInterpreterName)
/// The scripting code which should be executed.
- //Q_PROPERTY(QString code READ getCode WRITE setCode)
+ //TQ_PROPERTY(TQString code READ getCode WRITE setCode)
/// The scriptfile which should be executed.
- //Q_PROPERTY(QString file READ getFile WRITE setFile)
+ //TQ_PROPERTY(TQString file READ getFile WRITE setFile)
/// The description for this \a ScriptAction .
- Q_PROPERTY(QString description READ getDescription WRITE setDescription)
+ TQ_PROPERTY(TQString description READ getDescription WRITE setDescription)
public:
@@ -60,7 +61,7 @@ namespace Kross { namespace Api {
typedef KSharedPtr<ScriptAction> Ptr;
/// A list of \a ScriptAction instances.
- //typedef QValueList<ScriptAction::Ptr> List;
+ //typedef TQValueList<ScriptAction::Ptr> List;
/**
* Constructor.
@@ -68,17 +69,17 @@ namespace Kross { namespace Api {
* \param file The KURL scriptfile this \a ScriptAction
* points to.
*/
- explicit ScriptAction(const QString& file);
+ explicit ScriptAction(const TQString& file);
/**
* Constructor.
*
* \param scriptconfigfile The XML-configurationfile
* the DOM-element was readed from.
- * \param element The QDomElement which will be used
+ * \param element The TQDomElement which will be used
* to setup the \a ScriptAction attributes.
*/
- explicit ScriptAction(const QString& scriptconfigfile, const QDomElement& element);
+ explicit ScriptAction(const TQString& scriptconfigfile, const TQDomElement& element);
/**
* Destructor.
@@ -96,12 +97,12 @@ namespace Kross { namespace Api {
/**
* \return the description for this \a ScriptAction has.
*/
- const QString getDescription() const;
+ const TQString getDescription() const;
/**
* Set the description \p description for this \a ScriptAction .
*/
- void setDescription(const QString& description);
+ void setDescription(const TQString& description);
/**
* Set the name of the interpreter which will be used
@@ -110,20 +111,20 @@ namespace Kross { namespace Api {
* \param name The name of the \a Interpreter . This
* could be e.g. "python".
*/
- void setInterpreterName(const QString& name);
+ void setInterpreterName(const TQString& name);
/**
* \return the path of the package this \a ScriptAction
- * belongs to or QString::null if it doesn't belong to
+ * belongs to or TQString() if it doesn't belong to
* any package.
*/
- const QString getPackagePath() const;
+ const TQString getPackagePath() const;
/**
* \return a list of all kind of logs this \a ScriptAction
* does remember.
*/
- const QStringList& getLogs() const;
+ const TQStringList& getLogs() const;
/**
* Attach this \a ScriptAction to the \a ScriptActionCollection
@@ -173,10 +174,10 @@ namespace Kross { namespace Api {
/**
* This signal got emitted after the try to execute this
- * \a ScriptAction failed. The \p errormessage contains
+ * \a ScriptAction failed. The \p errormessage tqcontains
* the error message.
*/
- void failed(const QString& errormessage, const QString& tracedetails);
+ void failed(const TQString& errormessage, const TQString& tracedetails);
private:
/// Internaly used private d-pointer.
@@ -196,13 +197,13 @@ namespace Kross { namespace Api {
/**
* The list of \a ScriptAction shared pointers.
*/
- QValueList<ScriptAction::Ptr> m_list;
+ TQValueList<ScriptAction::Ptr> m_list;
/**
* A map of \a ScriptAction shared pointers used to access
* the actions with there name.
*/
- QMap<QCString, ScriptAction::Ptr> m_actions;
+ TQMap<TQCString, ScriptAction::Ptr> m_actions;
/**
* A KActionMenu which could be used to display the
@@ -237,7 +238,7 @@ namespace Kross { namespace Api {
* initial content for the KActionMenu \a m_actionmenu .
* \param name The internal name.
*/
- ScriptActionCollection(const QString& text, KActionCollection* ac, const char* name)
+ ScriptActionCollection(const TQString& text, KActionCollection* ac, const char* name)
: m_actionmenu( new KActionMenu(text, ac, name) )
, m_dirty(true) {}
@@ -246,7 +247,7 @@ namespace Kross { namespace Api {
* Destructor.
*/
~ScriptActionCollection() {
- for(QValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it)
+ for(TQValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it)
(*it)->detach(this);
}
@@ -254,12 +255,12 @@ namespace Kross { namespace Api {
* \return the \a ScriptAction instance which has the name \p name
* or NULL if there exists no such action.
*/
- ScriptAction::Ptr action(const QCString& name) { return m_actions[name]; }
+ ScriptAction::Ptr action(const TQCString& name) { return m_actions[name]; }
/**
* \return a list of actions.
*/
- QValueList<ScriptAction::Ptr> actions() { return m_list; }
+ TQValueList<ScriptAction::Ptr> actions() { return m_list; }
/**
* \return the KActionMenu \a m_actionmenu .
@@ -293,7 +294,7 @@ namespace Kross { namespace Api {
* will be empty and there are no actions attach any longer.
*/
void clear() {
- for(QValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it) {
+ for(TQValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it) {
m_actionmenu->remove(*it);
(*it)->detach(this);
}
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()) {
diff --git a/lib/kross/main/scriptcontainer.h b/lib/kross/main/scriptcontainer.h
index a66293a2..5d2b38d0 100644
--- a/lib/kross/main/scriptcontainer.h
+++ b/lib/kross/main/scriptcontainer.h
@@ -22,9 +22,9 @@
#include "mainmodule.h"
-#include <qstring.h>
-#include <qvariant.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+#include <tqobject.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -67,7 +67,7 @@ namespace Kross { namespace Api {
* has. It's used e.g. at the \a Manager to
* identify the ScriptContainer.
*/
- explicit ScriptContainer(const QString& name = QString::null);
+ explicit ScriptContainer(const TQString& name = TQString());
public:
@@ -83,56 +83,56 @@ namespace Kross { namespace Api {
* \return the unique name this ScriptContainer is
* reachable as.
*/
- const QString getName() const;
+ const TQString getName() const;
/**
* Set the name this ScriptContainer is reachable as.
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* Return the scriptcode this ScriptContainer holds.
*/
- QString getCode() const;
+ TQString getCode() const;
/**
* Set the scriptcode this ScriptContainer holds.
*/
- void setCode(const QString& code);
+ void setCode(const TQString& code);
/**
* \return the name of the interpreter used
* on \a execute.
*/
- QString getInterpreterName() const;
+ TQString getInterpreterName() const;
/**
* Set the name of the interpreter used
* on \a execute.
*/
- void setInterpreterName(const QString& interpretername);
+ void setInterpreterName(const TQString& interpretername);
/**
* \return the filename which will be executed
* on \a execute.
*/
- QString getFile() const;
+ TQString getFile() const;
/**
* Set the filename which will be executed
* on \a execute. The \p scriptfile needs to
- * be a valid local file or QString::null if
+ * be a valid local file or TQString() if
* you don't like to use a file rather then
* the with \a setCode() defined scripting code.
*/
- void setFile(const QString& scriptfile);
+ void setFile(const TQString& scriptfile);
/**
* \return a map of options this \a ScriptContainer defines.
* The options are returned call-by-ref, so you are able to
* manipulate them.
*/
- QMap<QString, QVariant>& getOptions();
+ TQMap<TQString, TQVariant>& getOptions();
/**
* \return the value of the option defined with \p name .
@@ -143,12 +143,12 @@ namespace Kross { namespace Api {
* the \a Manager options are seeked for the \p name and
* if not found either the \p defaultvalue is returned.
*/
- QVariant getOption(const QString name, QVariant defaultvalue = QVariant(), bool recursive = false);
+ TQVariant getOption(const TQString name, TQVariant defaultvalue = TQVariant(), bool recursive = false);
/**
* Set the \a Interpreter::Option value.
*/
- bool setOption(const QString name, const QVariant& value);
+ bool setOption(const TQString name, const TQVariant& value);
/**
* Execute the script container.
@@ -159,7 +159,7 @@ namespace Kross { namespace Api {
* Return a list of functionnames the with
* \a setCode defined scriptcode spends.
*/
- const QStringList getFunctionNames();
+ const TQStringList getFunctionNames();
/**
* Call a function in the script container.
@@ -171,17 +171,17 @@ namespace Kross { namespace Api {
* \return \a Object instance representing
* the functioncall returnvalue.
*/
- KSharedPtr<Object> callFunction(const QString& functionname, KSharedPtr<List> arguments = 0);
+ KSharedPtr<Object> callFunction(const TQString& functionname, KSharedPtr<List> arguments = 0);
/**
* Return a list of classes.
*/
- QStringList getClassNames();
+ TQStringList getClassNames();
/**
* Create and return a new class instance.
*/
- KSharedPtr<Object> classInstance(const QString& classname);
+ KSharedPtr<Object> classInstance(const TQString& classname);
/**
* Initialize the \a Script instance.
diff --git a/lib/kross/main/scriptguiclient.cpp b/lib/kross/main/scriptguiclient.cpp
index 28a89015..36d81151 100644
--- a/lib/kross/main/scriptguiclient.cpp
+++ b/lib/kross/main/scriptguiclient.cpp
@@ -44,49 +44,49 @@ namespace Kross { namespace Api {
{
public:
/**
- * The \a KXMLGUIClient that is parent of the \a ScriptGUIClient
+ * The \a KXMLGUIClient that is tqparent of the \a ScriptGUIClient
* instance.
*/
KXMLGUIClient* guiclient;
/**
- * The optional parent QWidget widget.
+ * The optional tqparent TQWidget widget.
*/
- QWidget* parent;
+ TQWidget* tqparent;
/**
* Map of \a ScriptActionCollection instances the \a ScriptGUIClient
* is attached to.
*/
- QMap<QString, ScriptActionCollection*> collections;
+ TQMap<TQString, ScriptActionCollection*> collections;
};
}}
-ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent)
- : QObject( parent )
+ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, TQWidget* tqparent)
+ : TQObject( tqparent )
, KXMLGUIClient( guiclient )
, d( new ScriptGUIClientPrivate() ) // initialize d-pointer class
{
- krossdebug( QString("ScriptGUIClient::ScriptGUIClient() Ctor") );
+ krossdebug( TQString("ScriptGUIClient::ScriptGUIClient() Ctor") );
d->guiclient = guiclient;
- d->parent = parent;
+ d->tqparent = tqparent;
setInstance( ScriptGUIClient::instance() );
// action to execute a scriptfile.
- new KAction(i18n("Execute Script File..."), 0, 0, this, SLOT(executeScriptFile()), actionCollection(), "executescriptfile");
+ new KAction(i18n("Execute Script File..."), 0, 0, this, TQT_SLOT(executeScriptFile()), actionCollection(), "executescriptfile");
// acion to show the ScriptManagerGUI dialog.
- new KAction(i18n("Scripts Manager..."), 0, 0, this, SLOT(showScriptManager()), actionCollection(), "configurescripts");
+ new KAction(i18n("Scripts Manager..."), 0, 0, this, TQT_SLOT(showScriptManager()), actionCollection(), "configurescripts");
// The predefined ScriptActionCollection's this ScriptGUIClient provides.
- d->collections.replace("installedscripts",
+ d->collections.tqreplace("installedscripts",
new ScriptActionCollection(i18n("Scripts"), actionCollection(), "installedscripts") );
- d->collections.replace("loadedscripts",
+ d->collections.tqreplace("loadedscripts",
new ScriptActionCollection(i18n("Loaded"), actionCollection(), "loadedscripts") );
- d->collections.replace("executedscripts",
+ d->collections.tqreplace("executedscripts",
new ScriptActionCollection(i18n("History"), actionCollection(), "executedscripts") );
reloadInstalledScripts();
@@ -94,36 +94,36 @@ ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent)
ScriptGUIClient::~ScriptGUIClient()
{
- krossdebug( QString("ScriptGUIClient::~ScriptGUIClient() Dtor") );
- for(QMap<QString, ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
+ krossdebug( TQString("ScriptGUIClient::~ScriptGUIClient() Dtor") );
+ for(TQMap<TQString, ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
delete it.data();
delete d;
}
-bool ScriptGUIClient::hasActionCollection(const QString& name)
+bool ScriptGUIClient::hasActionCollection(const TQString& name)
{
- return d->collections.contains(name);
+ return d->collections.tqcontains(name);
}
-ScriptActionCollection* ScriptGUIClient::getActionCollection(const QString& name)
+ScriptActionCollection* ScriptGUIClient::getActionCollection(const TQString& name)
{
return d->collections[name];
}
-QMap<QString, ScriptActionCollection*> ScriptGUIClient::getActionCollections()
+TQMap<TQString, ScriptActionCollection*> ScriptGUIClient::getActionCollections()
{
return d->collections;
}
-void ScriptGUIClient::addActionCollection(const QString& name, ScriptActionCollection* collection)
+void ScriptGUIClient::addActionCollection(const TQString& name, ScriptActionCollection* collection)
{
removeActionCollection(name);
- d->collections.replace(name, collection);
+ d->collections.tqreplace(name, collection);
}
-bool ScriptGUIClient::removeActionCollection(const QString& name)
+bool ScriptGUIClient::removeActionCollection(const TQString& name)
{
- if(d->collections.contains(name)) {
+ if(d->collections.tqcontains(name)) {
ScriptActionCollection* c = d->collections[name];
d->collections.remove(name);
delete c;
@@ -138,46 +138,46 @@ void ScriptGUIClient::reloadInstalledScripts()
if(installedcollection)
installedcollection->clear();
- QCString partname = d->guiclient->instance()->instanceName();
- QStringList files = KGlobal::dirs()->findAllResources("data", partname + "/scripts/*/*.rc");
+ TQCString partname = d->guiclient->instance()->instanceName();
+ TQStringList files = KGlobal::dirs()->findAllResources("data", partname + "/scripts/*/*.rc");
//files.sort();
- for(QStringList::iterator it = files.begin(); it != files.end(); ++it)
+ for(TQStringList::iterator it = files.begin(); it != files.end(); ++it)
loadScriptConfigFile(*it);
}
-bool ScriptGUIClient::installScriptPackage(const QString& scriptpackagefile)
+bool ScriptGUIClient::installScriptPackage(const TQString& scriptpackagefile)
{
- krossdebug( QString("Install script package: %1").arg(scriptpackagefile) );
+ krossdebug( TQString("Install script package: %1").tqarg(scriptpackagefile) );
KTar archive( scriptpackagefile );
if(! archive.open(IO_ReadOnly)) {
- KMessageBox::sorry(0, i18n("Could not read the package \"%1\".").arg(scriptpackagefile));
+ KMessageBox::sorry(0, i18n("Could not read the package \"%1\".").tqarg(scriptpackagefile));
return false;
}
- QCString partname = d->guiclient->instance()->instanceName();
- QString destination = KGlobal::dirs()->saveLocation("data", partname + "/scripts/", true);
- //QString destination = KGlobal::dirs()->saveLocation("appdata", "scripts", true);
+ TQCString partname = d->guiclient->instance()->instanceName();
+ TQString destination = KGlobal::dirs()->saveLocation("data", partname + "/scripts/", true);
+ //TQString destination = KGlobal::dirs()->saveLocation("appdata", "scripts", true);
if(destination.isNull()) {
krosswarning("ScriptGUIClient::installScriptPackage() Failed to determinate location where the scriptpackage should be installed to!");
return false;
}
- QString packagename = QFileInfo(scriptpackagefile).baseName();
+ TQString packagename = TQFileInfo(scriptpackagefile).baseName();
destination += packagename; // add the packagename to the name of the destination-directory.
- if( QDir(destination).exists() ) {
+ if( TQDir(destination).exists() ) {
if( KMessageBox::warningContinueCancel(0,
- i18n("A script package with the name \"%1\" already exists. Replace this package?" ).arg(packagename),
+ i18n("A script package with the name \"%1\" already exists. Replace this package?" ).tqarg(packagename),
i18n("Replace")) != KMessageBox::Continue )
return false;
if(! KIO::NetAccess::del(destination, 0) ) {
- KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").arg(destination));
+ KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").tqarg(destination));
return false;
}
}
- krossdebug( QString("Copy script-package to destination directory: %1").arg(destination) );
+ krossdebug( TQString("Copy script-package to destination directory: %1").tqarg(destination) );
const KArchiveDirectory* archivedir = archive.directory();
archivedir->copyTo(destination, true);
@@ -185,40 +185,40 @@ bool ScriptGUIClient::installScriptPackage(const QString& scriptpackagefile)
return true;
}
-bool ScriptGUIClient::uninstallScriptPackage(const QString& scriptpackagepath)
+bool ScriptGUIClient::uninstallScriptPackage(const TQString& scriptpackagepath)
{
if(! KIO::NetAccess::del(scriptpackagepath, 0) ) {
- KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").arg(scriptpackagepath));
+ KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").tqarg(scriptpackagepath));
return false;
}
reloadInstalledScripts();
return true;
}
-bool ScriptGUIClient::loadScriptConfigFile(const QString& scriptconfigfile)
+bool ScriptGUIClient::loadScriptConfigFile(const TQString& scriptconfigfile)
{
- krossdebug( QString("ScriptGUIClient::loadScriptConfig file=%1").arg(scriptconfigfile) );
+ krossdebug( TQString("ScriptGUIClient::loadScriptConfig file=%1").tqarg(scriptconfigfile) );
- QDomDocument domdoc;
- QFile file(scriptconfigfile);
+ TQDomDocument domdoc;
+ TQFile file(scriptconfigfile);
if(! file.open(IO_ReadOnly)) {
- krosswarning( QString("ScriptGUIClient::loadScriptConfig(): Failed to read scriptconfigfile: %1").arg(scriptconfigfile) );
+ krosswarning( TQString("ScriptGUIClient::loadScriptConfig(): Failed to read scriptconfigfile: %1").tqarg(scriptconfigfile) );
return false;
}
bool ok = domdoc.setContent(&file);
file.close();
if(! ok) {
- krosswarning( QString("ScriptGUIClient::loadScriptConfig(): Failed to parse scriptconfigfile: %1").arg(scriptconfigfile) );
+ krosswarning( TQString("ScriptGUIClient::loadScriptConfig(): Failed to parse scriptconfigfile: %1").tqarg(scriptconfigfile) );
return false;
}
return loadScriptConfigDocument(scriptconfigfile, domdoc);
}
-bool ScriptGUIClient::loadScriptConfigDocument(const QString& scriptconfigfile, const QDomDocument &document)
+bool ScriptGUIClient::loadScriptConfigDocument(const TQString& scriptconfigfile, const TQDomDocument &document)
{
ScriptActionCollection* installedcollection = d->collections["installedscripts"];
- QDomNodeList nodelist = document.elementsByTagName("ScriptAction");
+ TQDomNodeList nodelist = document.elementsByTagName("ScriptAction");
uint nodelistcount = nodelist.count();
for(uint i = 0; i < nodelistcount; i++) {
ScriptAction::Ptr action = new ScriptAction(scriptconfigfile, nodelist.item(i).toElement());
@@ -244,28 +244,28 @@ bool ScriptGUIClient::loadScriptConfigDocument(const QString& scriptconfigfile,
else {
// else just print a warning and fall through (so, install the action
// and don't care any longer of the duplicated name)...
- krosswarning( QString("Kross::Api::ScriptGUIClient::loadScriptConfigDocument: There exists already a scriptaction with name \"%1\". Added anyway...").arg(action->name()) );
+ krosswarning( TQString("Kross::Api::ScriptGUIClient::loadScriptConfigDocument: There exists already a scriptaction with name \"%1\". Added anyway...").tqarg(action->name()) );
}
}
installedcollection->attach( action );
}
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
}
emit collectionChanged(installedcollection);
return true;
}
-void ScriptGUIClient::setXMLFile(const QString& file, bool merge, bool setXMLDoc)
+void ScriptGUIClient::setXMLFile(const TQString& file, bool merge, bool setXMLDoc)
{
KXMLGUIClient::setXMLFile(file, merge, setXMLDoc);
}
-void ScriptGUIClient::setDOMDocument(const QDomDocument &document, bool merge)
+void ScriptGUIClient::setDOMDocument(const TQDomDocument &document, bool merge)
{
ScriptActionCollection* installedcollection = d->collections["installedscripts"];
if(! merge && installedcollection)
@@ -277,7 +277,7 @@ void ScriptGUIClient::setDOMDocument(const QDomDocument &document, bool merge)
void ScriptGUIClient::successfullyExecuted()
{
- const ScriptAction* action = dynamic_cast< const ScriptAction* >( QObject::sender() );
+ const ScriptAction* action = dynamic_cast< const ScriptAction* >( TQObject::sender() );
if(action) {
emit executionFinished(action);
ScriptActionCollection* executedcollection = d->collections["executedscripts"];
@@ -290,9 +290,9 @@ void ScriptGUIClient::successfullyExecuted()
}
}
-void ScriptGUIClient::executionFailed(const QString& errormessage, const QString& tracedetails)
+void ScriptGUIClient::executionFailed(const TQString& errormessage, const TQString& tracedetails)
{
- const ScriptAction* action = dynamic_cast< const ScriptAction* >( QObject::sender() );
+ const ScriptAction* action = dynamic_cast< const ScriptAction* >( TQObject::sender() );
if(action)
emit executionFinished(action);
if(tracedetails.isEmpty())
@@ -301,17 +301,17 @@ void ScriptGUIClient::executionFailed(const QString& errormessage, const QString
KMessageBox::detailedError(0, errormessage, tracedetails);
}
-KURL ScriptGUIClient::openScriptFile(const QString& caption)
+KURL ScriptGUIClient::openScriptFile(const TQString& caption)
{
- QStringList mimetypes;
- QMap<QString, InterpreterInfo*> infos = Manager::scriptManager()->getInterpreterInfos();
- for(QMap<QString, InterpreterInfo*>::Iterator it = infos.begin(); it != infos.end(); ++it)
+ TQStringList mimetypes;
+ TQMap<TQString, InterpreterInfo*> infos = Manager::scriptManager()->getInterpreterInfos();
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = infos.begin(); it != infos.end(); ++it)
mimetypes.append( it.data()->getMimeTypes().join(" ").stripWhiteSpace() );
KFileDialog* filedialog = new KFileDialog(
- QString::null, // startdir
+ TQString(), // startdir
mimetypes.join(" "), // filter
- 0, // parent widget
+ 0, // tqparent widget
"ScriptGUIClientFileDialog", // name
true // modal
);
@@ -329,11 +329,11 @@ bool ScriptGUIClient::loadScriptFile()
ScriptActionCollection* loadedcollection = d->collections["loadedscripts"];
if(loadedcollection) {
ScriptAction::Ptr action = new ScriptAction( url.path() );
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
loadedcollection->detach(action);
loadedcollection->attach(action);
@@ -351,9 +351,9 @@ bool ScriptGUIClient::executeScriptFile()
return false;
}
-bool ScriptGUIClient::executeScriptFile(const QString& file)
+bool ScriptGUIClient::executeScriptFile(const TQString& file)
{
- krossdebug( QString("Kross::Api::ScriptGUIClient::executeScriptFile() file='%1'").arg(file) );
+ krossdebug( TQString("Kross::Api::ScriptGUIClient::executeScriptFile() file='%1'").tqarg(file) );
ScriptAction::Ptr action = new ScriptAction(file);
return executeScriptAction(action);
@@ -361,11 +361,11 @@ bool ScriptGUIClient::executeScriptFile(const QString& file)
bool ScriptGUIClient::executeScriptAction(ScriptAction::Ptr action)
{
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
action->activate();
bool ok = action->hadException();
action->finalize(); // execution is done.
@@ -374,10 +374,10 @@ bool ScriptGUIClient::executeScriptAction(ScriptAction::Ptr action)
void ScriptGUIClient::showScriptManager()
{
- KDialogBase* dialog = new KDialogBase(d->parent, "", true, i18n("Scripts Manager"), KDialogBase::Close);
+ KDialogBase* dialog = new KDialogBase(d->tqparent, "", true, i18n("Scripts Manager"), KDialogBase::Close);
WdgScriptsManager* wsm = new WdgScriptsManager(this, dialog);
dialog->setMainWidget(wsm);
- dialog->resize( QSize(360, 320).expandedTo(dialog->minimumSizeHint()) );
+ dialog->resize( TQSize(360, 320).expandedTo(dialog->tqminimumSizeHint()) );
dialog->show();
}
diff --git a/lib/kross/main/scriptguiclient.h b/lib/kross/main/scriptguiclient.h
index 955b55d9..af762720 100644
--- a/lib/kross/main/scriptguiclient.h
+++ b/lib/kross/main/scriptguiclient.h
@@ -23,12 +23,12 @@
#include "scriptcontainer.h"
#include "scriptaction.h"
-#include <qobject.h>
-#include <qdom.h>
+#include <tqobject.h>
+#include <tqdom.h>
#include <kurl.h>
#include <kxmlguiclient.h>
-class QWdiget;
+class TQWdiget;
namespace Kross { namespace Api {
@@ -41,28 +41,29 @@ namespace Kross { namespace Api {
* scripting code used to extend an applications functionality.
*/
class KDE_EXPORT ScriptGUIClient
- : public QObject
+ : public TQObject
, public KXMLGUIClient
{
Q_OBJECT
- //Q_PROPERTY(QString configfile READ getConfigFile WRITE setConfigFile)
+ TQ_OBJECT
+ //TQ_PROPERTY(TQString configfile READ getConfigFile WRITE setConfigFile)
public:
/// List of KAction instances.
- typedef QPtrList<KAction> List;
+ typedef TQPtrList<KAction> List;
/**
* Constructor.
*
* \param guiclient The KXMLGUIClient this \a ScriptGUIClient
* is a child of.
- * \param parent The parent QWidget. If defined Qt will handle
+ * \param tqparent The tqparent TQWidget. If defined TQt will handle
* freeing this \a ScriptGUIClient instance else the
* caller has to take care of freeing this instance
* if not needed any longer.
*/
- explicit ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent = 0);
+ explicit ScriptGUIClient(KXMLGUIClient* guiclient, TQWidget* tqparent = 0);
/**
* Destructor.
@@ -73,13 +74,13 @@ namespace Kross { namespace Api {
* \return true if this \a ScriptGUIClient has a \a ScriptActionCollection
* with the name \p name else false is returned.
*/
- bool hasActionCollection(const QString& name);
+ bool hasActionCollection(const TQString& name);
/**
* \return the \a ScriptActionCollection which has the name \p name
* or NULL if there exists no such \a ScriptActionCollection .
*/
- ScriptActionCollection* getActionCollection(const QString& name);
+ ScriptActionCollection* getActionCollection(const TQString& name);
/**
* \return a map of all avaiable \a ScriptActionCollection instances
@@ -88,18 +89,18 @@ namespace Kross { namespace Api {
* 1. "installedscripts" The installed collection of scripts.
* 2. "loadedscripts" The loaded scripts.
*/
- QMap<QString, ScriptActionCollection*> getActionCollections();
+ TQMap<TQString, ScriptActionCollection*> getActionCollections();
/**
* Add a new \a ScriptActionCollection with the name \p name to
* our map of actioncollections.
*/
- void addActionCollection(const QString& name, ScriptActionCollection* collection);
+ void addActionCollection(const TQString& name, ScriptActionCollection* collection);
/**
* Remove the \a ScriptActionCollection defined with name \p name.
*/
- bool removeActionCollection(const QString& name);
+ bool removeActionCollection(const TQString& name);
/**
* Reload the list of installed scripts.
@@ -111,33 +112,33 @@ namespace Kross { namespace Api {
* packagefile should be a tar.gz-archive which will be
* extracted and to the users script-directory.
*/
- bool installScriptPackage(const QString& scriptpackagefile);
+ bool installScriptPackage(const TQString& scriptpackagefile);
/**
* Uninstall the scriptpackage located in the path
* \p scriptpackagepath . This just deletes the whole
* directory.
*/
- bool uninstallScriptPackage(const QString& scriptpackagepath);
+ bool uninstallScriptPackage(const TQString& scriptpackagepath);
/**
* Load the scriptpackage's configurationfile
* \p scriptconfigfile and add the defined \a ScriptAction
* instances to the list of installed scripts.
*/
- bool loadScriptConfigFile(const QString& scriptconfigfile);
+ bool loadScriptConfigFile(const TQString& scriptconfigfile);
/**
* Load the \p document DOM-document from the scriptpackage's
* XML-configfile \p scriptconfigfile and add the defined
* \a ScriptAction instances to the list of installed scripts.
*/
- bool loadScriptConfigDocument(const QString& scriptconfigfile, const QDomDocument &document);
+ bool loadScriptConfigDocument(const TQString& scriptconfigfile, const TQDomDocument &document);
/// KXMLGUIClient overloaded method to set the XML file.
- virtual void setXMLFile(const QString& file, bool merge = false, bool setXMLDoc = true);
+ virtual void setXMLFile(const TQString& file, bool merge = false, bool setXMLDoc = true);
/// KXMLGUIClient overloaded method to set the XML DOM-document.
- virtual void setDOMDocument(const QDomDocument &document, bool merge = false);
+ virtual void setDOMDocument(const TQDomDocument &document, bool merge = false);
public slots:
@@ -145,7 +146,7 @@ namespace Kross { namespace Api {
* A KFileDialog will be displayed to let the user choose
* a scriptfile. The choosen file will be returned as KURL.
*/
- KURL openScriptFile(const QString& caption = QString::null);
+ KURL openScriptFile(const TQString& caption = TQString());
/**
* A KFileDialog will be displayed to let the user choose
@@ -168,7 +169,7 @@ namespace Kross { namespace Api {
* the defined filename to auto-detect the \a Interpreter which
* should be used for the execution.
*/
- bool executeScriptFile(const QString& file);
+ bool executeScriptFile(const TQString& file);
/**
* This method executes the \a ScriptAction \p action .
@@ -189,7 +190,7 @@ namespace Kross { namespace Api {
* Called if execution of this \a ScriptAction failed and
* displays an errormessage-dialog.
*/
- void executionFailed(const QString& errormessage, const QString& tracedetails);
+ void executionFailed(const TQString& errormessage, const TQString& tracedetails);
/**
* Called if execution of this \a ScriptAction was
diff --git a/lib/kross/main/wdgscriptsmanager.cpp b/lib/kross/main/wdgscriptsmanager.cpp
index 10924519..7b9a927d 100644
--- a/lib/kross/main/wdgscriptsmanager.cpp
+++ b/lib/kross/main/wdgscriptsmanager.cpp
@@ -18,11 +18,11 @@
*/
#include "wdgscriptsmanager.h"
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qheader.h>
-#include <qobjectlist.h>
-#include <qtooltip.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqheader.h>
+#include <tqobjectlist.h>
+#include <tqtooltip.h>
#include <kapplication.h>
#include <kdeversion.h>
@@ -57,8 +57,8 @@ namespace Kross { namespace Api {
class ScriptNewStuff : public KNewStuffSecure
{
public:
- ScriptNewStuff(ScriptGUIClient* scripguiclient, const QString& type, QWidget *parentWidget = 0)
- : KNewStuffSecure(type, parentWidget)
+ ScriptNewStuff(ScriptGUIClient* scripguiclient, const TQString& type, TQWidget *tqparentWidget = 0)
+ : KNewStuffSecure(type, tqparentWidget)
, m_scripguiclient(scripguiclient) {}
virtual ~ScriptNewStuff() {}
private:
@@ -67,35 +67,35 @@ class ScriptNewStuff : public KNewStuffSecure
};
#endif
-class ListItem : public QListViewItem
+class ListItem : public TQListViewItem
{
private:
ScriptActionCollection* m_collection;
ScriptAction::Ptr m_action;
public:
- ListItem(QListView* parentview, ScriptActionCollection* collection)
- : QListViewItem(parentview), m_collection(collection), m_action(0) {}
+ ListItem(TQListView* tqparentview, ScriptActionCollection* collection)
+ : TQListViewItem(tqparentview), m_collection(collection), m_action(0) {}
- ListItem(ListItem* parentitem, QListViewItem* afteritem, ScriptAction::Ptr action)
- : QListViewItem(parentitem, afteritem), m_collection( parentitem->collection() ), m_action(action) {}
+ ListItem(ListItem* tqparentitem, TQListViewItem* afteritem, ScriptAction::Ptr action)
+ : TQListViewItem(tqparentitem, afteritem), m_collection( tqparentitem->collection() ), m_action(action) {}
ScriptAction::Ptr action() const { return m_action; }
ScriptActionCollection* collection() const { return m_collection; }
//ScriptActionMenu* actionMenu() const { return m_menu; }
};
-class ToolTip : public QToolTip
+class ToolTip : public TQToolTip
{
public:
- ToolTip(KListView* parent) : QToolTip(parent->viewport()), m_parent(parent) {}
+ ToolTip(KListView* tqparent) : TQToolTip(tqparent->viewport()), m_parent(tqparent) {}
virtual ~ToolTip () { remove(m_parent->viewport()); }
protected:
- virtual void maybeTip(const QPoint& p) {
+ virtual void maybeTip(const TQPoint& p) {
ListItem* item = dynamic_cast<ListItem*>( m_parent->itemAt(p) );
if(item) {
- QRect r( m_parent->itemRect(item) );
+ TQRect r( m_parent->tqitemRect(item) );
if(r.isValid() && item->action()) {
- tip(r, QString("<qt>%1</qt>").arg(item->action()->toolTip()));
+ tip(r, TQString("<qt>%1</qt>").tqarg(item->action()->toolTip()));
}
}
}
@@ -114,8 +114,8 @@ class WdgScriptsManagerPrivate
//enum { LoadBtn = 0, UnloadBtn, InstallBtn, UninstallBtn, ExecBtn, NewStuffBtn };
};
-WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent, const char* name, WFlags fl )
- : WdgScriptsManagerBase(parent, name, fl)
+WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, TQWidget* tqparent, const char* name, WFlags fl )
+ : WdgScriptsManagerBase(tqparent, name, fl)
, d(new WdgScriptsManagerPrivate)
{
d->m_scripguiclient = scr;
@@ -130,50 +130,50 @@ WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent, cons
//scriptsList->setRootIsDecorated(true);
scriptsList->setSorting(-1);
scriptsList->addColumn("text");
- //scriptsList->setColumnWidthMode(1, QListView::Manual);
+ //scriptsList->setColumnWidthMode(1, TQListView::Manual);
slotFillScriptsList();
slotSelectionChanged(0);
- connect(scriptsList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectionChanged(QListViewItem*)));
+ connect(scriptsList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem*)));
btnExec->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "exec", KIcon::MainToolbar, 16 ));
- connect(btnExec, SIGNAL(clicked()), this, SLOT(slotExecuteScript()));
+ connect(btnExec, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExecuteScript()));
btnLoad->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileopen", KIcon::MainToolbar, 16 ));
- connect(btnLoad, SIGNAL(clicked()), this, SLOT(slotLoadScript()));
+ connect(btnLoad, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotLoadScript()));
btnUnload->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileclose", KIcon::MainToolbar, 16 ));
- connect(btnUnload, SIGNAL(clicked()), this, SLOT(slotUnloadScript()));
+ connect(btnUnload, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUnloadScript()));
btnInstall->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileimport", KIcon::MainToolbar, 16 ));
- connect(btnInstall, SIGNAL(clicked()), this, SLOT(slotInstallScript()));
+ connect(btnInstall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInstallScript()));
btnUninstall->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileclose", KIcon::MainToolbar, 16 ));
- connect(btnUninstall, SIGNAL(clicked()), this, SLOT(slotUninstallScript()));
+ connect(btnUninstall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUninstallScript()));
#ifdef KROSS_SUPPORT_NEWSTUFF
btnNewStuff->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "knewstuff", KIcon::MainToolbar, 16 ));
- connect(btnNewStuff, SIGNAL(clicked()), this, SLOT(slotGetNewScript()));
+ connect(btnNewStuff, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGetNewScript()));
#endif
/*
toolBar->setIconText( KToolBar::IconTextRight );
toolBar->insertButton("exec", WdgScriptsManagerPrivate::ExecBtn, false, i18n("Execute"));
- toolBar->addConnection(WdgScriptsManagerPrivate::ExecBtn, SIGNAL(clicked()), this, SLOT(slotExecuteScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::ExecBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExecuteScript()));
toolBar->insertLineSeparator();
toolBar->insertButton("fileopen", WdgScriptsManagerPrivate::LoadBtn, true, i18n("Load"));
- toolBar->addConnection(WdgScriptsManagerPrivate::LoadBtn, SIGNAL(clicked()), this, SLOT(slotLoadScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::LoadBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotLoadScript()));
toolBar->insertButton("fileclose", WdgScriptsManagerPrivate::UnloadBtn, false, i18n("Unload"));
- toolBar->addConnection(WdgScriptsManagerPrivate::UnloadBtn, SIGNAL(clicked()), this, SLOT(slotUnloadScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::UnloadBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUnloadScript()));
toolBar->insertLineSeparator();
toolBar->insertButton("fileimport", WdgScriptsManagerPrivate::InstallBtn, true, i18n("Install"));
- toolBar->addConnection(WdgScriptsManagerPrivate::InstallBtn, SIGNAL(clicked()), this, SLOT(slotInstallScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::InstallBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInstallScript()));
toolBar->insertButton("fileclose", WdgScriptsManagerPrivate::UninstallBtn, false, i18n("Uninstall"));
- toolBar->addConnection(WdgScriptsManagerPrivate::UninstallBtn, SIGNAL(clicked()), this, SLOT(slotUninstallScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::UninstallBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUninstallScript()));
#ifdef KROSS_SUPPORT_NEWSTUFF
toolBar->insertLineSeparator();
toolBar->insertButton("knewstuff", WdgScriptsManagerPrivate::NewStuffBtn, true, i18n("Get More Scripts"));
- toolBar->addConnection(WdgScriptsManagerPrivate::NewStuffBtn, SIGNAL(clicked()), this, SLOT(slotGetNewScript()));
+ toolBar->addConnection(WdgScriptsManagerPrivate::NewStuffBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGetNewScript()));
#endif
*/
- connect(scr, SIGNAL( collectionChanged(ScriptActionCollection*) ),
- this, SLOT( slotFillScriptsList() ));
+ connect(scr, TQT_SIGNAL( collectionChanged(ScriptActionCollection*) ),
+ this, TQT_SLOT( slotFillScriptsList() ));
}
WdgScriptsManager::~WdgScriptsManager()
@@ -200,29 +200,29 @@ void WdgScriptsManager::addItem(ScriptActionCollection* collection)
i->setText(0, collection->actionMenu()->text());
i->setOpen(true);
- QValueList<ScriptAction::Ptr> list = collection->actions();
- QListViewItem* lastitem = 0;
- for(QValueList<ScriptAction::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
+ TQValueList<ScriptAction::Ptr> list = collection->actions();
+ TQListViewItem* lastitem = 0;
+ for(TQValueList<ScriptAction::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
lastitem = addItem(*it, i, lastitem);
}
-QListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, QListViewItem* parentitem, QListViewItem* afteritem)
+TQListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, TQListViewItem* tqparentitem, TQListViewItem* afteritem)
{
if(! action)
return 0;
- ListItem* i = new ListItem(dynamic_cast<ListItem*>(parentitem), afteritem, action);
+ ListItem* i = new ListItem(dynamic_cast<ListItem*>(tqparentitem), afteritem, action);
i->setText(0, action->text()); // FIXME: i18nise it for ko2.0
//i->setText(1, action->getDescription()); // FIXME: i18nise it for ko2.0
//i->setText(2, action->name());
- QPixmap pm;
+ TQPixmap pm;
if(action->hasIcon()) {
KIconLoader* icons = KGlobal::iconLoader();
- pm = icons->loadIconSet(action->icon(), KIcon::Small).pixmap(QIconSet::Small, QIconSet::Active);
+ pm = icons->loadIconSet(action->icon(), KIcon::Small).pixmap(TQIconSet::Small, TQIconSet::Active);
}
else {
- pm = action->iconSet(KIcon::Small, 16).pixmap(QIconSet::Small, QIconSet::Active);
+ pm = action->iconSet(KIcon::Small, 16).pixmap(TQIconSet::Small, TQIconSet::Active);
}
if(! pm.isNull())
i->setPixmap(0, pm); // display the icon
@@ -230,7 +230,7 @@ QListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, QListViewIte
return i;
}
-void WdgScriptsManager::slotSelectionChanged(QListViewItem* item)
+void WdgScriptsManager::slotSelectionChanged(TQListViewItem* item)
{
ListItem* i = dynamic_cast<ListItem*>(item);
Kross::Api::ScriptActionCollection* installedcollection = d->m_scripguiclient->getActionCollection("installedscripts");
@@ -252,9 +252,9 @@ void WdgScriptsManager::slotLoadScript()
void WdgScriptsManager::slotInstallScript()
{
KFileDialog* filedialog = new KFileDialog(
- QString::null, // startdir
+ TQString(), // startdir
"*.tar.gz *.tgz *.bz2", // filter
- this, // parent widget
+ this, // tqparent widget
"WdgScriptsManagerInstallFileDialog", // name
true // modal
);
@@ -281,13 +281,13 @@ void WdgScriptsManager::slotUninstallScript()
if( !item->collection() || item->collection() != installedcollection)
return;
- const QString packagepath = item->action()->getPackagePath();
+ const TQString packagepath = item->action()->getPackagePath();
if( !packagepath)
return;
if( KMessageBox::warningContinueCancel(0,
i18n("Uninstall the script package \"%1\" and delete the package's folder \"%2\"?")
- .arg(item->action()->text()).arg(packagepath),
+ .tqarg(item->action()->text()).tqarg(packagepath),
i18n("Uninstall")) != KMessageBox::Continue )
{
return;
@@ -320,12 +320,12 @@ void WdgScriptsManager::slotUnloadScript()
void WdgScriptsManager::slotGetNewScript()
{
#ifdef KROSS_SUPPORT_NEWSTUFF
- const QString appname = KApplication::kApplication()->name();
- const QString type = QString("%1/script").arg(appname);
+ const TQString appname = KApplication::kApplication()->name();
+ const TQString type = TQString("%1/script").tqarg(appname);
if(! d->newstuff) {
d->newstuff = new ScriptNewStuff(d->m_scripguiclient, type);
- connect(d->newstuff, SIGNAL(installFinished()), this, SLOT(slotResourceInstalled()));
+ connect(d->newstuff, TQT_SIGNAL(installFinished()), this, TQT_SLOT(slotResourceInstalled()));
}
KNS::Engine *engine = new KNS::Engine(d->newstuff, type, this);
@@ -333,10 +333,10 @@ void WdgScriptsManager::slotGetNewScript()
d->setType(type);
KNS::ProviderLoader *p = new KNS::ProviderLoader(this);
- QObject::connect(p, SIGNAL(providersLoaded(Provider::List*)),
- d, SLOT(slotProviders(Provider::List*)));
+ TQObject::connect(p, TQT_SIGNAL(providersLoaded(Provider::List*)),
+ d, TQT_SLOT(slotProviders(Provider::List*)));
- p->load(type, QString("http://download.kde.org/khotnewstuff/%1scripts-providers.xml").arg(appname));
+ p->load(type, TQString("http://download.kde.org/khotnewstuff/%1scripts-providers.xml").tqarg(appname));
d->exec();
#endif
}
@@ -346,7 +346,7 @@ void WdgScriptsManager::slotResourceInstalled()
// Delete KNewStuff's configuration entries. These entries reflect what has
// already been installed. As we cannot yet keep them in sync after uninstalling
// scripts, we deactivate the check marks entirely.
- KGlobal::config()->deleteGroup("KNewStuffStatus");
+ KGlobal::config()->deleteGroup("KNewStufftqStatus");
}
}}
diff --git a/lib/kross/main/wdgscriptsmanager.h b/lib/kross/main/wdgscriptsmanager.h
index 031d5b3c..b953f862 100644
--- a/lib/kross/main/wdgscriptsmanager.h
+++ b/lib/kross/main/wdgscriptsmanager.h
@@ -35,8 +35,9 @@ class WdgScriptsManagerPrivate;
class WdgScriptsManager : public WdgScriptsManagerBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ WdgScriptsManager(ScriptGUIClient* scr, TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0);
~WdgScriptsManager();
public slots:
void slotLoadScript();
@@ -45,14 +46,14 @@ class WdgScriptsManager : public WdgScriptsManagerBase
void slotExecuteScript();
void slotUnloadScript();
void slotGetNewScript();
- void slotSelectionChanged(QListViewItem*);
+ void slotSelectionChanged(TQListViewItem*);
private slots:
void slotFillScriptsList();
void slotResourceInstalled();
private:
WdgScriptsManagerPrivate* d;
void addItem(ScriptActionCollection* collection);
- QListViewItem* addItem(ScriptAction::Ptr, QListViewItem* parentitem, QListViewItem* afteritem);
+ TQListViewItem* addItem(ScriptAction::Ptr, TQListViewItem* tqparentitem, TQListViewItem* afteritem);
};
}}
diff --git a/lib/kross/main/wdgscriptsmanagerbase.ui b/lib/kross/main/wdgscriptsmanagerbase.ui
index 18ab2b23..22ad3867 100644
--- a/lib/kross/main/wdgscriptsmanagerbase.ui
+++ b/lib/kross/main/wdgscriptsmanagerbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>WdgScriptsManagerBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>WdgScriptsManagerBase</cstring>
</property>
@@ -20,7 +20,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@@ -54,9 +54,9 @@
<cstring>toolBar</cstring>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
@@ -66,7 +66,7 @@
<property name="name">
<cstring>btnExec</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -97,7 +97,7 @@
<property name="name">
<cstring>btnLoad</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -114,7 +114,7 @@
<property name="name">
<cstring>btnUnload</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -145,7 +145,7 @@
<property name="name">
<cstring>btnInstall</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -162,7 +162,7 @@
<property name="name">
<cstring>btnUninstall</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -193,7 +193,7 @@
<property name="name">
<cstring>btnNewStuff</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -233,7 +233,7 @@
<data format="XBM.GZ" length="79">789c534e494dcbcc4b554829cdcdad8c2fcf4c29c95030e0524611cd48cd4ccf28010a1797249664262b2467241641a592324b8aa363156c15aab914146aadb90067111b1f</data>
</image>
</images>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klistview.h</includehint>
<includehint>ktoolbar.h</includehint>
diff --git a/lib/kross/python/cxx/Objects.hxx b/lib/kross/python/cxx/Objects.hxx
index 41648320..900a347b 100644
--- a/lib/kross/python/cxx/Objects.hxx
+++ b/lib/kross/python/cxx/Objects.hxx
@@ -54,7 +54,7 @@ namespace Py
// The purpose of this class is to serve as the most general kind of
// Python object, for the purpose of writing C++ extensions in Python
// Objects hold a PyObject* which they own. This pointer is always a
- // valid pointer to a Python object. In children we must maintain this behavior.
+ // valid pointer to a Python object. In tqchildren we must maintain this behavior.
//
// Instructions on how to make your own class MyType descended from Object:
// (0) Pick a base class, either Object or perhaps SeqBase<T> or MapBase<T>.
@@ -1470,8 +1470,8 @@ namespace Py
// Python strings return strings as individual elements.
// I'll try having a class Char which is a String of length 1
//
- typedef std::basic_string<Py_UNICODE> unicodestring;
- extern Py_UNICODE unicode_null_string[1];
+ typedef std::basic_string<Py_UNICODE> tqunicodestring;
+ extern Py_UNICODE tqunicode_null_string[1];
class Char: public Object
{
@@ -1535,7 +1535,7 @@ namespace Py
return *this;
}
- Char& operator= (const unicodestring& v)
+ Char& operator= (const tqunicodestring& v)
{
set(PyUnicode_FromUnicode (const_cast<Py_UNICODE*>(v.data()),1), true);
return *this;
@@ -1650,7 +1650,7 @@ namespace Py
static_cast<int>( v.length() ) ), true );
return *this;
}
- String& operator= (const unicodestring& v)
+ String& operator= (const tqunicodestring& v)
{
set( PyUnicode_FromUnicode( const_cast<Py_UNICODE*>( v.data() ),
static_cast<int>( v.length() ) ), true );
@@ -1706,16 +1706,16 @@ namespace Py
}
}
- unicodestring as_unicodestring() const
+ tqunicodestring as_tqunicodestring() const
{
if( isUnicode() )
{
- return unicodestring( PyUnicode_AS_UNICODE( ptr() ),
+ return tqunicodestring( PyUnicode_AS_UNICODE( ptr() ),
static_cast<size_type>( PyUnicode_GET_SIZE( ptr() ) ) );
}
else
{
- throw TypeError("can only return unicodestring from Unicode object");
+ throw TypeError("can only return tqunicodestring from Unicode object");
}
}
};
diff --git a/lib/kross/python/cxx/PyCXX.html b/lib/kross/python/cxx/PyCXX.html
index 566974c1..7213ad70 100644
--- a/lib/kross/python/cxx/PyCXX.html
+++ b/lib/kross/python/cxx/PyCXX.html
@@ -1,7 +1,7 @@
<html>
<head>
-<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
+<meta HTTP-ETQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<title>Writing Python Extensions in C++</title>
<style>
H1, H2, H3, H4 {color: #000099;
@@ -62,7 +62,7 @@ integrates Python with C++ in these ways: </p>
<p>Download PyCXX from <a href="http://sourceforge.net/projects/cxx/">http://sourceforge.net/projects/cxx/</a>.</p>
-<p>The distribution layout is:</p>
+<p>The distribution tqlayout is:</p>
<table>
<tr><th>Directory</th><th>Description</th></tr>
<tr><td class=code>.</td><td>Makefile for Unix and Windows, Release documentation</td>
@@ -303,7 +303,7 @@ returned by such a function, you need to know if the function returns you an <i>
or <i>unowned</i> reference. Unowned references are unusual but there are some cases where
unowned references are returned.</p>
-<p>Usually, <cite>Object</cite> and its children acquire a new reference when constructed from a
+<p>Usually, <cite>Object</cite> and its tqchildren acquire a new reference when constructed from a
<cite>PyObject *</cite>. This is usually not the right behavior if the reference comes from one
of the Python C API calls.</p>
@@ -1188,8 +1188,8 @@ sequence.</p>
<td class=code>as_std_string() const</td>
</tr>
<tr>
- <td class=code>unicodestring</td>
- <td class=code>as_unicodestring() const</td>
+ <td class=code>tqunicodestring</td>
+ <td class=code>as_tqunicodestring() const</td>
</tr>
</table>
@@ -1571,7 +1571,7 @@ converted to a standard string which is passed to std::ostream&amp; operator&lt;
<p>The Python exception facility and the C++ exception facility can be merged via the use
of try/catch blocks in the bodies of extension objects and module functions.</p>
-<h3>Class Exception and its children</h3>
+<h3>Class Exception and its tqchildren</h3>
<p>A set of classes is provided. Each is derived from class Exception, and represents a
particular sort of Python exception, such as IndexError, RuntimeError, ValueError. Each of
@@ -1612,7 +1612,7 @@ classes are shown here.</p>
</tr>
<tr>
<td class=code></td>
- <td>Constructors for other children of class Exception</td>
+ <td>Constructors for other tqchildren of class Exception</td>
</tr>
<tr>
<td class=code> </td>
diff --git a/lib/kross/python/cxx/cxxsupport.cxx b/lib/kross/python/cxx/cxxsupport.cxx
index 61329b60..b7bcaa0a 100644
--- a/lib/kross/python/cxx/cxxsupport.cxx
+++ b/lib/kross/python/cxx/cxxsupport.cxx
@@ -6,7 +6,7 @@
#include "Objects.hxx"
namespace Py {
-Py_UNICODE unicode_null_string[1] = { 0 };
+Py_UNICODE tqunicode_null_string[1] = { 0 };
Type Object::type () const
{
diff --git a/lib/kross/python/pythonextension.cpp b/lib/kross/python/pythonextension.cpp
index 59d9aaed..aab781ab 100644
--- a/lib/kross/python/pythonextension.cpp
+++ b/lib/kross/python/pythonextension.cpp
@@ -31,7 +31,7 @@ PythonExtension::PythonExtension(Kross::Api::Object::Ptr object)
, m_object(object)
{
#ifdef KROSS_PYTHON_EXTENSION_CTOR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::Constructor objectname='%1' objectclass='%2'").arg(m_object->getName()).arg(m_object->getClassName()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::Constructor objectname='%1' objectclass='%2'").tqarg(m_object->getName()).tqarg(m_object->getClassName()) );
#endif
behaviors().name("KrossPythonExtension");
@@ -55,7 +55,7 @@ PythonExtension::PythonExtension(Kross::Api::Object::Ptr object)
PythonExtension::~PythonExtension()
{
#ifdef KROSS_PYTHON_EXTENSION_DTOR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::Destructor objectname='%1' objectclass='%2'").arg(m_object->getName()).arg(m_object->getClassName()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::Destructor objectname='%1' objectclass='%2'").tqarg(m_object->getName()).tqarg(m_object->getClassName()) );
#endif
delete m_proxymethod;
}
@@ -64,7 +64,7 @@ PythonExtension::~PythonExtension()
Py::Object PythonExtension::str()
{
Kross::Api::Callable* callable = dynamic_cast< Kross::Api::Callable* >(m_object);
- QString s = callable ? callable->getName() : m_object->getClassName();
+ TQString s = callable ? callable->getName() : m_object->getClassName();
return toPyObject(s.isEmpty() ? : s);
}
@@ -77,16 +77,16 @@ Py::Object PythonExtension::repr()
Py::Object PythonExtension::getattr(const char* n)
{
#ifdef KROSS_PYTHON_EXTENSION_GETATTR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::getattr name='%1'").arg(n) );
+ krossdebug( TQString("Kross::Python::PythonExtension::getattr name='%1'").tqarg(n) );
#endif
if(n[0] == '_') {
if(!strcmp(n, "__methods__")) {
Py::List methods;
- QStringList calls = m_object->getCalls();
- for(QStringList::Iterator it = calls.begin(); it != calls.end(); ++it) {
+ TQStringList calls = m_object->getCalls();
+ for(TQStringList::Iterator it = calls.begin(); it != calls.end(); ++it) {
#ifdef KROSS_PYTHON_EXTENSION_GETATTR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::getattr name='%1' callable='%2'").arg(n).arg(*it) );
+ krossdebug( TQString("Kross::Python::PythonExtension::getattr name='%1' callable='%2'").tqarg(n).tqarg(*it) );
#endif
methods.append(Py::String( (*it).latin1() ));
}
@@ -97,11 +97,11 @@ Py::Object PythonExtension::getattr(const char* n)
Py::List members;
Kross::Api::Callable* callable = dynamic_cast<Kross::Api::Callable*>(m_object.data());
if(callable) {
- QMap<QString, Kross::Api::Object::Ptr> children = callable->getChildren();
- QMap<QString, Kross::Api::Object::Ptr>::Iterator it( children.begin() );
- for(; it != children.end(); ++it) {
+ TQMap<TQString, Kross::Api::Object::Ptr> tqchildren = callable->getChildren();
+ TQMap<TQString, Kross::Api::Object::Ptr>::Iterator it( tqchildren.begin() );
+ for(; it != tqchildren.end(); ++it) {
#ifdef KROSS_PYTHON_EXTENSION_GETATTR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::getattr n='%1' child='%2'").arg(n).arg(it.key()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::getattr n='%1' child='%2'").tqarg(n).tqarg(it.key()) );
#endif
members.append(Py::String( it.key().latin1() ));
}
@@ -109,11 +109,11 @@ Py::Object PythonExtension::getattr(const char* n)
return members;
}
- //if(n == "__dict__") { krosswarning( QString("PythonExtension::getattr(%1) __dict__").arg(n) ); return Py::None(); }
- //if(n == "__class__") { krosswarning( QString("PythonExtension::getattr(%1) __class__").arg(n) ); return Py::None(); }
+ //if(n == "__dict__") { krosswarning( TQString("PythonExtension::getattr(%1) __dict__").tqarg(n) ); return Py::None(); }
+ //if(n == "__class__") { krosswarning( TQString("PythonExtension::getattr(%1) __class__").tqarg(n) ); return Py::None(); }
#ifdef KROSS_PYTHON_EXTENSION_GETATTR_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::getattr name='%1' is a internal name.").arg(n) );
+ krossdebug( TQString("Kross::Python::PythonExtension::getattr name='%1' is a internal name.").tqarg(n) );
#endif
return Py::PythonExtension<PythonExtension>::getattr_methods(n);
}
@@ -130,7 +130,7 @@ Py::Object PythonExtension::getattr(const char* n)
Py::Object PythonExtension::getattr_methods(const char* n)
{
#ifdef KROSS_PYTHON_EXTENSION_GETATTRMETHOD_DEBUG
- krossdebug( QString("PythonExtension::getattr_methods name=%1").arg(n) );
+ krossdebug( TQString("PythonExtension::getattr_methods name=%1").tqarg(n) );
#endif
return Py::PythonExtension<PythonExtension>::getattr_methods(n);
}
@@ -138,7 +138,7 @@ Py::Object PythonExtension::getattr_methods(const char* n)
int PythonExtension::setattr(const char* name, const Py::Object& value)
{
#ifdef KROSS_PYTHON_EXTENSION_SETATTR_DEBUG
- krossdebug( QString("PythonExtension::setattr name=%1 value=%2").arg(name).arg(value.as_string().c_str()) );
+ krossdebug( TQString("PythonExtension::setattr name=%1 value=%2").tqarg(name).tqarg(value.as_string().c_str()) );
#endif
return Py::PythonExtension<PythonExtension>::setattr(name, value);
}
@@ -147,10 +147,10 @@ int PythonExtension::setattr(const char* name, const Py::Object& value)
Kross::Api::List::Ptr PythonExtension::toObject(const Py::Tuple& tuple)
{
#ifdef KROSS_PYTHON_EXTENSION_TOOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toObject(Py::Tuple)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toObject(Py::Tuple)") );
#endif
- QValueList<Kross::Api::Object::Ptr> l;
+ TQValueList<Kross::Api::Object::Ptr> l;
uint size = tuple.size();
for(uint i = 0; i < size; i++)
l.append( toObject( tuple[i] ) );
@@ -160,10 +160,10 @@ Kross::Api::List::Ptr PythonExtension::toObject(const Py::Tuple& tuple)
Kross::Api::List::Ptr PythonExtension::toObject(const Py::List& list)
{
#ifdef KROSS_PYTHON_EXTENSION_TOOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toObject(Py::List)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toObject(Py::List)") );
#endif
- QValueList<Kross::Api::Object::Ptr> l;
+ TQValueList<Kross::Api::Object::Ptr> l;
uint length = list.length();
for(uint i = 0; i < length; i++)
l.append( toObject( list[i] ) );
@@ -172,12 +172,12 @@ Kross::Api::List::Ptr PythonExtension::toObject(const Py::List& list)
Kross::Api::Dict::Ptr PythonExtension::toObject(const Py::Dict& dict)
{
- QMap<QString, Kross::Api::Object::Ptr> map;
+ TQMap<TQString, Kross::Api::Object::Ptr> map;
Py::List l = dict.keys();
uint length = l.length();
for(Py::List::size_type i = 0; i < length; ++i) {
const char* n = l[i].str().as_string().c_str();
- map.replace(n, toObject( dict[n] ));
+ map.tqreplace(n, toObject( dict[n] ));
}
return new Kross::Api::Dict(map);
}
@@ -185,20 +185,20 @@ Kross::Api::Dict::Ptr PythonExtension::toObject(const Py::Dict& dict)
Kross::Api::Object::Ptr PythonExtension::toObject(const Py::Object& object)
{
#ifdef KROSS_PYTHON_EXTENSION_TOOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toObject(Py::Object) object='%1'").arg(object.as_string().c_str()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::toObject(Py::Object) object='%1'").tqarg(object.as_string().c_str()) );
#endif
if(object == Py::None())
return 0;
PyTypeObject *type = (PyTypeObject*) object.type().ptr();
#ifdef KROSS_PYTHON_EXTENSION_TOOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toObject(Py::Object) type='%1'").arg(type->tp_name) );
+ krossdebug( TQString("Kross::Python::PythonExtension::toObject(Py::Object) type='%1'").tqarg(type->tp_name) );
#endif
if(type == &PyInt_Type)
return new Kross::Api::Variant(int(Py::Int(object)));
if(type == &PyBool_Type)
- return new Kross::Api::Variant(QVariant(object.isTrue(),0));
+ return new Kross::Api::Variant(TQVariant(object.isTrue(),0));
if(type == &PyLong_Type)
- return new Kross::Api::Variant(Q_LLONG(long(Py::Long(object))));
+ return new Kross::Api::Variant(TQ_LLONG(long(Py::Long(object))));
if(type == &PyFloat_Type)
return new Kross::Api::Variant(double(Py::Float(object)));
@@ -206,7 +206,7 @@ Kross::Api::Object::Ptr PythonExtension::toObject(const Py::Object& object)
#ifdef Py_USING_UNICODE
/* TODO
if(type == &PyUnicode_Type) {
- Py::unicodestring u = Py::String(object).as_unicodestring();
+ Py::tqunicodestring u = Py::String(object).as_tqunicodestring();
std::string s;
std::copy(u.begin(), u.end(), std::back_inserter(s));
return new Kross::Api::Variant(s.c_str());
@@ -243,95 +243,95 @@ Kross::Api::Object::Ptr PythonExtension::toObject(const Py::Object& object)
return extension->m_object;
}
-const Py::Object PythonExtension::toPyObject(const QString& s)
+const Py::Object PythonExtension::toPyObject(const TQString& s)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(QString)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(TQString)") );
#endif
return s.isNull() ? Py::String() : Py::String(s.latin1());
}
-const Py::List PythonExtension::toPyObject(const QStringList& list)
+const Py::List PythonExtension::toPyObject(const TQStringList& list)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(QStringList)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(TQStringList)") );
#endif
Py::List l;
- for(QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
+ for(TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
l.append(toPyObject(*it));
return l;
}
-const Py::Dict PythonExtension::toPyObject(const QMap<QString, QVariant>& map)
+const Py::Dict PythonExtension::toPyObject(const TQMap<TQString, TQVariant>& map)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(QMap<QString,QVariant>)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(TQMap<TQString,TQVariant>)") );
#endif
Py::Dict d;
- for(QMap<QString, QVariant>::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it)
+ for(TQMap<TQString, TQVariant>::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it)
d.setItem(it.key().latin1(), toPyObject(it.data()));
return d;
}
-const Py::List PythonExtension::toPyObject(const QValueList<QVariant>& list)
+const Py::List PythonExtension::toPyObject(const TQValueList<TQVariant>& list)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(QValueList<QVariant>)") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(TQValueList<TQVariant>)") );
#endif
Py::List l;
- for(QValueList<QVariant>::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
+ for(TQValueList<TQVariant>::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
l.append(toPyObject(*it));
return l;
}
-const Py::Object PythonExtension::toPyObject(const QVariant& variant)
+const Py::Object PythonExtension::toPyObject(const TQVariant& variant)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(QVariant) typename='%1'").arg(variant.typeName()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(TQVariant) typename='%1'").tqarg(variant.typeName()) );
#endif
switch(variant.type()) {
- case QVariant::Invalid:
+ case TQVariant::Invalid:
return Py::None();
- case QVariant::Bool:
+ case TQVariant::Bool:
return Py::Int(variant.toBool());
- case QVariant::Int:
+ case TQVariant::Int:
return Py::Int(variant.toInt());
- case QVariant::UInt:
+ case TQVariant::UInt:
return Py::Long((unsigned long)variant.toUInt());
- case QVariant::Double:
+ case TQVariant::Double:
return Py::Float(variant.toDouble());
- case QVariant::Date:
- case QVariant::Time:
- case QVariant::DateTime:
- case QVariant::ByteArray:
- case QVariant::BitArray:
- case QVariant::CString:
- case QVariant::String:
+ case TQVariant::Date:
+ case TQVariant::Time:
+ case TQVariant::DateTime:
+ case TQVariant::ByteArray:
+ case TQVariant::BitArray:
+ case TQVariant::CString:
+ case TQVariant::String:
return toPyObject(variant.toString());
- case QVariant::StringList:
+ case TQVariant::StringList:
return toPyObject(variant.toStringList());
- case QVariant::Map:
+ case TQVariant::Map:
return toPyObject(variant.toMap());
- case QVariant::List:
+ case TQVariant::List:
return toPyObject(variant.toList());
// To handle following both cases is a bit difficult
// cause Python doesn't spend an easy possibility
// for such large numbers (TODO maybe BigInt?). So,
// we risk overflows here, but well...
- case QVariant::LongLong: {
- Q_LLONG l = variant.toLongLong();
+ case TQVariant::LongLong: {
+ TQ_LLONG l = variant.toLongLong();
//return (l < 0) ? Py::Long((long)l) : Py::Long((unsigned long)l);
return Py::Long((long)l);
//return Py::Long(PyLong_FromLong( (long)l ), true);
} break;
- case QVariant::ULongLong: {
+ case TQVariant::ULongLong: {
return Py::Long((unsigned long)variant.toULongLong());
} break;
default: {
- krosswarning( QString("Kross::Python::PythonExtension::toPyObject(QVariant) Not possible to convert the QVariant type '%1' to a Py::Object.").arg(variant.typeName()) );
+ krosswarning( TQString("Kross::Python::PythonExtension::toPyObject(TQVariant) Not possible to convert the TQVariant type '%1' to a Py::Object.").tqarg(variant.typeName()) );
return Py::None();
}
}
@@ -346,11 +346,11 @@ const Py::Object PythonExtension::toPyObject(Kross::Api::Object::Ptr object)
return Py::None();
}
- const QString classname = object->getClassName();
+ const TQString classname = object->getClassName();
if(classname == "Kross::Api::Variant") {
- QVariant v = static_cast<Kross::Api::Variant*>( object.data() )->getValue();
+ TQVariant v = static_cast<Kross::Api::Variant*>( object.data() )->getValue();
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyObject(Kross::Api::Object) is Kross::Api::Variant %1").arg(v.toString()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyObject(Kross::Api::Object) is Kross::Api::Variant %1").tqarg(v.toString()) );
#endif
return toPyObject(v);
}
@@ -361,8 +361,8 @@ const Py::Object PythonExtension::toPyObject(Kross::Api::Object::Ptr object)
#endif
Py::List pylist;
Kross::Api::List* list = static_cast<Kross::Api::List*>( object.data() );
- QValueList<Kross::Api::Object::Ptr> valuelist = list->getValue();
- for(QValueList<Kross::Api::Object::Ptr>::Iterator it = valuelist.begin(); it != valuelist.end(); ++it)
+ TQValueList<Kross::Api::Object::Ptr> valuelist = list->getValue();
+ for(TQValueList<Kross::Api::Object::Ptr>::Iterator it = valuelist.begin(); it != valuelist.end(); ++it)
pylist.append( toPyObject(*it) ); // recursive
return pylist;
}
@@ -373,8 +373,8 @@ const Py::Object PythonExtension::toPyObject(Kross::Api::Object::Ptr object)
#endif
Py::Dict pydict;
Kross::Api::Dict* dict = static_cast<Kross::Api::Dict*>( object.data() );
- QMap<QString, Kross::Api::Object::Ptr> valuedict = dict->getValue();
- for(QMap<QString, Kross::Api::Object::Ptr>::Iterator it = valuedict.begin(); it != valuedict.end(); ++it) {
+ TQMap<TQString, Kross::Api::Object::Ptr> valuedict = dict->getValue();
+ for(TQMap<TQString, Kross::Api::Object::Ptr>::Iterator it = valuedict.begin(); it != valuedict.end(); ++it) {
const char* n = it.key().latin1();
pydict[ n ] = toPyObject( it.data() ); // recursive
}
@@ -382,7 +382,7 @@ const Py::Object PythonExtension::toPyObject(Kross::Api::Object::Ptr object)
}
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Trying to handle PythonExtension::toPyObject(%1) as PythonExtension").arg(object->getClassName()) );
+ krossdebug( TQString("Trying to handle PythonExtension::toPyObject(%1) as PythonExtension").tqarg(object->getClassName()) );
#endif
return Py::asObject( new PythonExtension(object) );
}
@@ -390,7 +390,7 @@ const Py::Object PythonExtension::toPyObject(Kross::Api::Object::Ptr object)
const Py::Tuple PythonExtension::toPyTuple(Kross::Api::List::Ptr list)
{
#ifdef KROSS_PYTHON_EXTENSION_TOPYOBJECT_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::toPyTuple(Kross::Api::List) name='%1'").arg(list ? list->getName() : "NULL") );
+ krossdebug( TQString("Kross::Python::PythonExtension::toPyTuple(Kross::Api::List) name='%1'").tqarg(list ? list->getName() : "NULL") );
#endif
uint count = list ? list->count() : 0;
Py::Tuple tuple(count);
@@ -403,39 +403,39 @@ PyObject* PythonExtension::proxyhandler(PyObject *_self_and_name_tuple, PyObject
{
Py::Tuple tuple(_self_and_name_tuple);
PythonExtension *self = static_cast<PythonExtension*>( tuple[0].ptr() );
- QString methodname = Py::String(tuple[1]).as_string().c_str();
+ TQString methodname = Py::String(tuple[1]).as_string().c_str();
try {
Kross::Api::List::Ptr arguments = toObject( Py::Tuple(args) );
#ifdef KROSS_PYTHON_EXTENSION_CALL_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::proxyhandler methodname='%1' arguments='%2'").arg(methodname).arg(arguments->toString()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::proxyhandler methodname='%1' arguments='%2'").tqarg(methodname).tqarg(arguments->toString()) );
#endif
Kross::Api::Callable* callable = dynamic_cast<Kross::Api::Callable*>(self->m_object.data());
if(callable && callable->hasChild(methodname)) {
#ifdef KROSS_PYTHON_EXTENSION_CALL_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::proxyhandler methodname='%1' is a child object of '%2'.").arg(methodname).arg(self->m_object->getName()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::proxyhandler methodname='%1' is a child object of '%2'.").tqarg(methodname).tqarg(self->m_object->getName()) );
#endif
- Py::Object result = toPyObject( callable->getChild(methodname)->call(QString::null, arguments) );
+ Py::Object result = toPyObject( callable->getChild(methodname)->call(TQString(), arguments) );
result.increment_reference_count();
return result.ptr();
}
#ifdef KROSS_PYTHON_EXTENSION_CALL_DEBUG
- krossdebug( QString("Kross::Python::PythonExtension::proxyhandler try to call function with methodname '%1' in object '%2'.").arg(methodname).arg(self->m_object->getName()) );
+ krossdebug( TQString("Kross::Python::PythonExtension::proxyhandler try to call function with methodname '%1' in object '%2'.").tqarg(methodname).tqarg(self->m_object->getName()) );
#endif
Py::Object result = toPyObject( self->m_object->call(methodname, arguments) );
result.increment_reference_count();
return result.ptr();
}
catch(Py::Exception& e) {
- const QString err = Py::value(e).as_string().c_str();
- krosswarning( QString("Py::Exception in Kross::Python::PythonExtension::proxyhandler %1").arg(err) );
+ const TQString err = Py::value(e).as_string().c_str();
+ krosswarning( TQString("Py::Exception in Kross::Python::PythonExtension::proxyhandler %1").tqarg(err) );
//throw e;
}
catch(Kross::Api::Exception::Ptr e) {
- const QString err = e->toString();
- krosswarning( QString("Kross::Api::Exception in Kross::Python::PythonExtension::proxyhandler %1").arg(err) );
+ const TQString err = e->toString();
+ krosswarning( TQString("Kross::Api::Exception in Kross::Python::PythonExtension::proxyhandler %1").tqarg(err) );
// Don't throw here cause it will end in a crash deep in python. The
// error is already handled anyway.
//throw Py::Exception( (char*) e->toString().latin1() );
diff --git a/lib/kross/python/pythonextension.h b/lib/kross/python/pythonextension.h
index 02e42587..b19a11a1 100644
--- a/lib/kross/python/pythonextension.h
+++ b/lib/kross/python/pythonextension.h
@@ -27,12 +27,12 @@
#include "../api/dict.h"
#include "../api/class.h"
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qvaluevector.h>
-#include <qmap.h>
-#include <qvariant.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
+#include <tqmap.h>
+#include <tqvariant.h>
namespace Kross { namespace Python {
@@ -135,46 +135,46 @@ namespace Kross { namespace Python {
static Kross::Api::Object::Ptr toObject(const Py::Object& object);
/**
- * Converts a QString to a Py::Object. If
- * the QString isNull() then Py::None() will
+ * Converts a TQString to a Py::Object. If
+ * the TQString isNull() then Py::None() will
* be returned.
*
- * \param s The QString to convert.
- * \return The to a Py::String converted QString.
+ * \param s The TQString to convert.
+ * \return The to a Py::String converted TQString.
*/
- static const Py::Object toPyObject(const QString& s);
+ static const Py::Object toPyObject(const TQString& s);
/**
- * Converts a QStringList to a Py::List.
+ * Converts a TQStringList to a Py::List.
*
- * \param list The QStringList to convert.
- * \return The to a Py::List converted QStringList.
+ * \param list The TQStringList to convert.
+ * \return The to a Py::List converted TQStringList.
*/
- static const Py::List toPyObject(const QStringList& list);
+ static const Py::List toPyObject(const TQStringList& list);
/**
- * Converts a QMap to a Py::Dict.
+ * Converts a TQMap to a Py::Dict.
*
- * \param map The QMap to convert.
- * \return The to a Py::Dict converted QMap.
+ * \param map The TQMap to convert.
+ * \return The to a Py::Dict converted TQMap.
*/
- static const Py::Dict toPyObject(const QMap<QString, QVariant>& map);
+ static const Py::Dict toPyObject(const TQMap<TQString, TQVariant>& map);
/**
- * Converts a QValueList to a Py::List.
+ * Converts a TQValueList to a Py::List.
*
- * \param list The QValueList to convert.
- * \return The to a Py::List converted QValueList.
+ * \param list The TQValueList to convert.
+ * \return The to a Py::List converted TQValueList.
*/
- static const Py::List toPyObject(const QValueList<QVariant>& list);
+ static const Py::List toPyObject(const TQValueList<TQVariant>& list);
/**
- * Converts a QVariant to a Py::Object.
+ * Converts a TQVariant to a Py::Object.
*
- * \param variant The QVariant to convert.
- * \return The to a Py::Object converted QVariant.
+ * \param variant The TQVariant to convert.
+ * \return The to a Py::Object converted TQVariant.
*/
- static const Py::Object toPyObject(const QVariant& variant);
+ static const Py::Object toPyObject(const TQVariant& variant);
/**
* Converts a \a Kross::Api::Object to a Py::Object.
diff --git a/lib/kross/python/pythoninterpreter.cpp b/lib/kross/python/pythoninterpreter.cpp
index 92f627dd..23f4b8fb 100644
--- a/lib/kross/python/pythoninterpreter.cpp
+++ b/lib/kross/python/pythoninterpreter.cpp
@@ -27,7 +27,7 @@
#include <kglobal.h>
#include <kstandarddirs.h>
-#if defined(Q_WS_WIN)
+#if defined(TQ_WS_WIN)
#define PYPATHDELIMITER ";"
#else
#define PYPATHDELIMITER ":"
@@ -93,10 +93,10 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
// In the python sys.path are all module-directories are
// listed in.
- QString path;
+ TQString path;
// First import the sys-module to remember it's sys.path
- // list in our path QString.
+ // list in our path TQString.
Py::Module sysmod( PyImport_ImportModule("sys"), true );
Py::Dict sysmoddict = sysmod.getDict();
Py::Object syspath = sysmoddict.getItem("path");
@@ -104,32 +104,32 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
Py::List syspathlist = syspath;
for(Py::List::iterator it = syspathlist.begin(); it != syspathlist.end(); ++it)
if( (*it).isString() )
- path.append( QString(Py::String(*it).as_string().c_str()) + PYPATHDELIMITER );
+ path.append( TQString(Py::String(*it).as_string().c_str()) + PYPATHDELIMITER );
}
else
path = Py_GetPath();
// Determinate additional module-paths we like to add.
// First add the global Kross modules-path.
- QStringList krossdirs = KGlobal::dirs()->findDirs("data", "kross/python");
- for(QStringList::Iterator krossit = krossdirs.begin(); krossit != krossdirs.end(); ++krossit)
+ TQStringList krossdirs = KGlobal::dirs()->findDirs("data", "kross/python");
+ for(TQStringList::Iterator krossit = krossdirs.begin(); krossit != krossdirs.end(); ++krossit)
path.append(*krossit + PYPATHDELIMITER);
// Then add the application modules-path.
- QStringList appdirs = KGlobal::dirs()->findDirs("appdata", "kross/python");
- for(QStringList::Iterator appit = appdirs.begin(); appit != appdirs.end(); ++appit)
+ TQStringList appdirs = KGlobal::dirs()->findDirs("appdata", "kross/python");
+ for(TQStringList::Iterator appit = appdirs.begin(); appit != appdirs.end(); ++appit)
path.append(*appit + PYPATHDELIMITER);
// Set the extended sys.path.
PySys_SetPath( (char*) path.latin1() );
- krossdebug(QString("Python ProgramName: %1").arg(Py_GetProgramName()));
- krossdebug(QString("Python ProgramFullPath: %1").arg(Py_GetProgramFullPath()));
- krossdebug(QString("Python Version: %1").arg(Py_GetVersion()));
- krossdebug(QString("Python Platform: %1").arg(Py_GetPlatform()));
- krossdebug(QString("Python Prefix: %1").arg(Py_GetPrefix()));
- krossdebug(QString("Python ExecPrefix: %1").arg(Py_GetExecPrefix()));
- krossdebug(QString("Python Path: %1").arg(Py_GetPath()));
- krossdebug(QString("Python System Path: %1").arg(path));
+ krossdebug(TQString("Python ProgramName: %1").tqarg(Py_GetProgramName()));
+ krossdebug(TQString("Python ProgramFullPath: %1").tqarg(Py_GetProgramFullPath()));
+ krossdebug(TQString("Python Version: %1").tqarg(Py_GetVersion()));
+ krossdebug(TQString("Python Platform: %1").tqarg(Py_GetPlatform()));
+ krossdebug(TQString("Python Prefix: %1").tqarg(Py_GetPrefix()));
+ krossdebug(TQString("Python ExecPrefix: %1").tqarg(Py_GetExecPrefix()));
+ krossdebug(TQString("Python Path: %1").tqarg(Py_GetPath()));
+ krossdebug(TQString("Python System Path: %1").tqarg(path));
// Initialize the main module.
d->mainmodule = new PythonModule(this);
@@ -139,7 +139,7 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
//TODO moduledict["KrossPythonVersion"] = Py::Int(KROSS_PYTHON_VERSION);
// Prepare the interpreter.
- QString s =
+ TQString s =
"import sys\n"
//"sys.setdefaultencoding('latin-1')\n"
@@ -179,7 +179,7 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
PyObject* pyrun = PyRun_String(s.latin1(), Py_file_input, moduledict.ptr(), moduledict.ptr());
if(! pyrun) {
Py::Object errobj = Py::value(Py::Exception()); // get last error
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to prepare the __main__ module: %1").arg(errobj.as_string().c_str())) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to prepare the __main__ module: %1").tqarg(errobj.as_string().c_str())) );
}
Py_XDECREF(pyrun); // free the reference.
diff --git a/lib/kross/python/pythoninterpreter.h b/lib/kross/python/pythoninterpreter.h
index 7c4088fa..df0dcad2 100644
--- a/lib/kross/python/pythoninterpreter.h
+++ b/lib/kross/python/pythoninterpreter.h
@@ -27,7 +27,7 @@
//#include "../api/script.h"
#include "../main/scriptcontainer.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Python {
diff --git a/lib/kross/python/pythonmodule.cpp b/lib/kross/python/pythonmodule.cpp
index b54eb73f..9c3353ea 100644
--- a/lib/kross/python/pythonmodule.cpp
+++ b/lib/kross/python/pythonmodule.cpp
@@ -20,7 +20,7 @@
#include "pythonmodule.h"
#include "pythoninterpreter.h"
-#include <qregexp.h>
+#include <tqregexp.h>
using namespace Kross::Python;
@@ -41,7 +41,7 @@ namespace Kross { namespace Python {
* List of \a PythonExtension instances accessible
* via this \a PythonModule instance.
*/
- QMap<QString, PythonExtension*> m_modules;
+ TQMap<TQString, PythonExtension*> m_modules;
};
@@ -52,7 +52,7 @@ PythonModule::PythonModule(PythonInterpreter* interpreter)
, d(new PythonModulePrivate())
{
#ifdef KROSS_PYTHON_MODULE_DEBUG
- krossdebug( QString("Kross::Python::PythonModule::Constructor") );
+ krossdebug( TQString("Kross::Python::PythonModule::Constructor") );
#endif
d->m_interpreter = interpreter;
@@ -65,7 +65,7 @@ PythonModule::PythonModule(PythonInterpreter* interpreter)
PythonModule::~PythonModule()
{
#ifdef KROSS_PYTHON_MODULE_DEBUG
- krossdebug( QString("Kross::Python::PythonModule::Destructor name='%1'").arg(name().c_str()) );
+ krossdebug( TQString("Kross::Python::PythonModule::Destructor name='%1'").tqarg(name().c_str()) );
#endif
delete d;
@@ -79,19 +79,19 @@ Py::Dict PythonModule::getDict()
Py::Object PythonModule::import(const Py::Tuple& args)
{
if(args.size() > 0) {
- QString modname = args[0].as_string().c_str();
+ TQString modname = args[0].as_string().c_str();
if(modname.startsWith("kross")) {
#ifdef KROSS_PYTHON_MODULE_DEBUG
- krossdebug( QString("Kross::Python::PythonModule::import() module=%1").arg(modname) );
+ krossdebug( TQString("Kross::Python::PythonModule::import() module=%1").tqarg(modname) );
#endif
- if( modname.find( QRegExp("[^a-zA-Z0-9\\_\\-]") ) >= 0 ) {
- krosswarning( QString("Denied import of Kross module '%1' cause of untrusted chars.").arg(modname) );
+ if( modname.tqfind( TQRegExp("[^a-zA-Z0-9\\_\\-]") ) >= 0 ) {
+ krosswarning( TQString("Denied import of Kross module '%1' cause of untrusted chars.").tqarg(modname) );
}
else {
Kross::Api::Module::Ptr module = Kross::Api::Manager::scriptManager()->loadModule(modname);
if(module)
return PythonExtension::toPyObject( Kross::Api::Object::Ptr(module) );
- krosswarning( QString("Loading of Kross module '%1' failed.").arg(modname) );
+ krosswarning( TQString("Loading of Kross module '%1' failed.").tqarg(modname) );
}
}
diff --git a/lib/kross/python/pythonmodule.h b/lib/kross/python/pythonmodule.h
index 1775ae68..c071fe81 100644
--- a/lib/kross/python/pythonmodule.h
+++ b/lib/kross/python/pythonmodule.h
@@ -25,7 +25,7 @@
#include "../api/script.h"
#include "pythonextension.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Python {
diff --git a/lib/kross/python/pythonobject.cpp b/lib/kross/python/pythonobject.cpp
index d59087b3..f765cbbd 100644
--- a/lib/kross/python/pythonobject.cpp
+++ b/lib/kross/python/pythonobject.cpp
@@ -26,7 +26,7 @@ PythonObject::PythonObject(const Py::Object& object)
: Kross::Api::Object()
, m_pyobject(object)
{
- krossdebug( QString("PythonObject::PythonObject() constructor") );
+ krossdebug( TQString("PythonObject::PythonObject() constructor") );
Py::List x( object.dir() );
for(Py::Sequence::iterator i= x.begin(); i != x.end(); ++i) {
@@ -37,7 +37,7 @@ PythonObject::PythonObject(const Py::Object& object)
//if(! m_pyobject.hasAttr( (*i).str() )) continue;
Py::Object o = m_pyobject.getAttr(s);
- QString t;
+ TQString t;
if(o.isCallable()) t += "isCallable ";
if(o.isDict()) t += "isDict ";
if(o.isList()) t += "isList ";
@@ -46,7 +46,7 @@ PythonObject::PythonObject(const Py::Object& object)
if(o.isSequence()) t += "isSequence ";
if(o.isTrue()) t += "isTrue ";
if(o.isInstance()) t += "isInstance ";
- krossdebug( QString("PythonObject::PythonObject() method '%1' (%2)").arg( (*i).str().as_string().c_str() ).arg(t) );
+ krossdebug( TQString("PythonObject::PythonObject() method '%1' (%2)").tqarg( (*i).str().as_string().c_str() ).tqarg(t) );
if(o.isCallable())
m_calls.append( (*i).str().as_string().c_str() );
@@ -57,26 +57,26 @@ PythonObject::~PythonObject()
{
}
-const QString PythonObject::getClassName() const
+const TQString PythonObject::getClassName() const
{
return "Kross::Python::PythonObject";
}
-Kross::Api::Object::Ptr PythonObject::call(const QString& name, Kross::Api::List::Ptr arguments)
+Kross::Api::Object::Ptr PythonObject::call(const TQString& name, Kross::Api::List::Ptr arguments)
{
- krossdebug( QString("PythonObject::call(%1)").arg(name) );
+ krossdebug( TQString("PythonObject::call(%1)").tqarg(name) );
if(m_pyobject.isInstance()) {
- //if(! m_calls.contains(n)) throw ...
+ //if(! m_calls.tqcontains(n)) throw ...
PyObject* r = PyObject_CallMethod(m_pyobject.ptr(), (char*) name.latin1(), 0);
if(! r) { //FIXME happens too if e.g. number of arguments doesn't match !!!
Py::Object errobj = Py::value(Py::Exception()); // get last error
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to call method '%1': %2").arg(name).arg(errobj.as_string().c_str())) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to call method '%1': %2").tqarg(name).tqarg(errobj.as_string().c_str())) );
}
Py::Object result(r, true);
- //krossdebug( QString("PythonObject::call(%1) call return value = '%2'").arg(name).arg(result.as_string().c_str()) );
+ //krossdebug( TQString("PythonObject::call(%1) call return value = '%2'").tqarg(name).tqarg(result.as_string().c_str()) );
return PythonExtension::toObject(result);
}
/*TODO??? ELSE create class instance for class-definitions???
@@ -87,7 +87,7 @@ Kross::Api::Object::Ptr PythonObject::call(const QString& name, Kross::Api::List
return Kross::Api::Object::call(name, arguments);
}
-QStringList PythonObject::getCalls()
+TQStringList PythonObject::getCalls()
{
return m_calls;
}
diff --git a/lib/kross/python/pythonobject.h b/lib/kross/python/pythonobject.h
index 6d33da26..a524efe0 100644
--- a/lib/kross/python/pythonobject.h
+++ b/lib/kross/python/pythonobject.h
@@ -25,8 +25,8 @@
#include "../api/list.h"
#include "pythonextension.h"
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
namespace Kross { namespace Python {
@@ -59,7 +59,7 @@ namespace Kross { namespace Python {
*
* \return The name of this class.
*/
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* Pass a call to the object. Objects like \a Class
@@ -76,18 +76,18 @@ namespace Kross { namespace Python {
* \return The call-result as Object* instance or
* NULL if the call has no result.
*/
- virtual Kross::Api::Object::Ptr call(const QString& name, Kross::Api::List::Ptr arguments);
+ virtual Kross::Api::Object::Ptr call(const TQString& name, Kross::Api::List::Ptr arguments);
/**
* Return a list of supported callable objects.
*
* \return List of supported calls.
*/
- virtual QStringList getCalls();
+ virtual TQStringList getCalls();
private:
const Py::Object m_pyobject;
- QStringList m_calls;
+ TQStringList m_calls;
};
}}
diff --git a/lib/kross/python/pythonscript.cpp b/lib/kross/python/pythonscript.cpp
index 082b5440..4bf37c74 100644
--- a/lib/kross/python/pythonscript.cpp
+++ b/lib/kross/python/pythonscript.cpp
@@ -51,12 +51,12 @@ namespace Kross { namespace Python {
/**
* A list of functionnames.
*/
- QStringList m_functions;
+ TQStringList m_functions;
/**
* A list of classnames.
*/
- QStringList m_classes;
+ TQStringList m_classes;
};
}}
@@ -88,18 +88,18 @@ void PythonScript::initialize()
try {
if(m_scriptcontainer->getCode().isNull())
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Invalid scripting code for script '%1'").arg( m_scriptcontainer->getName() )) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid scripting code for script '%1'").tqarg( m_scriptcontainer->getName() )) );
if(m_scriptcontainer->getName().isNull())
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Name for the script is invalid!")) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Name for the script is invalid!")) );
PyObject* pymod = PyModule_New( (char*) m_scriptcontainer->getName().latin1() );
d->m_module = new Py::Module(pymod, true);
if(! d->m_module)
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to initialize local module context for script '%1'").arg( m_scriptcontainer->getName() )) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize local module context for script '%1'").tqarg( m_scriptcontainer->getName() )) );
#ifdef KROSS_PYTHON_SCRIPT_INIT_DEBUG
- krossdebug( QString("PythonScript::initialize() module='%1' refcount='%2'").arg(d->m_module->as_string().c_str()).arg(d->m_module->reference_count()) );
+ krossdebug( TQString("PythonScript::initialize() module='%1' refcount='%2'").tqarg(d->m_module->as_string().c_str()).tqarg(d->m_module->reference_count()) );
#endif
// Set the "self" variable to point to the ScriptContainer
@@ -108,11 +108,11 @@ void PythonScript::initialize()
// python scripting code.
Py::Dict moduledict = d->m_module->getDict();
moduledict["self"] = PythonExtension::toPyObject( m_scriptcontainer );
- //moduledict["parent"] = PythonExtension::toPyObject( m_manager );
+ //moduledict["tqparent"] = PythonExtension::toPyObject( m_manager );
/*
// Prepare the local context.
- QString s =
+ TQString s =
//"import sys\n"
"if self.has(\"stdout\"):\n"
" self.stdout = Redirect( self.get(\"stdout\") )\n"
@@ -129,9 +129,9 @@ void PythonScript::initialize()
// Compile the python script code. It will be later on request
// executed. That way we cache the compiled code.
PyObject* code = 0;
- bool restricted = m_scriptcontainer->getOption("restricted", QVariant(false,0), true).toBool();
+ bool restricted = m_scriptcontainer->getOption("restricted", TQVariant(false,0), true).toBool();
- krossdebug( QString("PythonScript::initialize() name=%1 restricted=%2").arg(m_scriptcontainer->getName()).arg(restricted) );
+ krossdebug( TQString("PythonScript::initialize() name=%1 restricted=%2").tqarg(m_scriptcontainer->getName()).tqarg(restricted) );
if(restricted) {
// Use the RestrictedPython module wrapped by the PythonSecurity class.
@@ -159,8 +159,8 @@ void PythonScript::initialize()
d->m_code = new Py::Object(code, true);
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( QString("Failed to compile python code: %1").arg(err) );
+ TQString err = Py::value(e).as_string().c_str();
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to compile python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
throw exception;
}
@@ -170,7 +170,7 @@ void PythonScript::finalize()
{
#ifdef KROSS_PYTHON_SCRIPT_FINALIZE_DEBUG
if(d->m_module)
- krossdebug( QString("PythonScript::finalize() module='%1' refcount='%2'").arg(d->m_module->as_string().c_str()).arg(d->m_module->reference_count()) );
+ krossdebug( TQString("PythonScript::finalize() module='%1' refcount='%2'").tqarg(d->m_module->as_string().c_str()).tqarg(d->m_module->reference_count()) );
#endif
delete d->m_module; d->m_module = 0;
@@ -179,10 +179,10 @@ void PythonScript::finalize()
d->m_classes.clear();
}
-Kross::Api::Exception::Ptr PythonScript::toException(const QString& error)
+Kross::Api::Exception::Ptr PythonScript::toException(const TQString& error)
{
long lineno = -1;
- QStringList errorlist;
+ TQStringList errorlist;
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
@@ -203,9 +203,9 @@ Kross::Api::Exception::Ptr PythonScript::toException(const QString& error)
errorlist.append( Py::Object(tblist[i]).as_string().c_str() );
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
+ TQString err = Py::value(e).as_string().c_str();
e.clear(); // exception is handled. clear it now.
- krosswarning( QString("Kross::Python::PythonScript::toException() Failed to fetch a traceback: %1").arg(err) );
+ krosswarning( TQString("Kross::Python::PythonScript::toException() Failed to fetch a traceback: %1").tqarg(err) );
}
PyObject *next;
@@ -226,7 +226,7 @@ Kross::Api::Exception::Ptr PythonScript::toException(const QString& error)
//const char* filename = PyString_AsString(frame->f_code->co_filename);
//const char* name = PyString_AsString(frame->f_code->co_name);
- //errorlist.append( QString("%1#%2: \"%3\"").arg(filename).arg(lineno).arg(name) );
+ //errorlist.append( TQString("%1#%2: \"%3\"").tqarg(filename).tqarg(lineno).tqarg(name) );
next = PyObject_GetAttrString(traceback, "tb_next");
Py_DECREF(traceback);
@@ -254,13 +254,13 @@ Kross::Api::Exception::Ptr PythonScript::toException(const QString& error)
return exception;
}
-const QStringList& PythonScript::getFunctionNames()
+const TQStringList& PythonScript::getFunctionNames()
{
if(! d->m_module)
initialize(); //TODO catch exception
return d->m_functions;
/*
- QStringList list;
+ TQStringList list;
Py::List l = d->m_module->getDict().keys();
int length = l.length();
for(Py::List::size_type i = 0; i < length; ++i)
@@ -272,7 +272,7 @@ const QStringList& PythonScript::getFunctionNames()
Kross::Api::Object::Ptr PythonScript::execute()
{
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( QString("PythonScript::execute()") );
+ krossdebug( TQString("PythonScript::execute()") );
#endif
try {
@@ -285,7 +285,7 @@ Kross::Api::Object::Ptr PythonScript::execute()
Py::Dict moduledict( d->m_module->getDict().ptr() );
// Initialize context before execution.
- QString s =
+ TQString s =
"import sys\n"
//"if self.has(\"stdout\"):\n"
//" sys.stdout = Redirect( self.get(\"stdout\") )\n"
@@ -318,20 +318,20 @@ Kross::Api::Object::Ptr PythonScript::execute()
Py::Object result(pyresult, true);
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( QString("PythonScript::execute() result=%1").arg(result.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() result=%1").tqarg(result.as_string().c_str()) );
#endif
for(Py::Dict::iterator it = moduledict.begin(); it != moduledict.end(); ++it) {
Py::Dict::value_type vt(*it);
if(PyClass_Check( vt.second.ptr() )) {
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( QString("PythonScript::execute() class '%1' added.").arg(vt.first.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() class '%1' added.").tqarg(vt.first.as_string().c_str()) );
#endif
d->m_classes.append( vt.first.as_string().c_str() );
}
else if(vt.second.isCallable()) {
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( QString("PythonScript::execute() function '%1' added.").arg(vt.first.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() function '%1' added.").tqarg(vt.first.as_string().c_str()) );
#endif
d->m_functions.append( vt.first.as_string().c_str() );
}
@@ -345,15 +345,15 @@ Kross::Api::Object::Ptr PythonScript::execute()
Py::Object errobj = Py::value(e);
if(errobj.ptr() == Py_None) // at least string-exceptions have there errormessage in the type-object
errobj = Py::type(e);
- QString err = errobj.as_string().c_str();
+ TQString err = errobj.as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( QString("Failed to execute python code: %1").arg(err) );
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
setException( exception );
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( QString("Failed to execute python code: %1").arg(err) );
+ TQString err = Py::value(e).as_string().c_str();
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
setException( exception );
}
@@ -365,18 +365,18 @@ Kross::Api::Object::Ptr PythonScript::execute()
return 0; // return nothing if exception got thrown.
}
-Kross::Api::Object::Ptr PythonScript::callFunction(const QString& name, Kross::Api::List::Ptr args)
+Kross::Api::Object::Ptr PythonScript::callFunction(const TQString& name, Kross::Api::List::Ptr args)
{
#ifdef KROSS_PYTHON_SCRIPT_CALLFUNC_DEBUG
- krossdebug( QString("PythonScript::callFunction(%1, %2)")
- .arg(name)
- .arg(args ? QString::number(args->count()) : QString("NULL")) );
+ krossdebug( TQString("PythonScript::callFunction(%1, %2)")
+ .tqarg(name)
+ .tqarg(args ? TQString::number(args->count()) : TQString("NULL")) );
#endif
if(hadException()) return 0; // abort if we had an unresolved exception.
if(! d->m_module) {
- setException( new Kross::Api::Exception(QString("Script not initialized.")) );
+ setException( new Kross::Api::Exception(TQString("Script not initialized.")) );
return 0;
}
@@ -386,23 +386,23 @@ Kross::Api::Object::Ptr PythonScript::callFunction(const QString& name, Kross::A
// Try to determinate the function we like to execute.
PyObject* func = PyDict_GetItemString(moduledict.ptr(), name.latin1());
- if( (! d->m_functions.contains(name)) || (! func) )
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("No such function '%1'.").arg(name)) );
+ if( (! d->m_functions.tqcontains(name)) || (! func) )
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").tqarg(name)) );
Py::Callable funcobject(func, true); // the funcobject takes care of freeing our func pyobject.
// Check if the object is really a function and therefore callable.
if(! funcobject.isCallable())
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Function is not callable.")) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function is not callable.")) );
// Call the function.
Py::Object result = funcobject.apply(PythonExtension::toPyTuple(args));
return PythonExtension::toObject(result);
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
+ TQString err = Py::value(e).as_string().c_str();
e.clear(); // exception is handled. clear it now.
- setException( new Kross::Api::Exception(QString("Python Exception: %1").arg(err)) );
+ setException( new Kross::Api::Exception(TQString("Python Exception: %1").tqarg(err)) );
}
catch(Kross::Api::Exception::Ptr e) {
setException(e);
@@ -411,19 +411,19 @@ Kross::Api::Object::Ptr PythonScript::callFunction(const QString& name, Kross::A
return 0; // return nothing if exception got thrown.
}
-const QStringList& PythonScript::getClassNames()
+const TQStringList& PythonScript::getClassNames()
{
if(! d->m_module)
initialize(); //TODO catch exception
return d->m_classes;
}
-Kross::Api::Object::Ptr PythonScript::classInstance(const QString& name)
+Kross::Api::Object::Ptr PythonScript::classInstance(const TQString& name)
{
if(hadException()) return 0; // abort if we had an unresolved exception.
if(! d->m_module) {
- setException( new Kross::Api::Exception(QString("Script not initialized.")) );
+ setException( new Kross::Api::Exception(TQString("Script not initialized.")) );
return 0;
}
@@ -432,22 +432,22 @@ Kross::Api::Object::Ptr PythonScript::classInstance(const QString& name)
// Try to determinate the class.
PyObject* pyclass = PyDict_GetItemString(moduledict.ptr(), name.latin1());
- if( (! d->m_classes.contains(name)) || (! pyclass) )
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("No such class '%1'.").arg(name)) );
+ if( (! d->m_classes.tqcontains(name)) || (! pyclass) )
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such class '%1'.").tqarg(name)) );
PyObject *pyobj = PyInstance_New(pyclass, 0, 0);//aclarg, 0);
if(! pyobj)
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to create instance of class '%1'.").arg(name)) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to create instance of class '%1'.").tqarg(name)) );
Py::Object classobject(pyobj, true);
#ifdef KROSS_PYTHON_SCRIPT_CLASSINSTANCE_DEBUG
- krossdebug( QString("PythonScript::classInstance() inst='%1'").arg(classobject.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::classInstance() inst='%1'").tqarg(classobject.as_string().c_str()) );
#endif
return PythonExtension::toObject(classobject);
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
+ TQString err = Py::value(e).as_string().c_str();
e.clear(); // exception is handled. clear it now.
setException( Kross::Api::Exception::Ptr( new Kross::Api::Exception(err) ) );
}
diff --git a/lib/kross/python/pythonscript.h b/lib/kross/python/pythonscript.h
index 6cbef625..b68b9705 100644
--- a/lib/kross/python/pythonscript.h
+++ b/lib/kross/python/pythonscript.h
@@ -57,7 +57,7 @@ namespace Kross { namespace Python {
* Return a list of callable functionnames this
* script spends.
*/
- virtual const QStringList& getFunctionNames();
+ virtual const TQStringList& getFunctionNames();
/**
* Execute the script.
@@ -67,17 +67,17 @@ namespace Kross { namespace Python {
/**
* Call a function.
*/
- virtual Kross::Api::Object::Ptr callFunction(const QString& name, Kross::Api::List::Ptr args);
+ virtual Kross::Api::Object::Ptr callFunction(const TQString& name, Kross::Api::List::Ptr args);
/**
* Return a list of class types this script supports.
*/
- virtual const QStringList& getClassNames();
+ virtual const TQStringList& getClassNames();
/**
* Create and return a new class instance.
*/
- virtual Kross::Api::Object::Ptr classInstance(const QString& name);
+ virtual Kross::Api::Object::Ptr classInstance(const TQString& name);
private:
/// Private d-pointer class.
@@ -89,7 +89,7 @@ namespace Kross { namespace Python {
void finalize();
/// \return a \a Kross::Api::Exception instance.
- Kross::Api::Exception::Ptr toException(const QString& error);
+ Kross::Api::Exception::Ptr toException(const TQString& error);
};
}}
diff --git a/lib/kross/python/pythonsecurity.cpp b/lib/kross/python/pythonsecurity.cpp
index 86be0092..941ed0c6 100644
--- a/lib/kross/python/pythonsecurity.cpp
+++ b/lib/kross/python/pythonsecurity.cpp
@@ -88,9 +88,9 @@ void PythonSecurity::initRestrictedPython()
krossdebug("PythonSecurity::PythonSecurity SUCCESSFULLY LOADED");
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
+ TQString err = Py::value(e).as_string().c_str();
e.clear();
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to initialize PythonSecurity module: %1").arg(err) ) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize PythonSecurity module: %1").tqarg(err) ) );
}
}
@@ -104,7 +104,7 @@ Py::Object PythonSecurity::_getattr_(const Py::Tuple& args)
return Py::None();
}
-PyObject* PythonSecurity::compile_restricted(const QString& source, const QString& filename, const QString& mode)
+PyObject* PythonSecurity::compile_restricted(const TQString& source, const TQString& filename, const TQString& mode)
{
krossdebug("PythonSecurity::compile_restricted");
if(! m_pymodule)
@@ -115,12 +115,12 @@ PyObject* PythonSecurity::compile_restricted(const QString& source, const QStrin
PyObject* func = PyDict_GetItemString(m_pymodule->getDict().ptr(), "compile_restricted");
if(! func)
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("No such function '%1'.").arg("compile_restricted")) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").tqarg("compile_restricted")) );
Py::Callable funcobject(func, true); // the funcobject takes care of freeing our func pyobject.
if(! funcobject.isCallable())
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Function '%1' is not callable.").arg("compile_restricted")) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' is not callable.").tqarg("compile_restricted")) );
Py::Tuple args(3);
args[0] = Py::String(source.utf8());
@@ -140,40 +140,40 @@ PyObject* PythonSecurity::compile_restricted(const QString& source, const QStrin
/*
Py::List ml = mainmoduledict;
for(Py::List::size_type mi = 0; mi < ml.length(); ++mi) {
- krossdebug( QString("dir() = %1").arg( ml[mi].str().as_string().c_str() ) );
- //krossdebug( QString("dir().dir() = %1").arg( Py::Object(ml[mi]).dir().as_string().c_str() ) );
+ krossdebug( TQString("dir() = %1").tqarg( ml[mi].str().as_string().c_str() ) );
+ //krossdebug( TQString("dir().dir() = %1").tqarg( Py::Object(ml[mi]).dir().as_string().c_str() ) );
}
*/
Py::Object code(pycode);
- krossdebug( QString("%1 callable=%2").arg(code.as_string().c_str()).arg(PyCallable_Check(code.ptr())) );
+ krossdebug( TQString("%1 callable=%2").tqarg(code.as_string().c_str()).tqarg(PyCallable_Check(code.ptr())) );
Py::List l = code.dir();
for(Py::List::size_type i = 0; i < l.length(); ++i) {
- krossdebug( QString("dir() = %1").arg( l[i].str().as_string().c_str() ) );
- //krossdebug( QString("dir().dir() = %1").arg( Py::Object(l[i]).dir().as_string().c_str() ) );
+ krossdebug( TQString("dir() = %1").tqarg( l[i].str().as_string().c_str() ) );
+ //krossdebug( TQString("dir().dir() = %1").tqarg( Py::Object(l[i]).dir().as_string().c_str() ) );
}
return pycode;
}
catch(Py::Exception& e) {
- QString err = Py::value(e).as_string().c_str();
+ TQString err = Py::value(e).as_string().c_str();
e.clear();
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Function '%1' failed with python exception: %2").arg("compile_restricted").arg(err) ) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' failed with python exception: %2").tqarg("compile_restricted").tqarg(err) ) );
}
}
#if 0
-void PythonSecurity::compile_restricted_function(const Py::Tuple& /*args*/, const QString& /*body*/, const QString& /*name*/, const QString& /*filename*/, const Py::Object& /*globalize*/)
+void PythonSecurity::compile_restricted_function(const Py::Tuple& /*args*/, const TQString& /*body*/, const TQString& /*name*/, const TQString& /*filename*/, const Py::Object& /*globalize*/)
{
//TODO
}
-void PythonSecurity::compile_restricted_exec(const QString& /*source*/, const QString& /*filename*/)
+void PythonSecurity::compile_restricted_exec(const TQString& /*source*/, const TQString& /*filename*/)
{
//TODO
}
-void PythonSecurity::compile_restricted_eval(const QString& /*source*/, const QString& /*filename*/)
+void PythonSecurity::compile_restricted_eval(const TQString& /*source*/, const TQString& /*filename*/)
{
//TODO
}
diff --git a/lib/kross/python/pythonsecurity.h b/lib/kross/python/pythonsecurity.h
index 7ffbcfff..c36e7481 100644
--- a/lib/kross/python/pythonsecurity.h
+++ b/lib/kross/python/pythonsecurity.h
@@ -22,7 +22,7 @@
#include "pythonconfig.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Python {
@@ -82,13 +82,13 @@ namespace Kross { namespace Python {
* to take care to decrease the ref-counter it not needed
* any longer.
*/
- PyObject* compile_restricted(const QString& source, const QString& filename, const QString& mode);
+ PyObject* compile_restricted(const TQString& source, const TQString& filename, const TQString& mode);
#if 0
//TODO
- void compile_restricted_function(const Py::Tuple& args, const QString& body, const QString& name, const QString& filename, const Py::Object& globalize = Py::None());
- void compile_restricted_exec(const QString& source, const QString& filename = "<string>");
- void compile_restricted_eval(const QString& source, const QString& filename = "<string>");
+ void compile_restricted_function(const Py::Tuple& args, const TQString& body, const TQString& name, const TQString& filename, const Py::Object& globalize = Py::None());
+ void compile_restricted_exec(const TQString& source, const TQString& filename = "<string>");
+ void compile_restricted_eval(const TQString& source, const TQString& filename = "<string>");
#endif
private:
diff --git a/lib/kross/python/scripts/RestrictedPython/Guards.py b/lib/kross/python/scripts/RestrictedPython/Guards.py
index 4fbdcad1..295ba791 100644
--- a/lib/kross/python/scripts/RestrictedPython/Guards.py
+++ b/lib/kross/python/scripts/RestrictedPython/Guards.py
@@ -24,7 +24,7 @@ for name in ['False', 'None', 'True', 'abs', 'basestring', 'bool', 'callable',
'chr', 'cmp', 'complex', 'divmod', 'float', 'hash',
'hex', 'id', 'int', 'isinstance', 'issubclass', 'len',
'long', 'oct', 'ord', 'pow', 'range', 'repr', 'round',
- 'str', 'tuple', 'unichr', 'unicode', 'xrange', 'zip']:
+ 'str', 'tuple', 'unichr', 'tqunicode', 'xrange', 'zip']:
safe_builtins[name] = __builtins__[name]
diff --git a/lib/kross/python/scripts/gui.py b/lib/kross/python/scripts/gui.py
index 8891714a..b8edbe9c 100755
--- a/lib/kross/python/scripts/gui.py
+++ b/lib/kross/python/scripts/gui.py
@@ -43,43 +43,43 @@ class TkDialog:
self.widget = mainframe.widget
class Widget:
- def __init__(self, dialog, parent):
+ def __init__(self, dialog, tqparent):
self.dialog = dialog
- self.parent = parent
+ self.tqparent = tqparent
#def setVisible(self, visibled): pass
#def setEnabled(self, enabled): pass
class Frame(Widget):
- def __init__(self, dialog, parent):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
- self.widget = Tkinter.Frame(parent)
+ self.widget = Tkinter.Frame(tqparent)
self.widget.pack()
class Label(Widget):
- def __init__(self, dialog, parent, caption):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent, caption):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
- self.widget = Tkinter.Label(parent, text=caption)
+ self.widget = Tkinter.Label(tqparent, text=caption)
self.widget.pack(side=Tkinter.TOP)
class CheckBox(Widget):
- def __init__(self, dialog, parent, caption, checked = True):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent, caption, checked = True):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
self.checkstate = Tkinter.IntVar()
self.checkstate.set(checked)
- self.widget = Tkinter.Checkbutton(parent, text=caption, variable=self.checkstate)
+ self.widget = Tkinter.Checkbutton(tqparent, text=caption, variable=self.checkstate)
self.widget.pack(side=Tkinter.TOP)
def isChecked(self):
return self.checkstate.get()
class List(Widget):
- def __init__(self, dialog, parent, caption, items):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent, caption, items):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
- listframe = Tkinter.Frame(parent)
+ listframe = Tkinter.Frame(tqparent)
listframe.pack()
Tkinter.Label(listframe, text=caption).pack(side=Tkinter.LEFT)
@@ -94,10 +94,10 @@ class TkDialog:
self.variable.set( self.items[index] )
class Button(Widget):
- def __init__(self, dialog, parent, caption, commandmethod):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent, caption, commandmethod):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
- self.widget = Tkinter.Button(parent, text=caption, command=self.doCommand)
+ self.widget = Tkinter.Button(tqparent, text=caption, command=self.doCommand)
self.commandmethod = commandmethod
self.widget.pack(side=Tkinter.LEFT)
def doCommand(self):
@@ -114,10 +114,10 @@ class TkDialog:
#self.dialog.root.destroy()
class Edit(Widget):
- def __init__(self, dialog, parent, caption, text):
- #TkDialog.Widget.__init__(self, dialog, parent)
+ def __init__(self, dialog, tqparent, caption, text):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
import Tkinter
- self.widget = Tkinter.Frame(parent)
+ self.widget = Tkinter.Frame(tqparent)
self.widget.pack()
label = Tkinter.Label(self.widget, text=caption)
label.pack(side=Tkinter.LEFT)
@@ -129,8 +129,8 @@ class TkDialog:
return self.entrytext.get()
class FileChooser(Edit):
- def __init__(self, dialog, parent, caption, initialfile = None, filetypes = None):
- TkDialog.Edit.__init__(self, dialog, parent, caption, initialfile)
+ def __init__(self, dialog, tqparent, caption, initialfile = None, filetypes = None):
+ TkDialog.Edit.__init__(self, dialog, tqparent, caption, initialfile)
import Tkinter
self.initialfile = initialfile
@@ -187,27 +187,27 @@ class QtDialog:
import qt
class Dialog(qt.QDialog):
- def __init__(self, parent = None, name = None, modal = 0, fl = 0):
- qt.QDialog.__init__(self, parent, name, modal, fl)
+ def __init__(self, tqparent = None, name = None, modal = 0, fl = 0):
+ qt.QDialog.__init__(self, tqparent, name, modal, fl)
qt.QDialog.accept = self.accept
- self.layout = qt.QVBoxLayout(self)
- self.layout.setSpacing(6)
- self.layout.setMargin(11)
+ self.tqlayout = qt.QVBoxLayout(self)
+ self.tqlayout.setSpacing(6)
+ self.tqlayout.setMargin(11)
class Label(qt.QLabel):
- def __init__(self, dialog, parent, caption):
- qt.QLabel.__init__(self, parent)
- self.setText("<qt>%s</qt>" % caption.replace("\n","<br>"))
+ def __init__(self, dialog, tqparent, caption):
+ qt.QLabel.__init__(self, tqparent)
+ self.setText("<qt>%s</qt>" % caption.tqreplace("\n","<br>"))
class Frame(qt.QHBox):
- def __init__(self, dialog, parent):
- qt.QHBox.__init__(self, parent)
+ def __init__(self, dialog, tqparent):
+ qt.QHBox.__init__(self, tqparent)
self.widget = self
self.setSpacing(6)
class Edit(qt.QHBox):
- def __init__(self, dialog, parent, caption, text):
- qt.QHBox.__init__(self, parent)
+ def __init__(self, dialog, tqparent, caption, text):
+ qt.QHBox.__init__(self, tqparent)
self.setSpacing(6)
label = qt.QLabel(caption, self)
self.edit = qt.QLineEdit(self)
@@ -219,26 +219,26 @@ class QtDialog:
class Button(qt.QPushButton):
#def __init__(self, *args):
- def __init__(self, dialog, parent, caption, commandmethod):
+ def __init__(self, dialog, tqparent, caption, commandmethod):
#apply(qt.QPushButton.__init__, (self,) + args)
- qt.QPushButton.__init__(self, parent)
+ qt.QPushButton.__init__(self, tqparent)
self.commandmethod = commandmethod
self.setText(caption)
qt.QObject.connect(self, qt.SIGNAL("clicked()"), self.commandmethod)
class CheckBox(qt.QCheckBox):
- def __init__(self, dialog, parent, caption, checked = True):
- #TkDialog.Widget.__init__(self, dialog, parent)
- qt.QCheckBox.__init__(self, parent)
+ def __init__(self, dialog, tqparent, caption, checked = True):
+ #TkDialog.Widget.__init__(self, dialog, tqparent)
+ qt.QCheckBox.__init__(self, tqparent)
self.setText(caption)
self.setChecked(checked)
#def isChecked(self):
# return self.isChecked()
class List(qt.QHBox):
- def __init__(self, dialog, parent, caption, items):
- qt.QHBox.__init__(self, parent)
+ def __init__(self, dialog, tqparent, caption, items):
+ qt.QHBox.__init__(self, tqparent)
self.setSpacing(6)
label = qt.QLabel(caption, self)
self.combo = qt.QComboBox(self)
@@ -252,9 +252,9 @@ class QtDialog:
self.combo.setCurrentItem(index)
class FileChooser(qt.QHBox):
- def __init__(self, dialog, parent, caption, initialfile = None, filetypes = None):
+ def __init__(self, dialog, tqparent, caption, initialfile = None, filetypes = None):
#apply(qt.QHBox.__init__, (self,) + args)
- qt.QHBox.__init__(self, parent)
+ qt.QHBox.__init__(self, tqparent)
self.setMinimumWidth(400)
self.initialfile = initialfile
@@ -274,29 +274,29 @@ class QtDialog:
return self.edit.text()
def browseButtonClicked(self):
- filtermask = ""
+ filtertqmask = ""
import types
if isinstance(self.filetypes, types.TupleType):
for ft in self.filetypes:
if len(ft) == 1:
- filtermask += "%s\n" % (ft[0])
+ filtertqmask += "%s\n" % (ft[0])
if len(ft) == 2:
- filtermask += "%s|%s (%s)\n" % (ft[1],ft[0],ft[1])
- if filtermask == "":
- filtermask = "All files (*.*)"
+ filtertqmask += "%s|%s (%s)\n" % (ft[1],ft[0],ft[1])
+ if filtertqmask == "":
+ filtertqmask = "All files (*.*)"
else:
- filtermask = filtermask[:-1]
+ filtertqmask = filtertqmask[:-1]
filename = None
try:
print "QtDialog.FileChooser.browseButtonClicked() kfile.KFileDialog"
# try to use the kfile module included in pykde
import kfile
- filename = kfile.KFileDialog.getOpenFileName(self.initialfile, filtermask, self, "Save to file")
+ filename = kfile.KFileDialog.getOpenFileName(self.initialfile, filtertqmask, self, "Save to file")
except:
print "QtDialog.FileChooser.browseButtonClicked() qt.QFileDialog"
# fallback to Qt filedialog
- filename = qt.QFileDialog.getOpenFileName(self.initialfile, filtermask, self, "Save to file")
+ filename = qt.QFileDialog.getOpenFileName(self.initialfile, filtertqmask, self, "Save to file")
if filename != None and filename != "":
self.edit.setText(filename)
@@ -317,13 +317,13 @@ class QtDialog:
return True
return False
- self.app = qt.qApp
+ self.app = qt.tqApp
self.dialog = Dialog(self.app.mainWidget(), "Dialog", 1, qt.Qt.WDestructiveClose)
self.dialog.setCaption(title)
self.widget = qt.QVBox(self.dialog)
self.widget.setSpacing(6)
- self.dialog.layout.addWidget(self.widget)
+ self.dialog.tqlayout.addWidget(self.widget)
self.Frame = Frame
self.Label = Label
@@ -371,26 +371,26 @@ class Dialog:
def close(self):
self.dialog.close()
- def addFrame(self, parentwidget):
- return self.dialog.Frame(self.dialog, parentwidget.widget)
+ def addFrame(self, tqparentwidget):
+ return self.dialog.Frame(self.dialog, tqparentwidget.widget)
- def addLabel(self, parentwidget, caption):
- return self.dialog.Label(self.dialog, parentwidget.widget, caption)
+ def addLabel(self, tqparentwidget, caption):
+ return self.dialog.Label(self.dialog, tqparentwidget.widget, caption)
- def addCheckBox(self, parentwidget, caption, checked = True):
- return self.dialog.CheckBox(self.dialog, parentwidget.widget, caption, checked)
+ def addCheckBox(self, tqparentwidget, caption, checked = True):
+ return self.dialog.CheckBox(self.dialog, tqparentwidget.widget, caption, checked)
- def addButton(self, parentwidget, caption, commandmethod):
- return self.dialog.Button(self.dialog, parentwidget.widget, caption, commandmethod)
+ def addButton(self, tqparentwidget, caption, commandmethod):
+ return self.dialog.Button(self.dialog, tqparentwidget.widget, caption, commandmethod)
- def addEdit(self, parentwidget, caption, text):
- return self.dialog.Edit(self.dialog, parentwidget.widget, caption, text)
+ def addEdit(self, tqparentwidget, caption, text):
+ return self.dialog.Edit(self.dialog, tqparentwidget.widget, caption, text)
- def addFileChooser(self, parentwidget, caption, initialfile = None, filetypes = None):
- return self.dialog.FileChooser(self.dialog, parentwidget.widget, caption, initialfile, filetypes)
+ def addFileChooser(self, tqparentwidget, caption, initialfile = None, filetypes = None):
+ return self.dialog.FileChooser(self.dialog, tqparentwidget.widget, caption, initialfile, filetypes)
- def addList(self, parentwidget, caption, items):
- return self.dialog.List(self.dialog, parentwidget.widget, caption, items)
+ def addList(self, tqparentwidget, caption, items):
+ return self.dialog.List(self.dialog, tqparentwidget.widget, caption, items)
def showMessageBox(self, typename, caption, message):
return self.dialog.MessageBox(self.dialog, typename, caption, message)
diff --git a/lib/kross/ruby/rubyextension.cpp b/lib/kross/ruby/rubyextension.cpp
index 2c022cee..c989976d 100644
--- a/lib/kross/ruby/rubyextension.cpp
+++ b/lib/kross/ruby/rubyextension.cpp
@@ -20,8 +20,8 @@
#include <st.h>
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
#include "api/list.h"
@@ -63,10 +63,10 @@ VALUE RubyExtension::method_missing(int argc, VALUE *argv, VALUE self)
VALUE RubyExtension::call_method( Kross::Api::Object::Ptr object, int argc, VALUE *argv)
{
- QString funcname = rb_id2name(SYM2ID(argv[0]));
- QValueList<Api::Object::Ptr> argsList;
+ TQString funcname = rb_id2name(SYM2ID(argv[0]));
+ TQValueList<Api::Object::Ptr> argsList;
#ifdef KROSS_RUBY_EXTENSION_DEBUG
- krossdebug(QString("Building arguments list for function: %1 there are %2 arguments.").arg(funcname).arg(argc-1));
+ krossdebug(TQString("Building arguments list for function: %1 there are %2 arguments.").tqarg(funcname).tqarg(argc-1));
#endif
for(int i = 1; i < argc; i++)
{
@@ -79,13 +79,13 @@ VALUE RubyExtension::call_method( Kross::Api::Object::Ptr object, int argc, VALU
Kross::Api::Callable* callable = dynamic_cast<Kross::Api::Callable*>(object.data());
if(callable && callable->hasChild(funcname)) {
#ifdef KROSS_RUBY_EXTENSION_DEBUG
- krossdebug( QString("Kross::Ruby::RubyExtension::method_missing name='%1' is a child object of '%2'.").arg(funcname).arg(object->getName()) );
+ krossdebug( TQString("Kross::Ruby::RubyExtension::method_missing name='%1' is a child object of '%2'.").tqarg(funcname).tqarg(object->getName()) );
#endif
- result = callable->getChild(funcname)->call(QString::null, new Api::List(argsList));
+ result = callable->getChild(funcname)->call(TQString(), new Api::List(argsList));
}
else {
#ifdef KROSS_RUBY_EXTENSION_DEBUG
- krossdebug( QString("Kross::Ruby::RubyExtension::method_missing try to call function with name '%1' in object '%2'.").arg(funcname).arg(object->getName()) );
+ krossdebug( TQString("Kross::Ruby::RubyExtension::method_missing try to call function with name '%1' in object '%2'.").tqarg(funcname).tqarg(object->getName()) );
#endif
result = object->call(funcname, new Api::List(argsList));
}
@@ -132,16 +132,16 @@ RubyExtension::~RubyExtension()
delete d;
}
-typedef QMap<QString, Kross::Api::Object::Ptr> mStrObj;
+typedef TQMap<TQString, Kross::Api::Object::Ptr> mStrObj;
int RubyExtension::convertHash_i(VALUE key, VALUE value, VALUE vmap)
{
- QMap<QString, Kross::Api::Object::Ptr>* map;
+ TQMap<TQString, Kross::Api::Object::Ptr>* map;
Data_Get_Struct(vmap, mStrObj, map);
if (key != Qundef)
{
Kross::Api::Object::Ptr o = RubyExtension::toObject( value );
- if(o) map->replace(STR2CSTR(key), o);
+ if(o) map->tqreplace(STR2CSTR(key), o);
}
return ST_CONTINUE;
}
@@ -184,7 +184,7 @@ VALUE RubyExtension::convertFromException(Kross::Api::Exception::Ptr exc)
Kross::Api::Object::Ptr RubyExtension::toObject(VALUE value)
{
#ifdef KROSS_RUBY_EXTENSION_DEBUG
- krossdebug(QString("RubyExtension::toObject of type %1").arg(TYPE(value)));
+ krossdebug(TQString("RubyExtension::toObject of type %1").tqarg(TYPE(value)));
#endif
switch( TYPE( value ) )
{
@@ -207,10 +207,10 @@ Kross::Api::Object::Ptr RubyExtension::toObject(VALUE value)
case T_FLOAT:
return new Kross::Api::Variant(NUM2DBL(value));
case T_STRING:
- return new Kross::Api::Variant(QString(STR2CSTR(value)));
+ return new Kross::Api::Variant(TQString(STR2CSTR(value)));
case T_ARRAY:
{
- QValueList<Kross::Api::Object::Ptr> l;
+ TQValueList<Kross::Api::Object::Ptr> l;
for(int i = 0; i < RARRAY(value)->len; i++)
{
Kross::Api::Object::Ptr o = toObject( rb_ary_entry( value , i ) );
@@ -219,17 +219,17 @@ Kross::Api::Object::Ptr RubyExtension::toObject(VALUE value)
return new Kross::Api::List(l);
}
case T_FIXNUM:
- return new Kross::Api::Variant((Q_LLONG)FIX2INT(value));
+ return new Kross::Api::Variant((TQ_LLONG)FIX2INT(value));
case T_HASH:
{
- QMap<QString, Kross::Api::Object::Ptr> map;
+ TQMap<TQString, Kross::Api::Object::Ptr> map;
VALUE vmap = Data_Wrap_Struct(rb_cObject, 0,0, &map);
rb_hash_foreach(value, (int (*)(...))convertHash_i, vmap);
return new Kross::Api::Dict(map);
}
case T_BIGNUM:
{
- return new Kross::Api::Variant((Q_LLONG)NUM2LONG(value));
+ return new Kross::Api::Variant((TQ_LLONG)NUM2LONG(value));
}
case T_TRUE:
{
@@ -241,7 +241,7 @@ Kross::Api::Object::Ptr RubyExtension::toObject(VALUE value)
}
case T_SYMBOL:
{
- return new Kross::Api::Variant(QString(rb_id2name(SYM2ID(value))));
+ return new Kross::Api::Variant(TQString(rb_id2name(SYM2ID(value))));
}
case T_MATCH:
case T_OBJECT:
@@ -251,85 +251,85 @@ Kross::Api::Object::Ptr RubyExtension::toObject(VALUE value)
case T_MODULE:
case T_ICLASS:
case T_CLASS:
- krosswarning(QString("This ruby type '%1' cannot be converted to a Kross::Api::Object").arg(TYPE(value)));
+ krosswarning(TQString("This ruby type '%1' cannot be converted to a Kross::Api::Object").tqarg(TYPE(value)));
default:
case T_NIL:
return 0;
}
}
-VALUE RubyExtension::toVALUE(const QString& s)
+VALUE RubyExtension::toVALUE(const TQString& s)
{
return s.isNull() ? rb_str_new2("") : rb_str_new2(s.latin1());
}
-VALUE RubyExtension::toVALUE(QStringList list)
+VALUE RubyExtension::toVALUE(TQStringList list)
{
VALUE l = rb_ary_new();
- for(QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
+ for(TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
rb_ary_push(l, toVALUE(*it));
return l;
}
-VALUE RubyExtension::toVALUE(QMap<QString, QVariant> map)
+VALUE RubyExtension::toVALUE(TQMap<TQString, TQVariant> map)
{
VALUE h = rb_hash_new();
- for(QMap<QString, QVariant>::Iterator it = map.begin(); it != map.end(); ++it)
+ for(TQMap<TQString, TQVariant>::Iterator it = map.begin(); it != map.end(); ++it)
rb_hash_aset(h, toVALUE(it.key()), toVALUE(it.data()) );
return h;
}
-VALUE RubyExtension::toVALUE(QValueList<QVariant> list)
+VALUE RubyExtension::toVALUE(TQValueList<TQVariant> list)
{
VALUE l = rb_ary_new();
- for(QValueList<QVariant>::Iterator it = list.begin(); it != list.end(); ++it)
+ for(TQValueList<TQVariant>::Iterator it = list.begin(); it != list.end(); ++it)
rb_ary_push(l, toVALUE(*it));
return l;
}
-VALUE RubyExtension::toVALUE(const QVariant& variant)
+VALUE RubyExtension::toVALUE(const TQVariant& variant)
{
switch(variant.type()) {
- case QVariant::Invalid:
+ case TQVariant::Invalid:
return Qnil;
- case QVariant::Bool:
+ case TQVariant::Bool:
return (variant.toBool()) ? Qtrue : Qfalse;
- case QVariant::Int:
+ case TQVariant::Int:
return INT2FIX(variant.toInt());
- case QVariant::UInt:
+ case TQVariant::UInt:
return UINT2NUM(variant.toUInt());
- case QVariant::Double:
+ case TQVariant::Double:
return rb_float_new(variant.toDouble());
- case QVariant::Date:
- case QVariant::Time:
- case QVariant::DateTime:
- case QVariant::ByteArray:
- case QVariant::BitArray:
- case QVariant::CString:
- case QVariant::String:
+ case TQVariant::Date:
+ case TQVariant::Time:
+ case TQVariant::DateTime:
+ case TQVariant::ByteArray:
+ case TQVariant::BitArray:
+ case TQVariant::CString:
+ case TQVariant::String:
return toVALUE(variant.toString());
- case QVariant::StringList:
+ case TQVariant::StringList:
return toVALUE(variant.toStringList());
- case QVariant::Map:
+ case TQVariant::Map:
return toVALUE(variant.toMap());
- case QVariant::List:
+ case TQVariant::List:
return toVALUE(variant.toList());
// To handle following both cases is a bit difficult
// cause Python doesn't spend an easy possibility
// for such large numbers (TODO maybe BigInt?). So,
// we risk overflows here, but well...
- case QVariant::LongLong: {
+ case TQVariant::LongLong: {
return INT2NUM((long)variant.toLongLong());
}
- case QVariant::ULongLong:
+ case TQVariant::ULongLong:
return UINT2NUM((unsigned long)variant.toULongLong());
default: {
- krosswarning( QString("Kross::Ruby::RubyExtension::toVALUE(QVariant) Not possible to convert the QVariant type '%1' to a VALUE.").arg(variant.typeName()) );
+ krosswarning( TQString("Kross::Ruby::RubyExtension::toVALUE(TQVariant) Not possible to convert the TQVariant type '%1' to a VALUE.").tqarg(variant.typeName()) );
return Qundef;
}
}
@@ -341,7 +341,7 @@ VALUE RubyExtension::toVALUE(Kross::Api::Object::Ptr object)
return 0;
}
if(object->getClassName() == "Kross::Api::Variant") {
- QVariant v = static_cast<Kross::Api::Variant*>( object.data() )->getValue();
+ TQVariant v = static_cast<Kross::Api::Variant*>( object.data() )->getValue();
return toVALUE(v);
}
diff --git a/lib/kross/ruby/rubyextension.h b/lib/kross/ruby/rubyextension.h
index 74041048..f6287961 100644
--- a/lib/kross/ruby/rubyextension.h
+++ b/lib/kross/ruby/rubyextension.h
@@ -102,40 +102,40 @@ class RubyExtension{
*/
static Kross::Api::Object::Ptr toObject(VALUE value);
/**
- * Converts a QString to a VALUE. If
- * the QString isNull() then a "" will
+ * Converts a TQString to a VALUE. If
+ * the TQString isNull() then a "" will
* be returned.
- * \param s The QString to convert.
- * \return The converted QString.
+ * \param s The TQString to convert.
+ * \return The converted TQString.
*/
- static VALUE toVALUE(const QString& s);
+ static VALUE toVALUE(const TQString& s);
/**
- * Converts a QStringList to a VALUE.
- * \param list The QStringList to convert.
- * \return The converted QStringList.
+ * Converts a TQStringList to a VALUE.
+ * \param list The TQStringList to convert.
+ * \return The converted TQStringList.
*/
- static VALUE toVALUE(QStringList list);
+ static VALUE toVALUE(TQStringList list);
/**
- * Converts a QMap to a VALUE.
- * \param map The QMap to convert.
- * \return The converted QMap.
+ * Converts a TQMap to a VALUE.
+ * \param map The TQMap to convert.
+ * \return The converted TQMap.
*/
- static VALUE toVALUE(QMap<QString, QVariant> map);
+ static VALUE toVALUE(TQMap<TQString, TQVariant> map);
/**
- * Converts a QValueList to a VALUE.
- * \param list The QValueList to convert.
- * \return The converted QValueList.
+ * Converts a TQValueList to a VALUE.
+ * \param list The TQValueList to convert.
+ * \return The converted TQValueList.
*/
- static VALUE toVALUE(QValueList<QVariant> list);
+ static VALUE toVALUE(TQValueList<TQVariant> list);
/**
- * Converts a QVariant to a VALUE.
- * \param variant The QVariant to convert.
- * \return The converted QVariant.
+ * Converts a TQVariant to a VALUE.
+ * \param variant The TQVariant to convert.
+ * \return The converted TQVariant.
*/
- static VALUE toVALUE(const QVariant& variant);
+ static VALUE toVALUE(const TQVariant& variant);
/**
* Converts a \a Kross::Api::Object to a VALUE.
diff --git a/lib/kross/ruby/rubyinterpreter.cpp b/lib/kross/ruby/rubyinterpreter.cpp
index 805ae722..d1fbec01 100644
--- a/lib/kross/ruby/rubyinterpreter.cpp
+++ b/lib/kross/ruby/rubyinterpreter.cpp
@@ -20,7 +20,7 @@
#include <map>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <ksharedptr.h>
#include <api/exception.h>
@@ -61,7 +61,7 @@ extern "C"
namespace Kross {
namespace Ruby {
-typedef std::map<QString, VALUE> mStrVALUE;
+typedef std::map<TQString, VALUE> mStrVALUE;
typedef mStrVALUE::iterator mStrVALUE_it;
typedef mStrVALUE::const_iterator mStrVALUE_cit;
class RubyInterpreterPrivate {
@@ -119,11 +119,11 @@ VALUE RubyInterpreter::require (VALUE obj, VALUE name)
#ifdef KROSS_RUBY_INTERPRETER_DEBUG
krossdebug("RubyInterpreter::require(obj,name)");
#endif
- QString modname = StringValuePtr(name);
+ TQString modname = StringValuePtr(name);
if(modname.startsWith("kross")) {
- krossdebug( QString("RubyInterpreter::require() module=%1").arg(modname) );
- if( modname.find( QRegExp("[^a-zA-Z0-9\\_\\-]") ) >= 0 ) {
- krosswarning( QString("Denied import of Kross module '%1' cause of untrusted chars.").arg(modname) );
+ krossdebug( TQString("RubyInterpreter::require() module=%1").tqarg(modname) );
+ if( modname.tqfind( TQRegExp("[^a-zA-Z0-9\\_\\-]") ) >= 0 ) {
+ krosswarning( TQString("Denied import of Kross module '%1' cause of untrusted chars.").tqarg(modname) );
}
else {
Kross::Api::Module::Ptr module = Kross::Api::Manager::scriptManager()->loadModule(modname);
@@ -136,7 +136,7 @@ VALUE RubyInterpreter::require (VALUE obj, VALUE name)
// rb_define_variable( ("$" + modname).ascii(), & RubyInterpreter::d->m_modules.insert( mStrVALUE::value_type( modname, rm) ).first->second );
return Qtrue;
}
- krosswarning( QString("Loading of Kross module '%1' failed.").arg(modname) );
+ krosswarning( TQString("Loading of Kross module '%1' failed.").tqarg(modname) );
}
} else {
return rb_f_require(obj, name);
diff --git a/lib/kross/ruby/rubymodule.cpp b/lib/kross/ruby/rubymodule.cpp
index b002f24c..73012b89 100644
--- a/lib/kross/ruby/rubymodule.cpp
+++ b/lib/kross/ruby/rubymodule.cpp
@@ -33,11 +33,11 @@ class RubyModulePrivate {
};
-RubyModule::RubyModule(Kross::Api::Module::Ptr mod, QString modname) : d(new RubyModulePrivate)
+RubyModule::RubyModule(Kross::Api::Module::Ptr mod, TQString modname) : d(new RubyModulePrivate)
{
d->m_module = mod;
modname = modname.left(1).upper() + modname.right(modname.length() - 1 );
- krossdebug(QString("Module: %1").arg(modname));
+ krossdebug(TQString("Module: %1").tqarg(modname));
VALUE rmodule = rb_define_module(modname.ascii());
rb_define_module_function(rmodule,"method_missing", (VALUE (*)(...))RubyModule::method_missing, -1);
VALUE rm = RubyExtension::toVALUE( mod.data() );
@@ -51,8 +51,8 @@ RubyModule::~RubyModule()
VALUE RubyModule::method_missing(int argc, VALUE *argv, VALUE self)
{
#ifdef KROSS_RUBY_MODULE_DEBUG
- QString funcname = rb_id2name(SYM2ID(argv[0]));
- krossdebug(QString("Function %1 missing in a module").arg(funcname));
+ TQString funcname = rb_id2name(SYM2ID(argv[0]));
+ krossdebug(TQString("Function %1 missing in a module").tqarg(funcname));
#endif
VALUE rubyObjectModule = rb_funcall( self, rb_intern("const_get"), 1, ID2SYM(rb_intern("MODULEOBJ")) );
diff --git a/lib/kross/ruby/rubymodule.h b/lib/kross/ruby/rubymodule.h
index 0e4c278c..cf608722 100644
--- a/lib/kross/ruby/rubymodule.h
+++ b/lib/kross/ruby/rubymodule.h
@@ -22,7 +22,7 @@
#include <ruby.h>
-#include <qstring.h>
+#include <tqstring.h>
#include <api/object.h>
#include <api/module.h>
@@ -47,7 +47,7 @@ class RubyModule {
* wraps.
* @param modname The name the module will be published as.
*/
- RubyModule(Kross::Api::Module::Ptr mod, QString modname);
+ RubyModule(Kross::Api::Module::Ptr mod, TQString modname);
/**
* Destructor.
diff --git a/lib/kross/ruby/rubyscript.cpp b/lib/kross/ruby/rubyscript.cpp
index fa0ee1d0..dc0fbb16 100644
--- a/lib/kross/ruby/rubyscript.cpp
+++ b/lib/kross/ruby/rubyscript.cpp
@@ -41,10 +41,10 @@ class RubyScriptPrivate {
RubyScriptPrivate() : m_compile(0) { }
RNode* m_compile;
/// A list of functionnames.
- QStringList m_functions;
+ TQStringList m_functions;
/// A list of classnames.
- QStringList m_classes;
+ TQStringList m_classes;
};
RubyScript::RubyScript(Kross::Api::Interpreter* interpreter, Kross::Api::ScriptContainer* scriptcontainer)
@@ -87,7 +87,7 @@ void RubyScript::compile()
#ifdef KROSS_RUBY_SCRIPT_DEBUG
krossdebug("Compilation has failed");
#endif
- setException( new Kross::Api::Exception(QString("Failed to compile ruby code: %1").arg(STR2CSTR( rb_obj_as_string(ruby_errinfo) )), 0) ); // TODO: get the error
+ setException( new Kross::Api::Exception(TQString("Failed to compile ruby code: %1").tqarg(STR2CSTR( rb_obj_as_string(ruby_errinfo) )), 0) ); // TODO: get the error
d->m_compile = 0;
}
#ifdef KROSS_RUBY_SCRIPT_DEBUG
@@ -95,7 +95,7 @@ void RubyScript::compile()
#endif
}
-const QStringList& RubyScript::getFunctionNames()
+const TQStringList& RubyScript::getFunctionNames()
{
#ifdef KROSS_RUBY_SCRIPT_DEBUG
krossdebug("RubyScript::getFunctionNames()");
@@ -133,7 +133,7 @@ Kross::Api::Object::Ptr RubyScript::execute()
#endif
setException( RubyExtension::convertToException( ruby_errinfo ) );
} else {
- setException( new Kross::Api::Exception(QString("Failed to execute ruby code: %1").arg(STR2CSTR( rb_obj_as_string(ruby_errinfo) )), 0) ); // TODO: get the error
+ setException( new Kross::Api::Exception(TQString("Failed to execute ruby code: %1").tqarg(STR2CSTR( rb_obj_as_string(ruby_errinfo) )), 0) ); // TODO: get the error
}
}
@@ -144,7 +144,7 @@ Kross::Api::Object::Ptr RubyScript::execute()
return 0;
}
-Kross::Api::Object::Ptr RubyScript::callFunction(const QString& name, Kross::Api::List::Ptr args)
+Kross::Api::Object::Ptr RubyScript::callFunction(const TQString& name, Kross::Api::List::Ptr args)
{
Q_UNUSED(name)
Q_UNUSED(args)
@@ -160,7 +160,7 @@ Kross::Api::Object::Ptr RubyScript::callFunction(const QString& name, Kross::Api
return 0;
}
-const QStringList& RubyScript::getClassNames()
+const TQStringList& RubyScript::getClassNames()
{
#ifdef KROSS_RUBY_SCRIPT_DEBUG
krossdebug("RubyScript::getClassNames()");
@@ -172,7 +172,7 @@ const QStringList& RubyScript::getClassNames()
return d->m_classes;
}
-Kross::Api::Object::Ptr RubyScript::classInstance(const QString& name)
+Kross::Api::Object::Ptr RubyScript::classInstance(const TQString& name)
{
Q_UNUSED(name)
#ifdef KROSS_RUBY_SCRIPT_DEBUG
diff --git a/lib/kross/ruby/rubyscript.h b/lib/kross/ruby/rubyscript.h
index cc6eda43..6511e95a 100644
--- a/lib/kross/ruby/rubyscript.h
+++ b/lib/kross/ruby/rubyscript.h
@@ -57,7 +57,7 @@ class RubyScript : public Kross::Api::Script
* Return a list of callable functionnames this
* script spends.
*/
- virtual const QStringList& getFunctionNames();
+ virtual const TQStringList& getFunctionNames();
/**
* Execute the script.
@@ -67,17 +67,17 @@ class RubyScript : public Kross::Api::Script
/**
* Call a function.
*/
- virtual Kross::Api::Object::Ptr callFunction(const QString& name, Kross::Api::List::Ptr args);
+ virtual Kross::Api::Object::Ptr callFunction(const TQString& name, Kross::Api::List::Ptr args);
/**
* Return a list of class types this script supports.
*/
- virtual const QStringList& getClassNames();
+ virtual const TQStringList& getClassNames();
/**
* Create and return a new class instance.
*/
- virtual Kross::Api::Object::Ptr classInstance(const QString& name);
+ virtual Kross::Api::Object::Ptr classInstance(const TQString& name);
private:
diff --git a/lib/kross/runner/main.cpp b/lib/kross/runner/main.cpp
index 89a35278..570e2610 100644
--- a/lib/kross/runner/main.cpp
+++ b/lib/kross/runner/main.cpp
@@ -21,9 +21,9 @@
#include <string>
#include <iostream>
-// Qt
-#include <qstring.h>
-#include <qfile.h>
+// TQt
+#include <tqstring.h>
+#include <tqfile.h>
// KDE
#include <kinstance.h>
@@ -47,10 +47,10 @@
KApplication* app = 0;
-int runScriptFile(const QString& scriptfile)
+int runScriptFile(const TQString& scriptfile)
{
// Read the scriptfile
- QFile f(QFile::encodeName(scriptfile));
+ TQFile f(TQFile::encodeName(scriptfile));
if(! f.exists()) {
std::cerr << "No such scriptfile: " << scriptfile.latin1() << std::endl;
return ERROR_NOSUCHFILE;
@@ -59,7 +59,7 @@ int runScriptFile(const QString& scriptfile)
std::cerr << "Failed to open scriptfile: " << scriptfile.latin1() << std::endl;
return ERROR_OPENFAILED;
}
- QString scriptcode = f.readAll();
+ TQString scriptcode = f.readAll();
f.close();
// Determinate the matching interpreter
@@ -80,15 +80,15 @@ int runScriptFile(const QString& scriptfile)
scriptcontainer->execute();
if(scriptcontainer->hadException()) {
// We had an exception.
- QString errormessage = scriptcontainer->getException()->getError();
- QString tracedetails = scriptcontainer->getException()->getTrace();
- std::cerr << QString("%2\n%1").arg(tracedetails).arg(errormessage).latin1() << std::endl;
+ TQString errormessage = scriptcontainer->getException()->getError();
+ TQString tracedetails = scriptcontainer->getException()->getTrace();
+ std::cerr << TQString("%2\n%1").tqarg(tracedetails).tqarg(errormessage).latin1() << std::endl;
return ERROR_EXCEPTION;
}
}
catch(Kross::Api::Exception::Ptr e) {
// Normaly that shouldn't be the case...
- std::cerr << QString("EXCEPTION %1").arg(e->toString()).latin1() << std::endl;
+ std::cerr << TQString("EXCEPTION %1").tqarg(e->toString()).latin1() << std::endl;
return ERROR_UNHALDEDEXCEPTION;
}
return ERROR_OK;
@@ -128,12 +128,12 @@ int main(int argc, char **argv)
// Create KApplication instance.
app = new KApplication( /* allowStyles */ true, /* GUIenabled */ true );
- //QString interpretername = args->getOption("interpreter");
- //QString scriptfilename = args->getOption("scriptfile");
+ //TQString interpretername = args->getOption("interpreter");
+ //TQString scriptfilename = args->getOption("scriptfile");
// Each argument is a scriptfile to open
for(int i = 0; i < args->count(); i++) {
- result = runScriptFile(QFile::decodeName(args->arg(i)));
+ result = runScriptFile(TQFile::decodeName(args->arg(i)));
if(result != ERROR_OK)
break;
}
diff --git a/lib/kross/test/main.cpp b/lib/kross/test/main.cpp
index 31b4f579..42198201 100644
--- a/lib/kross/test/main.cpp
+++ b/lib/kross/test/main.cpp
@@ -34,9 +34,9 @@
#include "testwindow.h"
#include "testplugin.h"
-// Qt
-#include <qstring.h>
-#include <qfile.h>
+// TQt
+#include <tqstring.h>
+#include <tqfile.h>
// KDE
#include <kinstance.h>
@@ -64,7 +64,7 @@ static KCmdLineOptions options[] =
{ 0, 0, 0 }
};
-void runInterpreter(const QString& interpretername, const QString& scriptcode)
+void runInterpreter(const TQString& interpretername, const TQString& scriptcode)
{
try {
@@ -91,10 +91,10 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
//TESTCASE
TestObject* testobject = new TestObject(app, scriptcontainer);
- manager->addQObject( testobject );
+ manager->addTQObject( testobject );
/*TestAction* testaction =*/ new TestAction(scriptcontainer);
- //manager->addQObject( testaction );
+ //manager->addTQObject( testaction );
/*Kross::Api::Object* o =*/ scriptcontainer->execute();
@@ -105,23 +105,23 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
/*
Kross::Api::Object* testclassinstance = scriptcontainer->classInstance("testClass");
if(testclassinstance) {
- QValueList<Kross::Api::Object*> ll;
+ TQValueList<Kross::Api::Object*> ll;
Kross::Api::Object* instancecallresult = testclassinstance->call("testClassFunction1", Kross::Api::List::create(ll));
- //krossdebug( QString("testClass.testClassFunction1 returnvalue => '%1'").arg( instancecallresult.toString() ) );
+ //krossdebug( TQString("testClass.testClassFunction1 returnvalue => '%1'").tqarg( instancecallresult.toString() ) );
}
*/
/*
- // Connect QObject signal with scriptfunction.
- scriptcontainer->connect(testobject, SIGNAL(testSignal()), "testobjectCallback");
- scriptcontainer->connect(testobject, SIGNAL(testSignalString(const QString&)), "testobjectCallbackWithParams");
+ // Connect TQObject signal with scriptfunction.
+ scriptcontainer->connect(testobject, TQT_SIGNAL(testSignal()), "testobjectCallback");
+ scriptcontainer->connect(testobject, TQT_SIGNAL(testSignalString(const TQString&)), "testobjectCallbackWithParams");
// Call the testSlot to emit the testSignal.
testobject->testSlot();
*/
}
catch(Kross::Api::Exception::Ptr e) {
- std::cout << QString("EXCEPTION %1").arg(e->toString()).latin1() << std::endl;
+ std::cout << TQString("EXCEPTION %1").tqarg(e->toString()).latin1() << std::endl;
}
/*TESTCASE
@@ -132,7 +132,7 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
sc2->execute();
}
catch(Kross::Api::Exception& e) {
- krossdebug( QString("EXCEPTION type='%1' description='%2'").arg(e.type()).arg(e.description()) );
+ krossdebug( TQString("EXCEPTION type='%1' description='%2'").tqarg(e.type()).tqarg(e.description()) );
}
//delete sc2;
*/
@@ -159,12 +159,12 @@ int main(int argc, char **argv)
KCmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
- QString interpretername = args->getOption("interpreter");
- QString scriptfilename = args->getOption("scriptfile");
+ TQString interpretername = args->getOption("interpreter");
+ TQString scriptfilename = args->getOption("scriptfile");
- QFile f(QFile::encodeName(scriptfilename));
+ TQFile f(TQFile::encodeName(scriptfilename));
if(f.exists() && f.open(IO_ReadOnly)) {
- QString scriptcode = f.readAll();
+ TQString scriptcode = f.readAll();
f.close();
if( args->isSet("gui") ) {
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
}
}
else {
- Kross::krosswarning( QString("Failed to load scriptfile: %1").arg(scriptfilename) );
+ Kross::krosswarning( TQString("Failed to load scriptfile: %1").tqarg(scriptfilename) );
result = -1;
}
diff --git a/lib/kross/test/testaction.cpp b/lib/kross/test/testaction.cpp
index 93c32090..481de0cf 100644
--- a/lib/kross/test/testaction.cpp
+++ b/lib/kross/test/testaction.cpp
@@ -20,15 +20,15 @@
#include "testaction.h"
TestAction::TestAction(Kross::Api::ScriptContainer::Ptr scriptcontainer)
- : QWidget()
+ : TQWidget()
{
m_actioncollection = new KActionCollection(this, this);
- m_action1 = new KAction("Action1_Text", 0, this, SLOT(activatedAction1()), m_actioncollection, "Action1");
+ m_action1 = new KAction("Action1_Text", 0, this, TQT_SLOT(activatedAction1()), m_actioncollection, "Action1");
m_actionlist.append(m_action1);
scriptcontainer->addKAction(m_action1);
- m_action2 = new KAction("Action2_Text", 0, this, SLOT(activatedAction2()), m_actioncollection, "Action2");
+ m_action2 = new KAction("Action2_Text", 0, this, TQT_SLOT(activatedAction2()), m_actioncollection, "Action2");
m_actionlist.append(m_action2);
scriptcontainer->addKAction(m_action2);
}
diff --git a/lib/kross/test/testaction.h b/lib/kross/test/testaction.h
index 03ea95fe..748cd6db 100644
--- a/lib/kross/test/testaction.h
+++ b/lib/kross/test/testaction.h
@@ -22,16 +22,17 @@
#include "../main/scriptcontainer.h"
-#include <qobject.h>
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqwidget.h>
+#include <tqstring.h>
#include <kaction.h>
#include <kactioncollection.h>
-class TestAction : public QWidget
+class TestAction : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
TestAction(Kross::Api::ScriptContainer::Ptr scriptcontainer);
~TestAction();
diff --git a/lib/kross/test/testcase.py b/lib/kross/test/testcase.py
index d3f2ea7b..9fa58bc2 100644
--- a/lib/kross/test/testcase.py
+++ b/lib/kross/test/testcase.py
@@ -79,8 +79,8 @@ class TestPlugin(unittest.TestCase):
self.assert_( self.pluginobject1.stringfunc(" Another \n\r Test! $%&\"") == " Another \n\r Test! $%&\"" )
#TODO
- #self.assert_( self.pluginobject1.stringfunc( unicode(" Unicode test ") ) == " Unicode test " )
- #self.assert_( self.pluginobject1.stringfunc(unicode(" Another Test! ")) == unicode(" Another Test! ") )
+ #self.assert_( self.pluginobject1.stringfunc( tqunicode(" Unicode test ") ) == " Unicode test " )
+ #self.assert_( self.pluginobject1.stringfunc(tqunicode(" Another Test! ")) == tqunicode(" Another Test! ") )
self.assert_( self.pluginobject1.stringstringfunc("MyString1", "MyString2") == "MyString1" )
self.assert_( self.pluginobject1.uintdoublestringfunc(8529,285.246,"String") == 8529 )
@@ -110,8 +110,8 @@ class TestPlugin(unittest.TestCase):
#print "===========> %s" % self.pluginobject2.myName()
print "testqobject1 properties=%s" % self.testqobject1.propertyNames()
- print "testqobject1 slots=%s" % self.testqobject1.slotNames()
- print "testqobject1 signals=%s" % self.testqobject1.signalNames()
+ print "testqobject1 Q_SLOTS=%s" % self.testqobject1.slotNames()
+ print "testqobject1 Q_SIGNALS=%s" % self.testqobject1.signalNames()
print "-----------------3"
print "DIR=>%s" % dir(self.testqobject1)
diff --git a/lib/kross/test/testgui.py b/lib/kross/test/testgui.py
index f252184d..a7353873 100644
--- a/lib/kross/test/testgui.py
+++ b/lib/kross/test/testgui.py
@@ -44,8 +44,8 @@ class QtTest:
apply(qt.QPushButton.__init__, (self,) + args)
class ComboBox(qt.QHBox):
- def __init__(self, parent, caption, items = []):
- qt.QHBox.__init__(self, parent)
+ def __init__(self, tqparent, caption, items = []):
+ qt.QHBox.__init__(self, tqparent)
self.setSpacing(6)
label = qt.QLabel(str(caption), self)
self.combobox = qt.QComboBox(self)
@@ -85,31 +85,31 @@ class QtTest:
self.edit.setText(filename)
class Dialog(qt.QDialog):
- def __init__(self, parent = None, name = None, modal = 0, fl = 0):
- qt.QDialog.__init__(self, parent, name, modal, fl)
+ def __init__(self, tqparent = None, name = None, modal = 0, fl = 0):
+ qt.QDialog.__init__(self, tqparent, name, modal, fl)
qt.QDialog.accept = self.accept
self.setCaption("Export to HTML")
- #self.layout()
+ #self.tqlayout()
- self.layout = qt.QVBoxLayout(self)
- self.layout.setSpacing(6)
- self.layout.setMargin(11)
+ self.tqlayout = qt.QVBoxLayout(self)
+ self.tqlayout.setSpacing(6)
+ self.tqlayout.setMargin(11)
infolabel = qt.QLabel("Export the data of a table or a query to a HTML-file.", self)
- self.layout.addWidget(infolabel)
+ self.tqlayout.addWidget(infolabel)
source = ComboBox(self, "Datasource:")
- self.layout.addWidget(source)
+ self.tqlayout.addWidget(source)
self.exporttype = ComboBox(self, "Style:", ["Plain","Paper","Desert","Blues"])
- self.layout.addWidget(self.exporttype)
+ self.tqlayout.addWidget(self.exporttype)
self.filechooser = FileChooser(self)
- self.layout.addWidget(self.filechooser)
+ self.tqlayout.addWidget(self.filechooser)
buttonbox = qt.QHBox(self)
buttonbox.setSpacing(6)
- self.layout.addWidget(buttonbox)
+ self.tqlayout.addWidget(buttonbox)
savebutton = Button("Save", buttonbox)
qt.QObject.connect(savebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("accept()"))
@@ -139,7 +139,7 @@ class QtTest:
#support.swapThreadState() # calls appropriate c-function
return qt.QDialog.event(self, e)
- app = qt.qApp
+ app = qt.tqApp
dialog = Dialog(app.mainWidget(), "Dialog", 1)
dialog.show()
diff --git a/lib/kross/test/testobject.cpp b/lib/kross/test/testobject.cpp
index 893cccca..1c7e8e39 100644
--- a/lib/kross/test/testobject.cpp
+++ b/lib/kross/test/testobject.cpp
@@ -22,24 +22,24 @@
#include <iostream> // for std::out
TestObject::TestObject()
- : QObject(0, "TestObject")
+ : TQObject(0, "TestObject")
{
}
-TestObject::TestObject(QObject* parent, Kross::Api::ScriptContainer::Ptr scriptcontainer)
- : QObject(parent, "TestObject")
+TestObject::TestObject(TQObject* tqparent, Kross::Api::ScriptContainer::Ptr scriptcontainer)
+ : TQObject(tqparent, "TestObject")
{
- connect(this, SIGNAL(testSignal()), this, SLOT(testSignalSlot()));
- connect(this, SIGNAL(stdoutSignal(const QString&)), this, SLOT(stdoutSlot(const QString&)));
- connect(this, SIGNAL(stderrSignal(const QString&)), this, SLOT(stderrSlot(const QString&)));
+ connect(this, TQT_SIGNAL(testSignal()), this, TQT_SLOT(testSignalSlot()));
+ connect(this, TQT_SIGNAL(stdoutSignal(const TQString&)), this, TQT_SLOT(stdoutSlot(const TQString&)));
+ connect(this, TQT_SIGNAL(stderrSignal(const TQString&)), this, TQT_SLOT(stderrSlot(const TQString&)));
- scriptcontainer->addQObject(this);
+ scriptcontainer->addTQObject(this);
-//scriptcontainer->addSignal("stdout", this, SIGNAL(stdoutSignal(const QString&)));
-//scriptcontainer->addSlot("stderr", this, SLOT(stderrSlot(const QString&)));
+//scriptcontainer->addSignal("stdout", this, TQT_SIGNAL(stdoutSignal(const TQString&)));
+//scriptcontainer->addSlot("stderr", this, TQT_SLOT(stderrSlot(const TQString&)));
- //scriptcontainer->addSignal("myTestSignal", this, SIGNAL(testSignal()));
- //scriptcontainer->addSlot("myTestSlot", this, SLOT(testSlot()));
+ //scriptcontainer->addSignal("myTestSignal", this, TQT_SIGNAL(testSignal()));
+ //scriptcontainer->addSlot("myTestSlot", this, TQT_SLOT(testSlot()));
}
TestObject::~TestObject()
@@ -48,24 +48,24 @@ TestObject::~TestObject()
uint TestObject::func1(uint i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func1 i=%1").arg(i) );
+ Kross::krossdebug(TQString("CALLED => TestObject::func1 i=%1").tqarg(i) );
return i;
}
-void TestObject::func2(QString s, int i)
+void TestObject::func2(TQString s, int i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func2 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func2 s=%1 i=%2").tqarg(s).tqarg(i));
}
-QString TestObject::func3(QString s, int i)
+TQString TestObject::func3(TQString s, int i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func3 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func3 s=%1 i=%2").tqarg(s).tqarg(i));
return s;
}
-const QString& TestObject::func4(const QString& s, int i) const
+const TQString& TestObject::func4(const TQString& s, int i) const
{
- Kross::krossdebug(QString("CALLED => TestObject::func4 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func4 s=%1 i=%2").tqarg(s).tqarg(i));
return s;
}
@@ -73,7 +73,7 @@ void TestObject::testSlot()
{
Kross::krossdebug("TestObject::testSlot called");
emit testSignal();
- emit testSignalString("This is the emitted TestObject::testSignalString(const QString&)");
+ emit testSignalString("This is the emitted TestObject::testSignalString(const TQString&)");
}
void TestObject::testSlot2()
@@ -81,15 +81,15 @@ void TestObject::testSlot2()
Kross::krossdebug("TestObject::testSlot2 called");
}
-void TestObject::stdoutSlot(const QString& s)
+void TestObject::stdoutSlot(const TQString& s)
{
- Kross::krossdebug(QString("stdout: %1").arg(s));
+ Kross::krossdebug(TQString("stdout: %1").tqarg(s));
//std::cout << "<stdout> " << s.latin1() << std::endl;
}
-void TestObject::stderrSlot(const QString& s)
+void TestObject::stderrSlot(const TQString& s)
{
- Kross::krossdebug(QString("stderr: %1").arg(s));
+ Kross::krossdebug(TQString("stderr: %1").tqarg(s));
//std::cout << "<stderr> " << s.latin1() << std::endl;
}
diff --git a/lib/kross/test/testobject.h b/lib/kross/test/testobject.h
index 011b7e54..5a04d9dc 100644
--- a/lib/kross/test/testobject.h
+++ b/lib/kross/test/testobject.h
@@ -22,43 +22,44 @@
#include "../main/scriptcontainer.h"
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
-class TestObject : public QObject
+class TestObject : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
- Q_PROPERTY(QString testProperty READ testProperty WRITE setTestProperty)
+ TQ_PROPERTY(TQString testProperty READ testProperty WRITE setTestProperty)
public:
TestObject();
- TestObject(QObject* parent, Kross::Api::ScriptContainer::Ptr scriptcontainer);
+ TestObject(TQObject* tqparent, Kross::Api::ScriptContainer::Ptr scriptcontainer);
~TestObject();
uint func1(uint);
- void func2(QString, int);
- QString func3(QString, int);
- const QString& func4(const QString&, int) const;
+ void func2(TQString, int);
+ TQString func3(TQString, int);
+ const TQString& func4(const TQString&, int) const;
- QString testProperty() const { return m_prop; }
- void setTestProperty(QString prop) { m_prop = prop; }
+ TQString testProperty() const { return m_prop; }
+ void setTestProperty(TQString prop) { m_prop = prop; }
signals:
void testSignal();
- void testSignalString(const QString&);
- void stdoutSignal(const QString&);
- void stderrSignal(const QString&);
+ void testSignalString(const TQString&);
+ void stdoutSignal(const TQString&);
+ void stderrSignal(const TQString&);
public slots:
void testSlot();
void testSlot2();
- void stdoutSlot(const QString&);
- void stderrSlot(const QString&);
+ void stdoutSlot(const TQString&);
+ void stderrSlot(const TQString&);
- QObject* self() { return this; }
+ TQObject* self() { return this; }
private:
- QString m_prop;
+ TQString m_prop;
};
#endif
diff --git a/lib/kross/test/testplugin.cpp b/lib/kross/test/testplugin.cpp
index 07fffc6a..0f0dd249 100644
--- a/lib/kross/test/testplugin.cpp
+++ b/lib/kross/test/testplugin.cpp
@@ -24,7 +24,7 @@
* TestPluginObject
*/
-TestPluginObject::TestPluginObject(const QString& name)
+TestPluginObject::TestPluginObject(const TQString& name)
: Kross::Api::Class<TestPluginObject>(name)
{
// Functions to test the basic datatypes
@@ -63,7 +63,7 @@ TestPluginObject::TestPluginObject(const QString& name)
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
("stringfunc_defarg", this, &TestPluginObject::stringfunc, new Kross::Api::Variant("MyDefaultString") );
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
- ("stringlistfunc_defarg", this, &TestPluginObject::stringlistfunc, new Kross::Api::Variant(QVariant(QStringList() << "Default1" << "Default2")));
+ ("stringlistfunc_defarg", this, &TestPluginObject::stringlistfunc, new Kross::Api::Variant(TQVariant(TQStringList() << "Default1" << "Default2")));
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
("variantfunc_defarg", this, &TestPluginObject::variantfunc, new Kross::Api::Variant("MyDefaultVariantString") );
@@ -75,7 +75,7 @@ TestPluginObject::~TestPluginObject()
{
}
-const QString TestPluginObject::getClassName() const
+const TQString TestPluginObject::getClassName() const
{
return "TestPluginObject";
}
@@ -85,20 +85,20 @@ void TestPluginObject::voiduintfunc(uint) {}
int TestPluginObject::intfunc(int i) { return i; }
bool TestPluginObject::boolfunc(bool b) { return b; }
double TestPluginObject::doublefunc(double d) { return d; }
-QCString TestPluginObject::cstringfunc(const QCString& s) { return s; }
-QString TestPluginObject::stringfunc(const QString& s) { return s; }
-QStringList TestPluginObject::stringlistfunc(const QStringList& sl) { return sl; }
-QVariant TestPluginObject::variantfunc(const QVariant& v) { return v; }
+TQCString TestPluginObject::cstringfunc(const TQCString& s) { return s; }
+TQString TestPluginObject::stringfunc(const TQString& s) { return s; }
+TQStringList TestPluginObject::stringlistfunc(const TQStringList& sl) { return sl; }
+TQVariant TestPluginObject::variantfunc(const TQVariant& v) { return v; }
TestPluginObject* TestPluginObject::objectfunc(TestPluginObject* obj) { return obj; }
-QString TestPluginObject::stringstringfunc(const QString& s, const QString&) { return s; }
-uint TestPluginObject::uintdoublestringfunc(uint i, double, const QString&) { return i; }
-QStringList TestPluginObject::stringlistbooluintdouble(const QStringList& sl, bool, uint, double) { return sl; }
+TQString TestPluginObject::stringstringfunc(const TQString& s, const TQString&) { return s; }
+uint TestPluginObject::uintdoublestringfunc(uint i, double, const TQString&) { return i; }
+TQStringList TestPluginObject::stringlistbooluintdouble(const TQStringList& sl, bool, uint, double) { return sl; }
/************************************************************************
* TestPluginModule
*/
-TestPluginModule::TestPluginModule(const QString& name)
+TestPluginModule::TestPluginModule(const TQString& name)
: Kross::Api::Module(name)
, m_testobject( new TestObject() )
@@ -110,8 +110,8 @@ TestPluginModule::TestPluginModule(const QString& name)
new Kross::Api::Event<TestObject>("testpluginobject2");
addChild(testobjectclass);
- // Wrap a whole QObject
- addChild( new Kross::Api::QtObject( new TestObject() , "testqobject1" ) );
+ // Wrap a whole TQObject
+ addChild( new Kross::Api::TQtObject( new TestObject() , "testqobject1" ) );
}
TestPluginModule::~TestPluginModule()
@@ -119,7 +119,7 @@ TestPluginModule::~TestPluginModule()
delete m_testobject;
}
-const QString TestPluginModule::getClassName() const
+const TQString TestPluginModule::getClassName() const
{
return "TestPluginModule";
}
diff --git a/lib/kross/test/testplugin.h b/lib/kross/test/testplugin.h
index 5253becf..a3b0fdbf 100644
--- a/lib/kross/test/testplugin.h
+++ b/lib/kross/test/testplugin.h
@@ -25,17 +25,17 @@
#include "../api/class.h"
#include "../api/proxy.h"
#include "../api/module.h"
-#include "../api/qtobject.h"
+#include "../api/tqtobject.h"
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
class TestPluginObject : public Kross::Api::Class<TestPluginObject>
{
public:
- TestPluginObject(const QString& name);
+ TestPluginObject(const TQString& name);
virtual ~TestPluginObject();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
private:
uint uintfunc(uint);
@@ -43,16 +43,16 @@ class TestPluginObject : public Kross::Api::Class<TestPluginObject>
int intfunc(int);
bool boolfunc(bool);
double doublefunc(double);
- QCString cstringfunc(const QCString&);
- QString stringfunc(const QString&);
- QStringList stringlistfunc(const QStringList&);
- QVariant variantfunc(const QVariant&);
+ TQCString cstringfunc(const TQCString&);
+ TQString stringfunc(const TQString&);
+ TQStringList stringlistfunc(const TQStringList&);
+ TQVariant variantfunc(const TQVariant&);
TestPluginObject* objectfunc(TestPluginObject* obj);
- QString stringstringfunc(const QString&, const QString&);
- uint uintdoublestringfunc(uint, double, const QString&);
- QStringList stringlistbooluintdouble(const QStringList&, bool, uint, double);
+ TQString stringstringfunc(const TQString&, const TQString&);
+ uint uintdoublestringfunc(uint, double, const TQString&);
+ TQStringList stringlistbooluintdouble(const TQStringList&, bool, uint, double);
};
class TestObject;
@@ -60,11 +60,11 @@ class TestObject;
class TestPluginModule : public Kross::Api::Module
{
public:
- TestPluginModule(const QString& name);
+ TestPluginModule(const TQString& name);
virtual ~TestPluginModule();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Kross::Api::Object::Ptr get(const QString& /*name*/, void* /*pointer*/ = 0)
+ virtual Kross::Api::Object::Ptr get(const TQString& /*name*/, void* /*pointer*/ = 0)
{
return 0;
}
diff --git a/lib/kross/test/testwindow.cpp b/lib/kross/test/testwindow.cpp
index f60119f0..5aa33958 100644
--- a/lib/kross/test/testwindow.cpp
+++ b/lib/kross/test/testwindow.cpp
@@ -20,13 +20,13 @@
#include "testwindow.h"
#include "testplugin.h"
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qvgroupbox.h>
-//#include <qhgroupbox.h>
-#include <qcombobox.h>
-#include <qdir.h>
-#include <qpopupmenu.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqvgroupbox.h>
+//#include <tqhgroupbox.h>
+#include <tqcombobox.h>
+#include <tqdir.h>
+#include <tqpopupmenu.h>
#include <ktextedit.h>
#include <kpushbutton.h>
@@ -34,7 +34,7 @@
#include <kmenubar.h>
#include <kstandarddirs.h>
-TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode)
+TestWindow::TestWindow(const TQString& interpretername, const TQString& scriptcode)
: KMainWindow()
, m_interpretername(interpretername)
, m_scriptcode(scriptcode)
@@ -48,12 +48,12 @@ TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode
m_scriptextension = new Kross::Api::ScriptGUIClient(this, this);
- QString file = KGlobal::dirs()->findResource("appdata", "testscripting.rc");
+ TQString file = KGlobal::dirs()->findResource("appdata", "testscripting.rc");
if(file.isNull())
- file = QDir(QDir::currentDirPath()).filePath("testscripting.rc");
+ file = TQDir(TQDir::currentDirPath()).filePath("testscripting.rc");
else Kross::krossdebug("-------------------------222222");
- Kross::krossdebug(QString("XML-file: %1").arg(file));
+ Kross::krossdebug(TQString("XML-file: %1").tqarg(file));
m_scriptextension->setXMLFile(file);
//menuFile->insertSeparator();
@@ -68,22 +68,22 @@ TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode
if(scriptsaction) scriptsaction->plug(menuFile);
//menuFile->insertItem( ( (KActionMenu*)m_scriptextension->action("scripts") )->popupMenu() );
- QVBox* mainbox = new QVBox(this);
+ TQVBox* mainbox = new TQVBox(this);
- QVGroupBox* interpretergrpbox = new QVGroupBox("Interpreter", mainbox);
- QStringList interpreters = Kross::Api::Manager::scriptManager()->getInterpreters();
- m_interpretercombo = new QComboBox(interpretergrpbox);
+ TQVGroupBox* interpretergrpbox = new TQVGroupBox("Interpreter", mainbox);
+ TQStringList interpreters = Kross::Api::Manager::scriptManager()->getInterpreters();
+ m_interpretercombo = new TQComboBox(interpretergrpbox);
m_interpretercombo->insertStringList(interpreters);
m_interpretercombo->setCurrentText(interpretername);
- QVGroupBox* scriptgrpbox = new QVGroupBox("Scripting code", mainbox);
- m_codeedit = new KTextEdit(m_scriptcode, QString::null, scriptgrpbox);
- m_codeedit->setWordWrap(QTextEdit::NoWrap);
- m_codeedit->setTextFormat(Qt::PlainText);
+ TQVGroupBox* scriptgrpbox = new TQVGroupBox("Scripting code", mainbox);
+ m_codeedit = new KTextEdit(m_scriptcode, TQString(), scriptgrpbox);
+ m_codeedit->setWordWrap(TQTextEdit::NoWrap);
+ m_codeedit->setTextFormat(TQt::PlainText);
- QHBox* btnbox = new QHBox(mainbox);
+ TQHBox* btnbox = new TQHBox(mainbox);
KPushButton* execbtn = new KPushButton("Execute", btnbox);
- connect(execbtn, SIGNAL(clicked()), this, SLOT(execute()));
+ connect(execbtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(execute()));
setCentralWidget(mainbox);
setMinimumSize(600,420);
@@ -99,11 +99,11 @@ void TestWindow::execute()
m_scriptcontainer->setCode(m_codeedit->text());
Kross::Api::Object::Ptr result = m_scriptcontainer->execute();
if(m_scriptcontainer->hadException()) {
- Kross::krossdebug( QString("EXCEPTION => %1").arg(m_scriptcontainer->getException()->toString()) );
+ Kross::krossdebug( TQString("EXCEPTION => %1").tqarg(m_scriptcontainer->getException()->toString()) );
}
else {
- QString s = result ? result->toString() : QString::null;
- Kross::krossdebug( QString("DONE => %1").arg(s) );
+ TQString s = result ? result->toString() : TQString();
+ Kross::krossdebug( TQString("DONE => %1").tqarg(s) );
}
}
diff --git a/lib/kross/test/testwindow.h b/lib/kross/test/testwindow.h
index dbb190b9..9f5da67d 100644
--- a/lib/kross/test/testwindow.h
+++ b/lib/kross/test/testwindow.h
@@ -25,30 +25,31 @@
#include "../main/scriptguiclient.h"
#include "../api/object.h"
-//#include <qobject.h>
-#include <qstring.h>
+//#include <tqobject.h>
+#include <tqstring.h>
#include <kmainwindow.h>
-class QComboBox;
+class TQComboBox;
class KTextEdit;
class TestWindow : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
- TestWindow(const QString& interpretername, const QString& scriptcode);
+ TestWindow(const TQString& interpretername, const TQString& scriptcode);
virtual ~TestWindow();
private slots:
void execute();
private:
- QString m_interpretername;
- QString m_scriptcode;
+ TQString m_interpretername;
+ TQString m_scriptcode;
Kross::Api::ScriptContainer::Ptr m_scriptcontainer;
Kross::Api::ScriptGUIClient* m_scriptextension;
- QComboBox* m_interpretercombo;
+ TQComboBox* m_interpretercombo;
KTextEdit* m_codeedit;
};