diff options
Diffstat (limited to 'KMFSysTray/kmfiptwatcher.cpp')
-rw-r--r-- | KMFSysTray/kmfiptwatcher.cpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/KMFSysTray/kmfiptwatcher.cpp b/KMFSysTray/kmfiptwatcher.cpp index c2f8c1a..396b3e9 100644 --- a/KMFSysTray/kmfiptwatcher.cpp +++ b/KMFSysTray/kmfiptwatcher.cpp @@ -21,7 +21,7 @@ // QT includes -#include <qtimer.h> +#include <tqtimer.h> // KDE includes #include <kdebug.h> @@ -41,8 +41,8 @@ #include "../core/iptrule.h" #include "../core/iptruleoption.h" -KMFIPTWatcher::KMFIPTWatcher( QObject *parent, const char *name ) - : QObject( parent, name ) { +KMFIPTWatcher::KMFIPTWatcher( TQObject *tqparent, const char *name ) + : TQObject( tqparent, name ) { m_queryExtendedInfo = true; m_doc = new KMFIPTDoc( 0, "iptdoc" ); go(); @@ -54,8 +54,8 @@ KMFIPTWatcher::~KMFIPTWatcher() {} void KMFIPTWatcher::go() { // KMessageBox::information( 0, i18n( "go()" ) ); - m_timer = new QTimer(); - QObject::connect( m_timer, SIGNAL( timeout() ), this, SLOT( timeout() ) ); + m_timer = new TQTimer(); + TQObject::connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeout() ) ); m_timer->start( 3000, false ); } @@ -64,26 +64,26 @@ void KMFIPTWatcher::timeout() { DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); - QString arg = "filter"; + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); + TQString arg = "filter"; stream << arg; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numChainsInTable(QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numChainsInTable(TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { - // KMessageBox::information( 0, i18n( "Error with DCOP: %1" ).arg( kapp->dcopClient() ->appId() ) ); + // KMessageBox::information( 0, i18n( "Error with DCOP: %1" ).tqarg( kapp->dcopClient() ->appId() ) ); emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; - // KMessageBox::information( 0, i18n( "Got answer %1" ).arg(result) ); + // KMessageBox::information( 0, i18n( "Got answer %1" ).tqarg(result) ); emit sigUpdateActive( result > 0 ); } else KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) ); @@ -102,33 +102,33 @@ void KMFIPTWatcher::queryExtendedInfo() { emit sigUpdateIPTDoc( m_doc ); } -void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; +void KMFIPTWatcher::queryChainsInTable( const TQString& table, KMFIPTDoc* iptdoc ) { + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << table; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getChainsInTable(QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getChainsInTable(TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QStringList" ) { - QStringList result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRINGLIST_OBJECT_NAME_STRING ) { + TQStringList result; answer >> result; IPTable *tableObj = iptdoc->table( table ); kdDebug() << "Filling Table: " << tableObj->name() << endl; - QPtrList<IPTChain> *used = new QPtrList<IPTChain>; - for ( QStringList::Iterator it = result.begin(); it != result.end(); ++it ) { + TQPtrList<IPTChain> *used = new TQPtrList<IPTChain>; + for ( TQStringList::Iterator it = result.begin(); it != result.end(); ++it ) { kdDebug() << "Found Chain" << *it << endl; IPTChain *chain = tableObj->chainForName( *it ); if ( ! chain ) { - QString tg = "ACCEPT"; + TQString tg = "ACCEPT"; tableObj->addChain( *it, tg, false, new KMFError() ); } fetchChainPolicy( tableObj->chainForName( *it ) ); @@ -136,12 +136,12 @@ void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc used->append( tableObj->chainForName( *it ) ); } - QPtrListIterator<IPTChain> it_chains( tableObj->chains() ); + TQPtrListIterator<IPTChain> it_chains( tableObj->chains() ); IPTChain* found_chain = 0; while ( it_chains.current() ) { found_chain = it_chains.current(); bool found = false; - for ( QStringList::Iterator it_all = result.begin(); it_all != result.end(); ++it_all ) { + for ( TQStringList::Iterator it_all = result.begin(); it_all != result.end(); ++it_all ) { if ( *it_all == found_chain->name() ) { found = true; } @@ -162,21 +162,21 @@ void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc void KMFIPTWatcher::fetchChainPolicy( IPTChain* chain ) { DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << chain->table()->name() << chain->name(); - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getChainPolicy(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getChainPolicy(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QString" ) { - QString result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRING_OBJECT_NAME_STRING ) { + TQString result; answer >> result; kdDebug() << "Found Chain Policy: " << chain->table()->name() << " " << chain->name() << " " << result << endl; chain->setDefaultTarget( result ); @@ -185,27 +185,27 @@ void KMFIPTWatcher::fetchChainPolicy( IPTChain* chain ) { } void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { - kdDebug() << "fetchRulesInChain( const QString& table, const QString& chain )" << endl; + kdDebug() << "fetchRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << chain->table()->name() << chain->name(); - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numRulesInChain(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numRulesInChain(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; - QPtrList<IPTRule> *used = new QPtrList<IPTRule>; + TQPtrList<IPTRule> *used = new TQPtrList<IPTRule>; for ( int i = 0; i < result; i++ ) { - QString rn = QString("rule_%1").arg( i ); + TQString rn = TQString("rule_%1").tqarg( i ); IPTRule *rule = 0; rule = chain->ruleForName( rn ); if ( ! rule ) { @@ -215,13 +215,13 @@ void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { used->append( rule ); } - QPtrListIterator<IPTRule> it_rules( chain->chainRuleset() ); + TQPtrListIterator<IPTRule> it_rules( chain->chainRuleset() ); IPTRule* found_rule = 0; while ( it_rules.current() ) { found_rule = it_rules.current(); bool found = false; for ( int i = 0; i < result; i++ ) { - QString rn = QString("rule_%1").arg( i ); + TQString rn = TQString("rule_%1").tqarg( i ); if ( rn == found_rule->name() ) { found = true; } @@ -238,23 +238,23 @@ void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { } void KMFIPTWatcher::fetchRulesProperties( IPTRule* rule, int index ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << rule->chain()->table()->name() << rule->chain()->name() << index; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getRuleProperties(QString,QString,int)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getRuleProperties(TQString,TQString,int)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QStringList" ) { - QStringList result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRINGLIST_OBJECT_NAME_STRING ) { + TQStringList result; answer >> result; if ( *result.at( 0 ) == "ERROR" ) { return; @@ -270,22 +270,22 @@ void KMFIPTWatcher::fetchRulesProperties( IPTRule* rule, int index ) { } -void KMFIPTWatcher::queryNumRulesInChain( const QString& table, const QString& chain, KMFIPTDoc* doc ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; +void KMFIPTWatcher::queryNumRulesInChain( const TQString& table, const TQString& chain, KMFIPTDoc* doc ) { + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << table << chain; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numRulesInChain(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numRulesInChain(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; |