From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- kjsembed/jsfactory_imp.cpp | 68 +++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'kjsembed/jsfactory_imp.cpp') diff --git a/kjsembed/jsfactory_imp.cpp b/kjsembed/jsfactory_imp.cpp index 4c9fea00..dd999610 100644 --- a/kjsembed/jsfactory_imp.cpp +++ b/kjsembed/jsfactory_imp.cpp @@ -35,7 +35,7 @@ namespace KJSEmbed { namespace Bindings { -JSFactoryImp::JSFactoryImp( KJS::ExecState *exec, JSFactory *jsfact, int mid, const TQString &p ) +JSFactoryImp::JSFactoryImp( KJS::ExecState *exec, JSFactory *jsfact, int mid, const TTQString &p ) : JSProxyImp(exec), fact(jsfact), id(mid), param(p), defaultVal() { setName( KJS::Identifier(KJS::UString(param)) ); @@ -50,7 +50,7 @@ KJS::Object JSFactoryImp::construct( KJS::ExecState *exec, const KJS::List &args if ( id != NewInstance ) { kdDebug(80001) << "JSFactoryImp has no such constructor, id " << id << endl; - TQString msg = i18n( "JSFactoryImp has no constructor with id '%1'." ).arg( id ); + TTQString msg = i18n( "JSFactoryImp has no constructor with id '%1'." ).arg( id ); return throwError(exec, msg,KJS::ReferenceError); } @@ -71,8 +71,8 @@ KJS::Value JSFactoryImp::defaultValue( KJS::ExecState *exec, KJS::Type hint ) co KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) { - TQString arg0 = (args.size() > 0) ? args[0].toString(exec).qstring() : TQString::null; - TQString arg1 = (args.size() > 1) ? args[1].toString(exec).qstring() : TQString::null; + TTQString arg0 = (args.size() > 0) ? args[0].toString(exec).qstring() : TTQString::null; + TTQString arg1 = (args.size() > 1) ? args[1].toString(exec).qstring() : TTQString::null; kdDebug( 80001 ) << "JSFactoryImp::call() " << id << endl; KJS::Object err; @@ -81,20 +81,20 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ case MethodLoadUI: { JSObjectProxy *cproxy = JSProxy::toObjectProxy( args[1].imp() ); - TQObject *cqo = cproxy ? cproxy->object() : 0; + TTQObject *cqo = cproxy ? cproxy->object() : 0; JSObjectProxy *proxy = JSProxy::toObjectProxy( args[2].imp() ); - TQWidget *qw = proxy ? proxy->widget() : 0; - TQWidget *obj = fact->loadUI( arg0, cqo, qw, arg1.latin1() ); + TTQWidget *qw = proxy ? proxy->widget() : 0; + TTQWidget *obj = fact->loadUI( arg0, cqo, qw, arg1.latin1() ); if ( obj ) { KJS::Object parentObject = fact->createProxy( exec, obj ); // Add properties for child widgets. - const TQObjectList *lst = obj->children(); + const TTQObjectList *lst = obj->children(); if ( lst ) { - TQObjectListIt it( *lst ); - TQObject *child; + TTQObjectListIt it( *lst ); + TTQObject *child; while ( (child = it.current()) != 0 ) { publishChildren( child, parentObject); @@ -104,7 +104,7 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ return parentObject; } - TQString msg = i18n( "Unable to create ui from file '%1'." ).arg(arg0); + TTQString msg = i18n( "Unable to create ui from file '%1'." ).arg(arg0); err = throwError(exec, msg,KJS::ReferenceError); break; } @@ -112,8 +112,8 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ { kdDebug(80001) << "MethodCreateROPart called, args.size is " << args.size() << endl; - TQObject *qo = 0; - TQObject *ropart = 0; + TTQObject *qo = 0; + TTQObject *ropart = 0; if ( args.size() == 3 ) { JSObjectProxy *proxy = JSProxy::toObjectProxy( args[1].imp() ); @@ -128,7 +128,7 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ else if ( args.size() == 5 ) { JSObjectProxy *proxy = JSProxy::toObjectProxy( args[2].imp() ); qo = proxy ? proxy->object() : 0; - TQStringList slist = extractQStringList( exec, args, 4 ); + TTQStringList slist = extractTQStringList( exec, args, 4 ); ropart = fact->createROPart( arg0, arg1, qo, args[3].toString(exec).ascii(), slist ); } @@ -141,7 +141,7 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ if ( ropart ) return fact->createProxy( exec, ropart ); - TQString msg = i18n( "Unable to create read-only part for service '%1'." ).arg(arg0); + TTQString msg = i18n( "Unable to create read-only part for service '%1'." ).arg(arg0); err = throwError(exec, msg,KJS::ReferenceError); break; } @@ -155,8 +155,8 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ { KJS::List l; - TQStringList widgets = TQWidgetFactory::widgets(); - for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { + TTQStringList widgets = TTQWidgetFactory::widgets(); + for ( TTQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { l.append( KJS::String( *it ) ); } @@ -168,9 +168,9 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ return KJS::Boolean( fact->isSupported( arg0 ) ); break; } - case MethodIsQObject: + case MethodIsTQObject: { - return KJS::Boolean( fact->isQObject( arg0 ) ); + return KJS::Boolean( fact->isTQObject( arg0 ) ); break; } case MethodIsOpaque: @@ -186,8 +186,8 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ case MethodTypes: { KJS::List l; - TQStringList types = fact->types(); - for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + TTQStringList types = fact->types(); + for ( TTQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { l.append( KJS::String( *it ) ); } @@ -203,8 +203,8 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ { kdDebug(80001) << "MethodCreateRWPart called, args.size is " << args.size() << endl; - TQObject *qo = 0; - TQObject *rwpart = 0; + TTQObject *qo = 0; + TTQObject *rwpart = 0; if ( args.size() == 3 ) { JSObjectProxy *proxy = JSProxy::toObjectProxy( args[1].imp() ); @@ -226,7 +226,7 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ if ( rwpart ) return fact->createProxy( exec, rwpart ); - TQString msg = i18n( "Unable to create read-write part for service '%1'." ).arg(arg0); + TTQString msg = i18n( "Unable to create read-write part for service '%1'." ).arg(arg0); err = throwError(exec, msg,KJS::ReferenceError); break; } @@ -245,7 +245,7 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ default: { kdWarning() << "JSBuiltInImp has no method " << id << endl; - TQString msg = i18n( "JSFactoryImp has no method with id '%1'." ).arg( id ); + TTQString msg = i18n( "JSFactoryImp has no method with id '%1'." ).arg( id ); err = throwError(exec, msg,KJS::ReferenceError); } } @@ -253,9 +253,9 @@ KJS::Value JSFactoryImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ } -void JSFactoryImp::publishChildren(TQObject *obj, KJS::Object &parent) +void JSFactoryImp::publishChildren(TTQObject *obj, KJS::Object &parent) { - TQString name = obj->name(); + TTQString name = obj->name(); name.remove(":"); name.remove(" "); name.remove("<"); @@ -263,10 +263,10 @@ void JSFactoryImp::publishChildren(TQObject *obj, KJS::Object &parent) KJS::Object newParent = fact->part()->addObject( obj, parent, name.latin1() ); JSProxy::toProxy( newParent.imp() ) ->setOwner( JSProxy::JavaScript ); - // Hack to publish QToolBoxes children - TQToolBox *box = dynamic_cast(obj); - TQTabWidget *tab = dynamic_cast(obj); - TQWizard *wiz = dynamic_cast(obj); + // Hack to publish TQToolBoxes children + TTQToolBox *box = dynamic_cast(obj); + TTQTabWidget *tab = dynamic_cast(obj); + TTQWizard *wiz = dynamic_cast(obj); if( box ) { int count = box->count(); @@ -281,10 +281,10 @@ void JSFactoryImp::publishChildren(TQObject *obj, KJS::Object &parent) for( int idx = 0; idx < count; ++idx) publishChildren(wiz->page(idx),newParent); } else { - const TQObjectList *lst = obj->children(); + const TTQObjectList *lst = obj->children(); if ( lst ) { - TQObjectListIt it( *lst ); - TQObject *child; + TTQObjectListIt it( *lst ); + TTQObject *child; while ( (child = it.current()) != 0 ) { publishChildren( child, newParent); ++it; -- cgit v1.2.1