From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kjsembed/xmlactionclient.cpp | 108 +++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'kjsembed/xmlactionclient.cpp') diff --git a/kjsembed/xmlactionclient.cpp b/kjsembed/xmlactionclient.cpp index eb470f3d..390d5fd2 100644 --- a/kjsembed/xmlactionclient.cpp +++ b/kjsembed/xmlactionclient.cpp @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include @@ -31,27 +31,27 @@ namespace KJSEmbed { // XML Tags and Attributes // -QString tag_header("header"); -QString tag_action("action"); -QString tag_type( "type" ); -QString tag_label( "label" ); -QString tag_icons( "icons" ); -QString tag_shortcut( "shortcut" ); -QString tag_name( "name" ); -QString tag_group( "group" ); -QString tag_text( "text" ); -QString tag_statustext( "statustext" ); -QString tag_whatsthis( "whatsthis" ); -QString tag_script( "script" ); -QString tag_data( "data" ); -QString tag_item( "item" ); - -QString attr_type( "type" ); -QString attr_src( "src" ); -QString attr_exclusive( "exclusive" ); - -QString type_include( "include" ); -QString type_debug( "debug" ); +TQString tag_header("header"); +TQString tag_action("action"); +TQString tag_type( "type" ); +TQString tag_label( "label" ); +TQString tag_icons( "icons" ); +TQString tag_shortcut( "shortcut" ); +TQString tag_name( "name" ); +TQString tag_group( "group" ); +TQString tag_text( "text" ); +TQString tag_statustext( "statustext" ); +TQString tag_whatsthis( "whatsthis" ); +TQString tag_script( "script" ); +TQString tag_data( "data" ); +TQString tag_item( "item" ); + +TQString attr_type( "type" ); +TQString attr_src( "src" ); +TQString attr_exclusive( "exclusive" ); + +TQString type_include( "include" ); +TQString type_debug( "debug" ); // // Default Runner @@ -77,8 +77,8 @@ bool XMLActionRunner::run( XMLActionClient *client, const XMLActionClient::XMLAc // Main Client Class // -XMLActionClient::XMLActionClient( QObject *parent, const char *name ) - : QObject( parent, name ? name : "XMLActionClient" ), +XMLActionClient::XMLActionClient( TQObject *parent, const char *name ) + : TQObject( parent, name ? name : "XMLActionClient" ), ac(0), actrun(0) { } @@ -87,18 +87,18 @@ XMLActionClient::~XMLActionClient() { } -bool XMLActionClient::load( const QString &filename ) +bool XMLActionClient::load( const TQString &filename ) { XMLActionHandler h( this ); return load( &h, filename ); } -bool XMLActionClient::load( XMLActionHandler *hand, const QString &filename ) +bool XMLActionClient::load( XMLActionHandler *hand, const TQString &filename ) { - QFile f( filename ); - QXmlInputSource src( &f ); + TQFile f( filename ); + TQXmlInputSource src( &f ); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler( hand ); bool ok = reader.parse( src ); if ( !ok ) { @@ -108,7 +108,7 @@ bool XMLActionClient::load( XMLActionHandler *hand, const QString &filename ) return ok; } -bool XMLActionClient::bind( const QString &name, const XMLActionScript &s ) +bool XMLActionClient::bind( const TQString &name, const XMLActionScript &s ) { // kdWarning() << "Runner:bind called, name=" << name << " type=" << s.type // << " text=" << s.text << " src=" << s.src << endl; @@ -125,11 +125,11 @@ bool XMLActionClient::bind( KAction *act, const XMLActionScript &s ) // kdWarning() << "Runner:bind called, action=" << act->name() << " type=" << s.type // << " text=" << s.text << " src=" << s.src << endl; - connect( act, SIGNAL( activated() ), this, SLOT( action_activated() ) ); + connect( act, TQT_SIGNAL( activated() ), this, TQT_SLOT( action_activated() ) ); return bind( act->name(), s ); } -bool XMLActionClient::run( const QString &name ) +bool XMLActionClient::run( const TQString &name ) { if ( scripts.contains( name ) ) return run( scripts[name] ); @@ -149,7 +149,7 @@ bool XMLActionClient::run( const XMLActionScript &s ) void XMLActionClient::action_activated() { - const QObject *sender = QObject::sender(); + const TQObject *sender = TQObject::sender(); if ( !sender ) return; @@ -161,29 +161,29 @@ void XMLActionClient::action_activated() // XMLActionHandler::XMLActionHandler( XMLActionClient *client ) - : QXmlDefaultHandler(), actclient( client ) + : TQXmlDefaultHandler(), actclient( client ) { } -bool XMLActionHandler::characters( const QString &chars ) +bool XMLActionHandler::characters( const TQString &chars ) { cdata = cdata + chars; return true; } -bool XMLActionHandler::startElement( const QString &, const QString &, const QString &qn, - const QXmlAttributes &attrs ) +bool XMLActionHandler::startElement( const TQString &, const TQString &, const TQString &qn, + const TQXmlAttributes &attrs ) { - cdata = QString::null; + cdata = TQString::null; if ( qn == tag_script ) { ad.script.type = attrs.value( attr_type ); ad.script.src = attrs.value( attr_src ); } else if ( qn == tag_group ) { - QString ex = attrs.value( attr_exclusive ); - if ( ex == QString("true") ) + TQString ex = attrs.value( attr_exclusive ); + if ( ex == TQString("true") ) ad.exclusive = true; } else if ( qn == tag_action ) @@ -192,7 +192,7 @@ bool XMLActionHandler::startElement( const QString &, const QString &, const QSt return true; } -bool XMLActionHandler::endElement( const QString &, const QString &, const QString &qn ) +bool XMLActionHandler::endElement( const TQString &, const TQString &, const TQString &qn ) { if ( qn == tag_action ) { defineAction(); @@ -200,49 +200,49 @@ bool XMLActionHandler::endElement( const QString &, const QString &, const QStri } else if ( qn == tag_type ) { ad.type = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_label ) { ad.text = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_text ) { // Nothing } else if ( qn == tag_icons ) { ad.icons = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_shortcut ) { ad.keys = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_name ) { ad.name = cdata.latin1(); - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_group ) { ad.group = cdata.latin1(); - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_whatsthis ) { ad.whatsthis = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_statustext ) { ad.status = cdata; - cdata = QString::null; + cdata = TQString::null; } else if ( qn == tag_script ) { ad.script.text = cdata; - cdata = QString::null; + cdata = TQString::null; if ( !inAction && ad.script.isValid() ) actclient->run( ad.script ); } else if ( qn == tag_item ) { ad.items += cdata; - cdata = QString::null; + cdata = TQString::null; } return true; @@ -263,7 +263,7 @@ void XMLActionHandler::defineAction() actclient->bind( act, ad.script ); ad.clear(); - cdata = QString::null; + cdata = TQString::null; } KAction *XMLActionHandler::createAction( KActionCollection *parent ) @@ -307,7 +307,7 @@ KAction *XMLActionHandler::createAction( KActionCollection *parent ) else if ( ad.type == "KActionMenu" ) { KActionMenu *am = new KActionMenu( ad.text, ad.icons, parent, ad.name.latin1() ); - for ( QStringList::Iterator it = ad.items.begin() ; it != ad.items.end() ; ++it ) { + for ( TQStringList::Iterator it = ad.items.begin() ; it != ad.items.end() ; ++it ) { KAction *a = parent->action( (*it).latin1() ); if ( a ) am->insert( a ); @@ -331,7 +331,7 @@ KAction *XMLActionHandler::createAction( KActionCollection *parent ) act->setStatusText( ad.status ); act->setWhatsThis( ad.whatsthis ); - QObject::connect( actclient, SIGNAL( destroyed() ), act, SLOT( deleteLater() ) ); + TQObject::connect( actclient, TQT_SIGNAL( destroyed() ), act, TQT_SLOT( deleteLater() ) ); return act; } -- cgit v1.2.3