diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross/api/callable.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kross/api/callable.cpp')
-rw-r--r-- | lib/kross/api/callable.cpp | 52 |
1 files changed, 26 insertions, 26 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; } |