diff options
Diffstat (limited to 'lib/kross/api')
-rw-r--r-- | lib/kross/api/callable.cpp | 28 | ||||
-rw-r--r-- | lib/kross/api/callable.h | 8 | ||||
-rw-r--r-- | lib/kross/api/class.h | 2 | ||||
-rw-r--r-- | lib/kross/api/event.h | 4 | ||||
-rw-r--r-- | lib/kross/api/eventscript.cpp | 2 | ||||
-rw-r--r-- | lib/kross/api/eventsignal.cpp | 6 | ||||
-rw-r--r-- | lib/kross/api/eventslot.cpp | 26 | ||||
-rw-r--r-- | lib/kross/api/exception.cpp | 6 | ||||
-rw-r--r-- | lib/kross/api/interpreter.cpp | 6 | ||||
-rw-r--r-- | lib/kross/api/list.cpp | 4 | ||||
-rw-r--r-- | lib/kross/api/module.h | 4 | ||||
-rw-r--r-- | lib/kross/api/object.cpp | 10 | ||||
-rw-r--r-- | lib/kross/api/object.h | 2 | ||||
-rw-r--r-- | lib/kross/api/qtobject.cpp | 38 | ||||
-rw-r--r-- | lib/kross/api/variant.cpp | 18 |
15 files changed, 82 insertions, 82 deletions
diff --git a/lib/kross/api/callable.cpp b/lib/kross/api/callable.cpp index f095f596..b85aa4cd 100644 --- a/lib/kross/api/callable.cpp +++ b/lib/kross/api/callable.cpp @@ -47,26 +47,26 @@ const TQString Callable::getClassName() const bool Callable::hasChild(const TQString& name) const { - return m_tqchildren.contains(name); + return m_children.contains(name); } Object::Ptr Callable::getChild(const TQString& name) const { - return m_tqchildren[name]; + return m_children[name]; } TQMap<TQString, Object::Ptr> Callable::getChildren() const { - return m_tqchildren; + return m_children; } bool Callable::addChild(const TQString& name, Object* object) { #ifdef KROSS_API_OBJECT_ADDCHILD_DEBUG krossdebug( TQString("Kross::Api::Callable::addChild() object.name='%1' object.classname='%2'") - .tqarg(name).tqarg(object->getClassName()) ); + .arg(name).arg(object->getClassName()) ); #endif - m_tqchildren.replace(name, Object::Ptr(object)); + m_children.replace(name, Object::Ptr(object)); return true; } @@ -78,9 +78,9 @@ bool Callable::addChild(Callable* object) void Callable::removeChild(const TQString& name) { #ifdef KROSS_API_OBJECT_REMCHILD_DEBUG - krossdebug( TQString("Kross::Api::Callable::removeChild() name='%1'").tqarg(name) ); + krossdebug( TQString("Kross::Api::Callable::removeChild() name='%1'").arg(name) ); #endif - m_tqchildren.remove(name); + m_children.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_tqchildren.clear(); + m_children.clear(); } Object::Ptr Callable::call(const TQString& name, List::Ptr args) { #ifdef KROSS_API_CALLABLE_CALL_DEBUG - krossdebug( TQString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").tqarg(name).tqarg(getName()).tqarg(args ? args->toString() : TQString("")) ); + krossdebug( TQString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").arg(name).arg(getName()).arg(args ? args->toString() : TQString("")) ); #endif if(name.isEmpty()) // return a self-reference if no functionname is defined. @@ -111,7 +111,7 @@ Object::Ptr Callable::call(const TQString& name, List::Ptr args) TQString s = Variant::toString(args->item(0)); Object::Ptr obj = getChild(s); if(! obj) - throw Exception::Ptr( new Exception(TQString("The object '%1' has no child object '%2'").tqarg(getName()).tqarg(s)) ); + throw Exception::Ptr( new Exception(TQString("The object '%1' has no child object '%2'").arg(getName()).arg(s)) ); return obj; } else if(name == "has") { @@ -123,9 +123,9 @@ Object::Ptr Callable::call(const TQString& name, List::Ptr args) } else if(name == "list") { TQStringList list; - TQMap<TQString, Object::Ptr> tqchildren = getChildren(); - TQMap<TQString, Object::Ptr>::Iterator it( tqchildren.begin() ); - for(; it != tqchildren.end(); ++it) + TQMap<TQString, Object::Ptr> children = getChildren(); + TQMap<TQString, Object::Ptr>::Iterator it( children.begin() ); + for(; it != children.end(); ++it) list.append( it.key() ); return new Variant(list); } @@ -134,6 +134,6 @@ Object::Ptr Callable::call(const TQString& name, List::Ptr args) } // If there exists no such object return NULL. - krossdebug( TQString("Object '%1' has no callable object named '%2'.").tqarg(getName()).tqarg(name) ); + krossdebug( TQString("Object '%1' has no callable object named '%2'.").arg(getName()).arg(name) ); return 0; } diff --git a/lib/kross/api/callable.h b/lib/kross/api/callable.h index 63edb067..0e3dd3a6 100644 --- a/lib/kross/api/callable.h +++ b/lib/kross/api/callable.h @@ -92,9 +92,9 @@ namespace Kross { namespace Api { Object::Ptr getChild(const TQString& name) const; /** - * Return all tqchildren. + * Return all children. * - * \return A \a ObjectMap of tqchildren this Object has. + * \return A \a ObjectMap of children this Object has. */ TQMap<TQString, Object::Ptr> getChildren() const; @@ -125,7 +125,7 @@ namespace Kross { namespace Api { void removeChild(const TQString& name); /** - * Remove all tqchildren. + * Remove all children. */ void removeAllChildren(); @@ -138,7 +138,7 @@ namespace Kross { namespace Api { /// Name this callable object has. TQString m_name; /// A list of childobjects. - TQMap<TQString, Object::Ptr> m_tqchildren; + TQMap<TQString, Object::Ptr> m_children; }; }} diff --git a/lib/kross/api/class.h b/lib/kross/api/class.h index de1d898c..6224a61a 100644 --- a/lib/kross/api/class.h +++ b/lib/kross/api/class.h @@ -76,7 +76,7 @@ namespace Kross { namespace Api { /* virtual Object::Ptr call(const TQString& name, List::Ptr arguments) { - krossdebug( TQString("Class::call(%1)").tqarg(name) ); + krossdebug( TQString("Class::call(%1)").arg(name) ); return Event<T>::call(name, arguments); } */ diff --git a/lib/kross/api/event.h b/lib/kross/api/event.h index 26a92117..b75107f7 100644 --- a/lib/kross/api/event.h +++ b/lib/kross/api/event.h @@ -201,13 +201,13 @@ namespace Kross { namespace Api { virtual Object::Ptr call(const TQString& name, List::Ptr arguments) { #ifdef KROSS_API_EVENT_CALL_DEBUG - krossdebug( TQString("Event::call() name='%1' getName()='%2'").tqarg(name).tqarg(getName()) ); + krossdebug( TQString("Event::call() name='%1' getName()='%2'").arg(name).arg(getName()) ); #endif Function* function = m_functions[name]; if(function) { #ifdef KROSS_API_EVENT_CALL_DEBUG - krossdebug( TQString("Event::call() name='%1' is a builtin function.").tqarg(name) ); + krossdebug( TQString("Event::call() name='%1' is a builtin function.").arg(name) ); #endif return function->call(arguments); } diff --git a/lib/kross/api/eventscript.cpp b/lib/kross/api/eventscript.cpp index 43c4c1cb..f9fe9f9a 100644 --- a/lib/kross/api/eventscript.cpp +++ b/lib/kross/api/eventscript.cpp @@ -40,7 +40,7 @@ const TQString EventScript::getClassName() const Object::Ptr EventScript::call(const TQString& name, KSharedPtr<List> arguments) { - krossdebug( TQString("EventScript::call() name=%1 arguments=%2").tqarg(name).tqarg(arguments->toString()) ); + krossdebug( TQString("EventScript::call() name=%1 arguments=%2").arg(name).arg(arguments->toString()) ); //TODO return 0; } diff --git a/lib/kross/api/eventsignal.cpp b/lib/kross/api/eventsignal.cpp index e3a8e54f..8f4d2c50 100644 --- a/lib/kross/api/eventsignal.cpp +++ b/lib/kross/api/eventsignal.cpp @@ -46,7 +46,7 @@ const TQString EventSignal::getClassName() const Object::Ptr EventSignal::call(const TQString& /*name*/, KSharedPtr<List> arguments) { #ifdef KROSS_API_EVENTSIGNAL_CALL_DEBUG - krossdebug( TQString("EventSignal::call() m_signal=%1 arguments=%2").tqarg(m_signal).tqarg(arguments->toString()) ); + krossdebug( TQString("EventSignal::call() m_signal=%1 arguments=%2").arg(m_signal).arg(arguments->toString()) ); #endif TQString n = m_signal; @@ -54,9 +54,9 @@ Object::Ptr EventSignal::call(const TQString& /*name*/, KSharedPtr<List> argumen if(n.startsWith("2")) // Remove prefix of SIGNAL-macros n.remove(0,1); - int signalid = m_sender->tqmetaObject()->findSignal(n.latin1(), false); + int signalid = m_sender->metaObject()->findSignal(n.latin1(), false); if(signalid < 0) - throw new Exception(TQString("No such signal '%1'.").tqarg(n)); + throw new Exception(TQString("No such signal '%1'.").arg(n)); TQUObject* uo = QtObject::toTQUObject(n, arguments); m_sender->qt_emit(signalid, uo); // emit the signal diff --git a/lib/kross/api/eventslot.cpp b/lib/kross/api/eventslot.cpp index fd566d31..3f6482db 100644 --- a/lib/kross/api/eventslot.cpp +++ b/lib/kross/api/eventslot.cpp @@ -46,7 +46,7 @@ const TQString EventSlot::getClassName() const Object::Ptr EventSlot::call(const TQString& /*name*/, List::Ptr arguments) { #ifdef KROSS_API_EVENTSLOT_CALL_DEBUG - krossdebug( TQString("EventSlot::call() m_slot=%1 arguments=%2").tqarg(m_slot).tqarg(arguments->toString()) ); + krossdebug( TQString("EventSlot::call() m_slot=%1 arguments=%2").arg(m_slot).arg(arguments->toString()) ); #endif TQString n = m_slot; //TODO name; //Variant::toString(args->item(0)); @@ -54,9 +54,9 @@ Object::Ptr EventSlot::call(const TQString& /*name*/, List::Ptr arguments) if(n.startsWith("1")) // Remove prefix of SLOT-macros n.remove(0,1); - int slotid = m_receiver->tqmetaObject()->findSlot(n.latin1(), false); + int slotid = m_receiver->metaObject()->findSlot(n.latin1(), false); if(slotid < 0) - throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(n)) ); + throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").arg(n)) ); TQUObject* uo = QtObject::toTQUObject(n, arguments); m_receiver->qt_invoke(slotid, uo); // invoke the slot @@ -72,7 +72,7 @@ TQCString EventSlot::getSlot(const TQCString& signal) int startpos = signature.find("("); int endpos = signature.findRev(")"); if(startpos < 0 || startpos > endpos) { - krosswarning( TQString("EventSlot::getSlot(%1) Invalid signal.").tqarg(signal) ); + krosswarning( TQString("EventSlot::getSlot(%1) Invalid signal.").arg(signal) ); return TQCString(); } TQString signalname = signature.left(startpos); @@ -80,16 +80,16 @@ TQCString EventSlot::getSlot(const TQCString& signal) //TQStringList paramlist = TQStringList::split(",", params); TQCString slot = TQString("callback(" + params + ")").latin1(); //normalizeSignalSlot(); - TQMetaObject* mo = tqmetaObject(); + TQMetaObject* mo = metaObject(); int slotid = mo->findSlot(slot, false); if(slotid < 0) { - krossdebug( TQString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").tqarg(signal).tqarg(slot) ); + krossdebug( TQString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").arg(signal).arg(slot) ); return TQCString(); } 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) ); + krossdebug( TQString("EventSlot::getSlot(%1) The slot '%2' is not public.").arg(signal).arg(slot) ); return TQCString(); } @@ -97,7 +97,7 @@ TQCString EventSlot::getSlot(const TQCString& signal) //const TQUMethod *method = md->method; krossdebug( TQString("signal=%1 slot=%2 slotid=%3 params=%4 mdname=%5") - .tqarg(signal).tqarg(slot).tqarg(slotid).tqarg(params).tqarg(md->name) ); + .arg(signal).arg(slot).arg(slotid).arg(params).arg(md->name) ); return TQCString("1" + slot); // Emulate the TQT_SLOT(...) macro by adding as first char a "1". } @@ -114,7 +114,7 @@ bool EventSlot::connect(EventManager* eventmanager, TQObject* senderobj, const T EventSlot* eventslot = create(eventmanager); eventslot->connect(eventmanager, senderobj, signal, function, slot); m_slots.append(eventslot); - krossdebug( TQString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").tqarg(senderobj->name()).tqarg(signal).tqarg(function) ); + krossdebug( TQString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").arg(senderobj->name()).arg(signal).arg(function) ); } else { m_sender = senderobj; @@ -122,10 +122,10 @@ bool EventSlot::connect(EventManager* eventmanager, TQObject* senderobj, const T m_function = function; m_slot = myslot; if(! TQObject::connect((TQObject*)senderobj, signal, this, myslot)) { - krossdebug( TQString("EventSlot::connect(%1, %2, %3) failed.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) ); + krossdebug( TQString("EventSlot::connect(%1, %2, %3) failed.").arg(senderobj->name()).arg(signal).arg(function) ); return false; } - krossdebug( TQString("EventSlot::connect(%1, %2, %3) successfully connected.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) ); + krossdebug( TQString("EventSlot::connect(%1, %2, %3) successfully connected.").arg(senderobj->name()).arg(signal).arg(function) ); } return true; } @@ -144,7 +144,7 @@ bool EventSlot::disconnect() void EventSlot::call(const TQVariant& variant) { krossdebug( TQString("EventSlot::call() sender='%1' signal='%2' function='%3'") - .tqarg(m_sender->name()).tqarg(m_signal).tqarg(m_function) ); + .arg(m_sender->name()).arg(m_signal).arg(m_function) ); Kross::Api::List* arglist = 0; @@ -159,7 +159,7 @@ void EventSlot::call(const TQVariant& variant) } catch(Exception& e) { //TODO add hadError(), getError() and setError() - krossdebug( TQString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").tqarg(variant.toString()).tqarg(e.type()).tqarg(e.description()) ); + krossdebug( TQString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").arg(variant.toString()).arg(e.type()).arg(e.description()) ); } } diff --git a/lib/kross/api/exception.cpp b/lib/kross/api/exception.cpp index c6a0198f..cb0125c4 100644 --- a/lib/kross/api/exception.cpp +++ b/lib/kross/api/exception.cpp @@ -30,7 +30,7 @@ Exception::Exception(const TQString& error, long lineno) , m_error(error) , m_lineno(lineno) { - krosswarning( TQString("Kross::Api::Exception error='%1' lineno='%3'").tqarg(m_error).tqarg(m_lineno) ); + krosswarning( TQString("Kross::Api::Exception error='%1' lineno='%3'").arg(m_error).arg(m_lineno) ); } Exception::~Exception() @@ -45,8 +45,8 @@ const TQString Exception::getClassName() const const TQString Exception::toString() { return (m_lineno != -1) - ? TQString("Exception at line %1: %2").tqarg(m_lineno).tqarg(m_error) - : TQString("Exception: %1").tqarg(m_error); + ? TQString("Exception at line %1: %2").arg(m_lineno).arg(m_error) + : TQString("Exception: %1").arg(m_error); } const TQString Exception::getError() const diff --git a/lib/kross/api/interpreter.cpp b/lib/kross/api/interpreter.cpp index 8d266930..86eae479 100644 --- a/lib/kross/api/interpreter.cpp +++ b/lib/kross/api/interpreter.cpp @@ -95,7 +95,7 @@ Interpreter* InterpreterInfo::getInterpreter() if(m_interpreter) // buffered return m_interpreter; - krossdebug( TQString("Loading the interpreter library for %1").tqarg(m_interpretername) ); + krossdebug( TQString("Loading the interpreter library for %1").arg(m_interpretername) ); // Load the krosspython library. KLibLoader *libloader = KLibLoader::self(); @@ -104,10 +104,10 @@ Interpreter* InterpreterInfo::getInterpreter() if(! library) { /* setException( - new Exception( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").tqarg(m_library).tqarg(m_interpretername) ) + new Exception( TQString("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) ); + krosswarning( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").arg(m_library).arg(m_interpretername) ); return 0; } diff --git a/lib/kross/api/list.cpp b/lib/kross/api/list.cpp index 3d894116..9e2baf52 100644 --- a/lib/kross/api/list.cpp +++ b/lib/kross/api/list.cpp @@ -51,8 +51,8 @@ Object::Ptr List::item(uint idx, Object* defaultobject) if(idx >= list.count()) { if(defaultobject) return defaultobject; - 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)) ); + krossdebug( TQString("List::item index=%1 is out of bounds. Raising TypeException.").arg(idx) ); + throw Exception::Ptr( new Exception(TQString("List-index %1 out of bounds.").arg(idx)) ); } return list[idx]; } diff --git a/lib/kross/api/module.h b/lib/kross/api/module.h index 3e58305a..f27bdf5c 100644 --- a/lib/kross/api/module.h +++ b/lib/kross/api/module.h @@ -51,7 +51,7 @@ namespace Kross { namespace Api { explicit Module(const TQString& name) : Class<Module>(name) { - krossdebug( TQString("Kross::Api::Module %1 created").tqarg(name) ); + krossdebug( TQString("Kross::Api::Module %1 created").arg(name) ); } /** @@ -59,7 +59,7 @@ namespace Kross { namespace Api { */ virtual ~Module() { - krossdebug( TQString("Kross::Api::Module %1 destroyed").tqarg(getName()) ); + krossdebug( TQString("Kross::Api::Module %1 destroyed").arg(getName()) ); } /** diff --git a/lib/kross/api/object.cpp b/lib/kross/api/object.cpp index 06ec55d5..43fa8b4b 100644 --- a/lib/kross/api/object.cpp +++ b/lib/kross/api/object.cpp @@ -30,21 +30,21 @@ Object::Object() : KShared() { #ifdef KROSS_API_OBJECT_CTOR_DEBUG - krossdebug( TQString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) ); + krossdebug( TQString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) ); #endif } Object::~Object() { #ifdef KROSS_API_OBJECT_DTOR_DEBUG - krossdebug( TQString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) ); + krossdebug( TQString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) ); #endif //removeAllChildren(); // not needed cause we use KShared to handle ref-couting and freeing. } const TQString Object::toString() { - return TQString("%1").tqarg(getClassName()); + return TQString("%1").arg(getClassName()); } Object::Ptr Object::call(const TQString& name, List::Ptr arguments) @@ -52,12 +52,12 @@ Object::Ptr Object::call(const TQString& name, List::Ptr arguments) Q_UNUSED(arguments); #ifdef KROSS_API_OBJECT_CALL_DEBUG - krossdebug( TQString("Kross::Api::Object::call(%1) name=%2 class=%3").tqarg(name).tqarg(getName()).tqarg(getClassName()) ); + krossdebug( TQString("Kross::Api::Object::call(%1) name=%2 class=%3").arg(name).arg(getName()).arg(getClassName()) ); #endif if(name.isEmpty()) // return a self-reference if no functionname is defined. return this; - throw Exception::Ptr( new Exception(TQString("No callable object named '%2'").tqarg(name)) ); + throw Exception::Ptr( new Exception(TQString("No callable object named '%2'").arg(name)) ); } diff --git a/lib/kross/api/object.h b/lib/kross/api/object.h index 87bd2132..f23a6179 100644 --- a/lib/kross/api/object.h +++ b/lib/kross/api/object.h @@ -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(TQString("Object \"%1\" invalid.").tqarg(object ? object->getClassName() : "")) ); + throw KSharedPtr<Exception>( new Exception(TQString("Object \"%1\" invalid.").arg(object ? object->getClassName() : "")) ); return t; } diff --git a/lib/kross/api/qtobject.cpp b/lib/kross/api/qtobject.cpp index 243f0503..5fc1a36a 100644 --- a/lib/kross/api/qtobject.cpp +++ b/lib/kross/api/qtobject.cpp @@ -42,13 +42,13 @@ QtObject::QtObject(TQObject* object, const TQString& name) // Walk through the signals and slots the TQObject has // and attach them as events to this QtObject. - TQStrList slotnames = m_object->tqmetaObject()->slotNames(false); + TQStrList slotnames = m_object->metaObject()->slotNames(false); for(char* c = slotnames.first(); c; c = slotnames.next()) { TQCString s = c; addChild(s, new EventSlot(s, object, s) ); } - TQStrList signalnames = m_object->tqmetaObject()->signalNames(false); + TQStrList signalnames = m_object->metaObject()->signalNames(false); for(char* c = signalnames.first(); c; c = signalnames.next()) { TQCString s = c; addChild(s, new EventSignal(s, object, s) ); @@ -93,7 +93,7 @@ TQUObject* QtObject::toTQUObject(const TQString& signature, List::Ptr arguments) int startpos = signature.find("("); int endpos = signature.findRev(")"); if(startpos < 0 || startpos > endpos) - throw Exception::Ptr( new Exception(TQString("Invalid TQt signal or slot signature '%1'").tqarg(signature)) ); + throw Exception::Ptr( new Exception(TQString("Invalid TQt signal or slot signature '%1'").arg(signature)) ); //TQString sig = signature.left(startpos); TQString params = signature.mid(startpos + 1, endpos - startpos - 1); @@ -107,19 +107,19 @@ TQUObject* QtObject::toTQUObject(const TQString& signature, List::Ptr arguments) //TQString t; //for(int j=0; j<argcount; j++) t += "'" + Variant::toString(arguments->item(j)) + "' "; -//krossdebug( TQString("1 ---------------------: (%1) %2").tqarg(argcount).tqarg(t) ); +//krossdebug( TQString("1 ---------------------: (%1) %2").arg(argcount).arg(t) ); // Fill parameters. uint argcount = arguments ? arguments->count() : 0; for(uint i = 0; i < paramcount; i++) { if(paramlist[i].find(TQSTRING_OBJECT_NAME_STRING) >= 0) { const TQString s = (argcount > i) ? Variant::toString(arguments->item(i)) : TQString(); - //krossdebug(TQString("EventSlot::toTQUObject s=%1").tqarg(s)); + //krossdebug(TQString("EventSlot::toTQUObject s=%1").arg(s)); static_TQUType_TQString.set( &(uo[i + 1]), s ); } //TODO handle int, long, char*, TQStringList, etc. else { - throw Exception::Ptr( new Exception(TQString("Unknown TQt signal or slot argument '%1' in signature '%2'.").tqarg(paramlist[i]).tqarg(signature)) ); + throw Exception::Ptr( new Exception(TQString("Unknown TQt signal or slot argument '%1' in signature '%2'.").arg(paramlist[i]).arg(signature)) ); } } @@ -129,13 +129,13 @@ TQUObject* QtObject::toTQUObject(const TQString& signature, List::Ptr arguments) Kross::Api::Object::Ptr QtObject::propertyNames(Kross::Api::List::Ptr) { return new Kross::Api::Variant( - TQStringList::fromStrList(m_object->tqmetaObject()->propertyNames(false))); + TQStringList::fromStrList(m_object->metaObject()->propertyNames(false))); } Kross::Api::Object::Ptr QtObject::hasProperty(Kross::Api::List::Ptr args) { return new Kross::Api::Variant( - m_object->tqmetaObject()->findProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false)); + m_object->metaObject()->findProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false)); } Kross::Api::Object::Ptr QtObject::getProperty(Kross::Api::List::Ptr args) @@ -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( - TQStringList::fromStrList(m_object->tqmetaObject()->slotNames(false))); + TQStringList::fromStrList(m_object->metaObject()->slotNames(false))); } Kross::Api::Object::Ptr QtObject::hasSlot(Kross::Api::List::Ptr args) { return new Kross::Api::Variant( - bool(m_object->tqmetaObject()->slotNames(false).find( + bool(m_object->metaObject()->slotNames(false).find( Kross::Api::Variant::toString(args->item(0)).latin1() ) != -1)); } @@ -173,9 +173,9 @@ Kross::Api::Object::Ptr QtObject::callSlot(Kross::Api::List::Ptr args) { //TODO just call the child event ?! TQString name = Kross::Api::Variant::toString(args->item(0)); - int slotid = m_object->tqmetaObject()->findSlot(name.latin1(), false); + int slotid = m_object->metaObject()->findSlot(name.latin1(), false); if(slotid < 0) - throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(name)) ); + throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").arg(name)) ); TQUObject* uo = QtObject::toTQUObject(name, args); m_object->qt_invoke(slotid, uo); @@ -187,13 +187,13 @@ Kross::Api::Object::Ptr QtObject::callSlot(Kross::Api::List::Ptr args) Kross::Api::Object::Ptr QtObject::signalNames(Kross::Api::List::Ptr) { return new Kross::Api::Variant( - TQStringList::fromStrList(m_object->tqmetaObject()->signalNames(false))); + TQStringList::fromStrList(m_object->metaObject()->signalNames(false))); } Kross::Api::Object::Ptr QtObject::hasSignal(Kross::Api::List::Ptr args) { return new Kross::Api::Variant( - bool(m_object->tqmetaObject()->signalNames(false).find( + bool(m_object->metaObject()->signalNames(false).find( Kross::Api::Variant::toString(args->item(0)).latin1() ) != -1)); } @@ -201,9 +201,9 @@ Kross::Api::Object::Ptr QtObject::hasSignal(Kross::Api::List::Ptr args) Kross::Api::Object::Ptr QtObject::emitSignal(Kross::Api::List::Ptr args) { TQString name = Kross::Api::Variant::toString(args->item(0)); - int signalid = m_object->tqmetaObject()->findSignal(name.latin1(), false); + int signalid = m_object->metaObject()->findSignal(name.latin1(), false); if(signalid < 0) - throw Exception::Ptr( new Exception(TQString("No such signal '%1'.").tqarg(name)) ); + throw Exception::Ptr( new Exception(TQString("No such signal '%1'.").arg(name)) ); m_object->qt_invoke(signalid, 0); //TODO convert Kross::Api::List::Ptr => TQUObject* return 0; } @@ -211,16 +211,16 @@ Kross::Api::Object::Ptr QtObject::emitSignal(Kross::Api::List::Ptr args) Kross::Api::Object::Ptr QtObject::connectSignal(Kross::Api::List::Ptr args) { TQString signalname = Kross::Api::Variant::toString(args->item(0)); - TQString signalsignatur = TQString("2%1").tqarg(signalname); + TQString signalsignatur = TQString("2%1").arg(signalname); const char* signalsig = signalsignatur.latin1(); QtObject* obj = Kross::Api::Object::fromObject<Kross::Api::QtObject>(args->item(1)); TQObject* o = obj->getObject(); if(! o) - throw Exception::Ptr( new Exception(TQString("No such TQObject receiver in '%1'.").tqarg(obj->getName())) ); + throw Exception::Ptr( new Exception(TQString("No such TQObject receiver in '%1'.").arg(obj->getName())) ); TQString slotname = Kross::Api::Variant::toString(args->item(2)); - TQString slotsignatur = TQString("1%1").tqarg(slotname); + TQString slotsignatur = TQString("1%1").arg(slotname); const char* slotsig = slotsignatur.latin1(); return new Kross::Api::Variant( diff --git a/lib/kross/api/variant.cpp b/lib/kross/api/variant.cpp index e8d8bc1b..54e8ed7e 100644 --- a/lib/kross/api/variant.cpp +++ b/lib/kross/api/variant.cpp @@ -81,7 +81,7 @@ const TQString Variant::toString(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::String expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toString(); } @@ -89,7 +89,7 @@ int Variant::toInt(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Int expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toInt(); } @@ -97,7 +97,7 @@ uint Variant::toUInt(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::UInt expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toUInt(); } @@ -105,7 +105,7 @@ double Variant::toDouble(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Double expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toDouble(); } @@ -113,7 +113,7 @@ TQ_LLONG Variant::toLLONG(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::LLONG expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toLongLong(); } @@ -121,7 +121,7 @@ TQ_ULLONG Variant::toULLONG(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::ULLONG expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toULongLong(); } @@ -129,7 +129,7 @@ bool Variant::toBool(Object::Ptr object) { 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Bool expected, but got %1.").arg(variant.typeName()).latin1()) ); return variant.toBool(); } @@ -146,7 +146,7 @@ TQStringList Variant::toStringList(Object::Ptr object) } 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()) ); + throw Exception::Ptr( new Exception(TQString("Kross::Api::Variant::StringList expected, but got '%1'.").arg(variant.typeName()).latin1()) ); return variant.toStringList(); } @@ -163,6 +163,6 @@ TQValueList<TQVariant> Variant::toList(Object::Ptr object) } 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()) ); + throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::List expected, but got '%1'.").arg(variant.typeName()).latin1()) ); return variant.toList(); } |