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/jsbuiltin_imp.cpp | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'kjsembed/jsbuiltin_imp.cpp') diff --git a/kjsembed/jsbuiltin_imp.cpp b/kjsembed/jsbuiltin_imp.cpp index 8a54cabf..19b4e42f 100644 --- a/kjsembed/jsbuiltin_imp.cpp +++ b/kjsembed/jsbuiltin_imp.cpp @@ -61,7 +61,7 @@ namespace KJSEmbed { namespace Bindings { -JSBuiltInImp::JSBuiltInImp( JSBuiltIn *builtin, int mid, const TQString &p ) +JSBuiltInImp::JSBuiltInImp( JSBuiltIn *builtin, int mid, const TTQString &p ) : JSProxyImp(builtin->part()->globalExec()), part(builtin->part()), id(mid), param(p) { setName( KJS::Identifier( KJS::UString(param) ) ); @@ -71,8 +71,8 @@ JSBuiltInImp::~JSBuiltInImp() {} KJS::Value JSBuiltInImp::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; if ( id == MethodLoadScript ) { @@ -85,7 +85,7 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ return KJS::Boolean( ok ); } else { - TQString msg = i18n( "Method requires 1 or 2 arguments, received %1." ).arg( args.size() ); + TTQString msg = i18n( "Method retquires 1 or 2 arguments, received %1." ).arg( args.size() ); return throwError(exec, msg); } } @@ -109,45 +109,45 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ } else if ( id == MethodReadLine ) { - TQString line = conin()->readLine(); + TTQString line = conin()->readLine(); if ( !line.isNull() ) return KJS::String( line ); } else if ( id == MethodOpenFile ) { // #warning "This is leaked!!!!!" -// TQFile *f=new TQFile( arg0 ); +// TTQFile *f=new TTQFile( arg0 ); // int mode = 0; -// if ( arg1 == TQString("ro") ) +// if ( arg1 == TTQString("ro") ) // mode = IO_ReadOnly; -// else if ( arg1 == TQString("wo") ) +// else if ( arg1 == TTQString("wo") ) // mode = IO_WriteOnly; // if ( !f->open( mode ) ) // return KJS::Boolean(false); -// Bindings::TextStream *ts = new Bindings::TextStream( part, "file", new TQTextStream(f) ); +// Bindings::TextStream *ts = new Bindings::TextStream( part, "file", new TTQTextStream(f) ); // return KJS::Object( ts ); return KJS::Null(); } else if ( id == MethodReadFile ) { - TQFile f( arg0 ); + TTQFile f( arg0 ); if ( !f.open( IO_ReadOnly ) ) { - TQString msg = i18n( "Could not open file '%1'." ).arg(arg0); + TTQString msg = i18n( "Could not open file '%1'." ).arg(arg0); return throwError(exec, msg); } - TQString s = f.readAll(); + TTQString s = f.readAll(); return KJS::String( s ); } else if ( id == MethodWriteFile ) { - TQFile f( arg0 ); + TTQFile f( arg0 ); if ( !f.open( IO_WriteOnly ) ) return KJS::Boolean( false ); - TQTextStream ts( &f ); + TTQTextStream ts( &f ); ts << arg1; return KJS::Boolean( true ); @@ -171,16 +171,16 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ } else if ( id == MethodSaxLoadFile ) { if ( args.size() != 2 ) { - TQString msg = i18n( "Method requires 2 arguments, received %1." ).arg( args.size() ); + TTQString msg = i18n( "Method retquires 2 arguments, received %1." ).arg( args.size() ); return throwError(exec, msg); } BuiltIns::SaxHandler sax( exec ); sax.setHandler( args[0].toObject(exec) ); - TQFile f( arg1 ); - TQXmlInputSource src( &f ); - TQXmlSimpleReader reader; + TTQFile f( arg1 ); + TTQXmlInputSource src( &f ); + TTQXmlSimpleReader reader; reader.setContentHandler( &sax ); bool ok = reader.parse( src ); @@ -193,11 +193,11 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ else if ( id == MethodDumpCompletion ) { KJS::Object obj = obj.isValid() ? args[0].toObject(exec) : KJS::Object(); if ( !obj.isValid() ) { - TQString msg = i18n( "Method requires an object." ); + TTQString msg = i18n( "Method retquires an object." ); return throwError(exec, msg,KJS::TypeError); } - TQVariant v = dumpCompletion( exec, obj ); + TTQVariant v = dumpCompletion( exec, obj ); return convertToValue( exec, v ); // FIXME: This will crash if the type is wrong } else if ( id == MethodAlert ) { @@ -205,7 +205,7 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ #ifndef QT_ONLY KMessageBox::information( 0L, arg0 ); #else // QT_ONLY - TQMessageBox::information( 0L, i18n("Information"), arg0 ); + TTQMessageBox::information( 0L, i18n("Information"), arg0 ); #endif // QT_ONLY return KJS::Undefined(); @@ -216,24 +216,24 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ #ifndef QT_ONLY answer = KMessageBox::questionYesNo( 0L, arg0 ); #else // QT_ONLY - answer = TQMessageBox::question(0L, i18n("Question"), arg0 ); + answer = TTQMessageBox::question(0L, i18n("Question"), arg0 ); #endif // QT_ONLY return KJS::Number( answer ); } else if ( id == MethodPrompt ) { - TQString text; + TTQString text; #ifndef QT_ONLY text = KInputDialog::getText( arg0, arg0, arg1 ); #else // QT_ONLY - text = QInputDialog::getText( arg0, arg0, TQLineEdit::Normal, arg1 ); + text = TQInputDialog::getText( arg0, arg0, TTQLineEdit::Normal, arg1 ); #endif // QT_ONLY return KJS::String( text ); } else if ( id == MethodI18n ) { - TQString retString(i18n(arg0.latin1())); + TTQString retString(i18n(arg0.latin1())); return KJS::String( retString ); } else if ( id == MethodImport ) { @@ -242,11 +242,11 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ // Scan $KDEDIRS/share/apps/$APPNAME/ // Scan $KDEDIRS/share/apps/kjsembed/ KGlobal::dirs()->addResourceType("kjsembed", KStandardDirs::kde_default("data") +"/kjsembed/"); - TQString fname = KGlobal::dirs ()->findResource ("kjsembed", TQString(arg0)); + TTQString fname = KGlobal::dirs ()->findResource ("kjsembed", TTQString(arg0)); kdDebug(80001) << "Loading: " << fname << endl; - //TQString code = part->loadFile(fname); + //TTQString code = part->loadFile(fname); return KJS::Boolean( part->runFile(fname, part->globalObject())); #else // QT_ONLY @@ -269,7 +269,7 @@ KJS::Value JSBuiltInImp::call( KJS::ExecState *exec, KJS::Object &self, const KJ kdWarning() << "JSBuiltInImp has no method " << id << endl; } - TQString msg = i18n( "JSBuiltInImp has no method with id '%1'." ).arg( id ); + TTQString msg = i18n( "JSBuiltInImp has no method with id '%1'." ).arg( id ); return throwError(exec, msg,KJS::ReferenceError); } -- cgit v1.2.3