diff options
Diffstat (limited to 'kjsembed/xmlactionclient.cpp')
-rw-r--r-- | kjsembed/xmlactionclient.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kjsembed/xmlactionclient.cpp b/kjsembed/xmlactionclient.cpp index 390d5fd2..d2394a92 100644 --- a/kjsembed/xmlactionclient.cpp +++ b/kjsembed/xmlactionclient.cpp @@ -31,27 +31,27 @@ namespace KJSEmbed { // XML Tags and Attributes // -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" ); +TTQString tag_header("header"); +TTQString tag_action("action"); +TTQString tag_type( "type" ); +TTQString tag_label( "label" ); +TTQString tag_icons( "icons" ); +TTQString tag_shortcut( "shortcut" ); +TTQString tag_name( "name" ); +TTQString tag_group( "group" ); +TTQString tag_text( "text" ); +TTQString tag_statustext( "statustext" ); +TTQString tag_whatsthis( "whatsthis" ); +TTQString tag_script( "script" ); +TTQString tag_data( "data" ); +TTQString tag_item( "item" ); + +TTQString attr_type( "type" ); +TTQString attr_src( "src" ); +TTQString attr_exclusive( "exclusive" ); + +TTQString type_include( "include" ); +TTQString type_debug( "debug" ); // // Default Runner @@ -77,8 +77,8 @@ bool XMLActionRunner::run( XMLActionClient *client, const XMLActionClient::XMLAc // Main Client Class // -XMLActionClient::XMLActionClient( TQObject *parent, const char *name ) - : TQObject( parent, name ? name : "XMLActionClient" ), +XMLActionClient::XMLActionClient( TTQObject *parent, const char *name ) + : TTQObject( parent, name ? name : "XMLActionClient" ), ac(0), actrun(0) { } @@ -87,18 +87,18 @@ XMLActionClient::~XMLActionClient() { } -bool XMLActionClient::load( const TQString &filename ) +bool XMLActionClient::load( const TTQString &filename ) { XMLActionHandler h( this ); return load( &h, filename ); } -bool XMLActionClient::load( XMLActionHandler *hand, const TQString &filename ) +bool XMLActionClient::load( XMLActionHandler *hand, const TTQString &filename ) { - TQFile f( filename ); - TQXmlInputSource src( &f ); + TTQFile f( filename ); + TTQXmlInputSource src( &f ); - TQXmlSimpleReader reader; + TTQXmlSimpleReader reader; reader.setContentHandler( hand ); bool ok = reader.parse( src ); if ( !ok ) { @@ -108,7 +108,7 @@ bool XMLActionClient::load( XMLActionHandler *hand, const TQString &filename ) return ok; } -bool XMLActionClient::bind( const TQString &name, const XMLActionScript &s ) +bool XMLActionClient::bind( const TTQString &name, const XMLActionScript &s ) { // kdWarning() << "Runner:bind called, name=" << name << " type=" << s.type // << " text=" << s.text << " src=" << s.src << endl; @@ -129,7 +129,7 @@ bool XMLActionClient::bind( KAction *act, const XMLActionScript &s ) return bind( act->name(), s ); } -bool XMLActionClient::run( const TQString &name ) +bool XMLActionClient::run( const TTQString &name ) { if ( scripts.contains( name ) ) return run( scripts[name] ); @@ -149,7 +149,7 @@ bool XMLActionClient::run( const XMLActionScript &s ) void XMLActionClient::action_activated() { - const TQObject *sender = TQObject::sender(); + const TTQObject *sender = TTQObject::sender(); if ( !sender ) return; @@ -161,29 +161,29 @@ void XMLActionClient::action_activated() // XMLActionHandler::XMLActionHandler( XMLActionClient *client ) - : TQXmlDefaultHandler(), actclient( client ) + : TTQXmlDefaultHandler(), actclient( client ) { } -bool XMLActionHandler::characters( const TQString &chars ) +bool XMLActionHandler::characters( const TTQString &chars ) { cdata = cdata + chars; return true; } -bool XMLActionHandler::startElement( const TQString &, const TQString &, const TQString &qn, - const TQXmlAttributes &attrs ) +bool XMLActionHandler::startElement( const TTQString &, const TTQString &, const TTQString &qn, + const TTQXmlAttributes &attrs ) { - cdata = TQString::null; + cdata = TTQString::null; if ( qn == tag_script ) { ad.script.type = attrs.value( attr_type ); ad.script.src = attrs.value( attr_src ); } else if ( qn == tag_group ) { - TQString ex = attrs.value( attr_exclusive ); - if ( ex == TQString("true") ) + TTQString ex = attrs.value( attr_exclusive ); + if ( ex == TTQString("true") ) ad.exclusive = true; } else if ( qn == tag_action ) @@ -192,7 +192,7 @@ bool XMLActionHandler::startElement( const TQString &, const TQString &, const T return true; } -bool XMLActionHandler::endElement( const TQString &, const TQString &, const TQString &qn ) +bool XMLActionHandler::endElement( const TTQString &, const TTQString &, const TTQString &qn ) { if ( qn == tag_action ) { defineAction(); @@ -200,49 +200,49 @@ bool XMLActionHandler::endElement( const TQString &, const TQString &, const TQS } else if ( qn == tag_type ) { ad.type = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_label ) { ad.text = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_text ) { // Nothing } else if ( qn == tag_icons ) { ad.icons = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_shortcut ) { ad.keys = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_name ) { ad.name = cdata.latin1(); - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_group ) { ad.group = cdata.latin1(); - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_whatsthis ) { ad.whatsthis = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_statustext ) { ad.status = cdata; - cdata = TQString::null; + cdata = TTQString::null; } else if ( qn == tag_script ) { ad.script.text = cdata; - cdata = TQString::null; + cdata = TTQString::null; if ( !inAction && ad.script.isValid() ) actclient->run( ad.script ); } else if ( qn == tag_item ) { ad.items += cdata; - cdata = TQString::null; + cdata = TTQString::null; } return true; @@ -263,7 +263,7 @@ void XMLActionHandler::defineAction() actclient->bind( act, ad.script ); ad.clear(); - cdata = TQString::null; + cdata = TTQString::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 ( TQStringList::Iterator it = ad.items.begin() ; it != ad.items.end() ; ++it ) { + for ( TTQStringList::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 ); - TQObject::connect( actclient, TQT_SIGNAL( destroyed() ), act, TQT_SLOT( deleteLater() ) ); + TTQObject::connect( actclient, TQT_SIGNAL( destroyed() ), act, TQT_SLOT( deleteLater() ) ); return act; } |