diff options
Diffstat (limited to 'kjsembed/kjsembedpart.cpp')
-rw-r--r-- | kjsembed/kjsembedpart.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/kjsembed/kjsembedpart.cpp b/kjsembed/kjsembedpart.cpp index 319bfde8..b39b8813 100644 --- a/kjsembed/kjsembedpart.cpp +++ b/kjsembed/kjsembedpart.cpp @@ -21,12 +21,12 @@ #include <string.h> #include <errno.h> -#include <qobject.h> -#include <qdialog.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qwidget.h> -#include <qwidgetfactory.h> +#include <tqobject.h> +#include <tqdialog.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqwidget.h> +#include <tqwidgetfactory.h> #ifndef QT_ONLY #include <kaction.h> @@ -89,7 +89,7 @@ namespace KJSEmbed { // KPart // -KJSEmbedPart::KJSEmbedPart( QObject *parent, const char *name ) +KJSEmbedPart::KJSEmbedPart( TQObject *parent, const char *name ) : KParts::ReadOnlyPart( parent, name ? name : "kjsembed_part" ), jsConsole(0), jsfactory(0), widgetparent(0), widgetname(name ? name : "kjsembed_part"), deletejs(false) @@ -99,7 +99,7 @@ KJSEmbedPart::KJSEmbedPart( QObject *parent, const char *name ) createActionClient(); } -KJSEmbedPart::KJSEmbedPart( QWidget *wparent, const char *wname, QObject *parent, const char *name ) +KJSEmbedPart::KJSEmbedPart( TQWidget *wparent, const char *wname, TQObject *parent, const char *name ) : KParts::ReadOnlyPart( parent, name ? name : (wname?wname:"jsembed_part") ), jsConsole(0), jsfactory(0), widgetparent(wparent), widgetname(wname), deletejs(false) @@ -109,8 +109,8 @@ KJSEmbedPart::KJSEmbedPart( QWidget *wparent, const char *wname, QObject *parent createActionClient(); } -KJSEmbedPart::KJSEmbedPart( KJS::Interpreter *jsi, QWidget *wparent, const char *wname, - QObject *parent, const char *name ) +KJSEmbedPart::KJSEmbedPart( KJS::Interpreter *jsi, TQWidget *wparent, const char *wname, + TQObject *parent, const char *name ) : KParts::ReadOnlyPart( parent, name ? name : (wname?wname:"jsembed_part") ), jsConsole(0), jsfactory(0), builtins(0), widgetparent(wparent), widgetname(wname), js(jsi), deletejs(false) @@ -161,7 +161,7 @@ JSConsoleWidget *KJSEmbedPart::view() { #ifndef QT_ONLY if ( !jsConsole ) { - QCString name = widgetname ? widgetname : QCString("jsembed_console"); + TQCString name = widgetname ? widgetname : TQCString("jsembed_console"); jsConsole = new JSConsoleWidget( this, widgetparent, name ); setWidget( jsConsole ); jsfactory->addType( jsConsole->className() ); @@ -171,9 +171,9 @@ JSConsoleWidget *KJSEmbedPart::view() return 0L; } -QStringList KJSEmbedPart::constructorNames() const +TQStringList KJSEmbedPart::constructorNames() const { - QStringList classes; + TQStringList classes; KJS::List cons = constructorList(); KJS::ListIterator it = cons.begin(); @@ -224,9 +224,9 @@ KJS::List KJSEmbedPart::constructorList() const // Version information // -QCString KJSEmbedPart::versionString() const +TQCString KJSEmbedPart::versionString() const { - return QCString(KJSEMBED_VERSION_STRING); + return TQCString(KJSEMBED_VERSION_STRING); } int KJSEmbedPart::versionMajor() const @@ -243,7 +243,7 @@ int KJSEmbedPart::versionMinor() const // Execute a JS script. // -KJS::Value KJSEmbedPart::evaluate( const QString &script, const KJS::Value &self ) +KJS::Value KJSEmbedPart::evaluate( const TQString &script, const KJS::Value &self ) { if ( execute( res, script, self ) ) return res.value(); @@ -251,12 +251,12 @@ KJS::Value KJSEmbedPart::evaluate( const QString &script, const KJS::Value &self return KJS::Null(); } -bool KJSEmbedPart::execute( const QString &script, const KJS::Value &self ) +bool KJSEmbedPart::execute( const TQString &script, const KJS::Value &self ) { return execute( res, script, self ); } -bool KJSEmbedPart::execute( KJS::Completion &result, const QString &script, const KJS::Value &self ) +bool KJSEmbedPart::execute( KJS::Completion &result, const TQString &script, const KJS::Value &self ) { KJS::Value val( self ); result = js->evaluate( script, self.isNull() ? partobj : val ); @@ -269,13 +269,13 @@ bool KJSEmbedPart::openURL( const KURL &url ) // kdDebug(80001) << "KJSEmbedPart: openURL '" << url.url() << "' is javascript" << endl; #ifndef QT_ONLY - QString cmd = url.url(); + TQString cmd = url.url(); #else - QString cmd = url.toString(); + TQString cmd = url.toString(); #endif - QString js( "javascript:" ); - cmd = cmd.replace( 0, js.length(), QString("") ); + TQString js( "javascript:" ); + cmd = cmd.replace( 0, js.length(), TQString("") ); // kdDebug(80001) << "KJSEmbedPart: JS command is '" << cmd << "'" << endl; return execute( cmd ); @@ -287,14 +287,14 @@ bool KJSEmbedPart::openURL( const KURL &url ) // Invoke a script file. // -bool KJSEmbedPart::runFile( const QString &name, const KJS::Value &self ) +bool KJSEmbedPart::runFile( const TQString &name, const KJS::Value &self ) { kdDebug(80001) << "KJSEmbedPart::runFile(): file is '" << name << "'" << endl; - QString script = loadFile( name ); + TQString script = loadFile( name ); return execute( script, self ); } -bool KJSEmbedPart::loadActionSet( const QString &file ) +bool KJSEmbedPart::loadActionSet( const TQString &file ) { #ifndef QT_ONLY return xmlclient->load( file ); @@ -304,23 +304,23 @@ bool KJSEmbedPart::loadActionSet( const QString &file ) #endif // QT_ONLY } -QString KJSEmbedPart::loadFile( const QString &src ) +TQString KJSEmbedPart::loadFile( const TQString &src ) { - QString script; + TQString script; if ( src == "-" ) { - QTextStream ts( stdin, IO_ReadOnly ); + TQTextStream ts( stdin, IO_ReadOnly ); script = ts.read(); } else { - QFile file( src ); + TQFile file( src ); if ( file.open( IO_ReadOnly ) ) { - script = QString( file.readAll() ); + script = TQString( file.readAll() ); } else { kdWarning() << "Could not open file '" << src << "', " << strerror( errno ) << endl; - return QString::null; + return TQString::null; } } @@ -337,14 +337,14 @@ QString KJSEmbedPart::loadFile( const QString &src ) // Publishing objects. // -KJS::Object KJSEmbedPart::bind( QObject *obj ) +KJS::Object KJSEmbedPart::bind( TQObject *obj ) { KJS::Object jsobj = jsfactory->createProxy( js->globalExec(), obj ); JSProxy::toObjectProxy(jsobj.imp() )->setOwner(JSProxy::Native); return jsobj; } -KJS::Object KJSEmbedPart::addObject( QObject *obj, KJS::Object &parent, const char *name ) +KJS::Object KJSEmbedPart::addObject( TQObject *obj, KJS::Object &parent, const char *name ) { KJS::Object jsobj = bind( obj ); parent.put( js->globalExec(), name ? name : obj->name(), jsobj ); @@ -352,7 +352,7 @@ KJS::Object KJSEmbedPart::addObject( QObject *obj, KJS::Object &parent, const ch return jsobj; } -KJS::Object KJSEmbedPart::addObject( QObject *obj, const char *name ) +KJS::Object KJSEmbedPart::addObject( TQObject *obj, const char *name ) { return addObject( obj, js->globalObject(), name ); } @@ -362,10 +362,10 @@ void KJSEmbedPart::virtual_hook( int /*id*/, void * /*data*/ ) } -static KJS::Object scopeWalker( KJS::ExecState *exec, const KJS::Object &root, const QString &objectString ) +static KJS::Object scopeWalker( KJS::ExecState *exec, const KJS::Object &root, const TQString &objectString ) { KJS::Object returnObject = root; - QStringList objects = QStringList::split(".", objectString); + TQStringList objects = TQStringList::split(".", objectString); for( uint idx = 0; idx < objects.count(); ++idx) { KJS::Identifier id = KJS::Identifier( KJS::UString( objects[idx] )); @@ -376,7 +376,7 @@ static KJS::Object scopeWalker( KJS::ExecState *exec, const KJS::Object &root, c return returnObject; } -KJS::Value KJSEmbedPart::callMethod( const QString & methodName, const KJS::List & args ) const +KJS::Value KJSEmbedPart::callMethod( const TQString & methodName, const KJS::List & args ) const { KJS::ExecState *exec = js->globalExec(); KJS::Identifier id = KJS::Identifier( KJS::UString(methodName.latin1() )); @@ -406,7 +406,7 @@ KJS::Value KJSEmbedPart::callMethod( const QString & methodName, const KJS::List return retValue; } -KJS::Value KJSEmbedPart::getValue( const QString & valueName ) const +KJS::Value KJSEmbedPart::getValue( const TQString & valueName ) const { KJS::ExecState *exec = js->globalExec(); KJS::Identifier id = KJS::Identifier( KJS::UString(valueName.latin1() )); @@ -414,7 +414,7 @@ KJS::Value KJSEmbedPart::getValue( const QString & valueName ) const return obj.get(exec, id ); } -void KJSEmbedPart::putValue( const QString & valueName, const KJS::Value & value ) +void KJSEmbedPart::putValue( const TQString & valueName, const KJS::Value & value ) { KJS::ExecState *exec = js->globalExec(); KJS::Identifier id = KJS::Identifier( KJS::UString(valueName.latin1() )); @@ -422,18 +422,18 @@ void KJSEmbedPart::putValue( const QString & valueName, const KJS::Value & value obj.put(exec, id, value); } -void KJSEmbedPart::putVariant( const QString & valueName, const QVariant & value ) +void KJSEmbedPart::putVariant( const TQString & valueName, const TQVariant & value ) { KJS::Value val = convertToValue( js->globalExec(), value); putValue( valueName, val ); } -QVariant KJSEmbedPart::getVariant( const QString & valueName ) const +TQVariant KJSEmbedPart::getVariant( const TQString & valueName ) const { return convertToVariant( js->globalExec(), getValue( valueName ) ); } -bool KJSEmbedPart::hasMethod( const QString & methodName ) +bool KJSEmbedPart::hasMethod( const TQString & methodName ) { KJS::ExecState *exec = js->globalExec(); KJS::Identifier id = KJS::Identifier( KJS::UString(methodName.latin1() )); |