diff options
Diffstat (limited to 'kmyfirewall/core')
70 files changed, 2098 insertions, 2089 deletions
diff --git a/kmyfirewall/core/ipaddress.cpp b/kmyfirewall/core/ipaddress.cpp index c8dc147..453d94d 100644 --- a/kmyfirewall/core/ipaddress.cpp +++ b/kmyfirewall/core/ipaddress.cpp @@ -75,7 +75,7 @@ int IPAddress::operator==( const IPAddress& addr ) { } } if ( ident ) - return EQUAL; + return ETQUAL; if ( m_digits[ first_diff ] > addr.getDigit( first_diff ) ) return SMALLER; @@ -95,19 +95,19 @@ bool IPAddress::setAddress( int fi, int se, int th, int fo ) { return true; } -bool IPAddress::setAddress( const QString& input ) { - QString inp = input; +bool IPAddress::setAddress( const TQString& input ) { + TQString inp = input; m_checkInput->checkInput( inp, "IP", m_err ); if ( m_err->errType() != KMFError::OK ) { kdDebug() << "WARNING: Given wron IP address string: " << inp << endl; return false; } int pos; - QString str_num; + TQString str_num; bool valid = true; int counter = 0; while ( !inp.isEmpty() ) { - pos = inp.find( "." ); + pos = inp.tqfind( "." ); if ( pos > -1 ) { str_num = inp.left( pos ); // kdDebug() << "IP Num Part: " << str_num << endl; @@ -141,18 +141,18 @@ bool IPAddress::setAddress( const QString& input ) { return true; } -const QString& IPAddress::toString() const { - QString fi = ""; - QString se = ""; - QString th = ""; - QString fo = ""; - return *( new QString( fi.setNum( m_digits[0] ) + "." + se.setNum( m_digits[1] ) + "." + th.setNum( m_digits[2] ) + "." + fo.setNum( m_digits[3] ) ) ); +const TQString& IPAddress::toString() const { + TQString fi = ""; + TQString se = ""; + TQString th = ""; + TQString fo = ""; + return *( new TQString( fi.setNum( m_digits[0] ) + "." + se.setNum( m_digits[1] ) + "." + th.setNum( m_digits[2] ) + "." + fo.setNum( m_digits[3] ) ) ); } // static stuff IPAddress& IPAddress::calcNetworkMaskFromLength( int len ) { - QValueList<int> list; + TQValueList<int> list; int nextOne = 0; int digit1 = IPAddress::calcLenthToMaskDigit( len, &nextOne ); int digit2 = IPAddress::calcLenthToMaskDigit( nextOne, &nextOne ); @@ -203,14 +203,14 @@ int IPAddress::calcLenthToMask( IPAddress& addr) { } - int mask = 0; + int tqmask = 0; for (int loop=0; loop<4; loop++) { int div = 256; while ( div > 1) { div = div/2; int test = m[loop] - div; if ( test >-1) { - mask=mask+1; + tqmask=tqmask+1; m[loop]=test; } else { break; @@ -218,8 +218,8 @@ int IPAddress::calcLenthToMask( IPAddress& addr) { } } - // kdDebug() << "Returning: " << mask << endl; - return mask; + // kdDebug() << "Returning: " << tqmask << endl; + return tqmask; } bool IPAddress::isValidAddress( IPAddress& addr) { @@ -309,27 +309,27 @@ bool IPAddress::isValidMask( IPAddress& addr) { bool IPAddress::hostsOnSameNetwork( IPAddress& host1, IPAddress& host2, int len ) { // kdDebug() << "IPAddress::hostsOnSameNetwork( IPAddress&, IPAddress&, int )" << endl; - IPAddress mask = IPAddress::calcNetworkMaskFromLength( len ); - return ( IPAddress::hostsOnSameNetwork( host1, host2, mask ) ); + IPAddress tqmask = IPAddress::calcNetworkMaskFromLength( len ); + return ( IPAddress::hostsOnSameNetwork( host1, host2, tqmask ) ); } -bool IPAddress::hostsOnSameNetwork( IPAddress& host1, IPAddress& host2, IPAddress& mask ) { +bool IPAddress::hostsOnSameNetwork( IPAddress& host1, IPAddress& host2, IPAddress& tqmask ) { kdDebug() << "IPAddress::hostsOnSameNetwork( IPAddress&, IPAddress&, int )" << endl; kdDebug() << "Host 1: " << host1.toString() << endl; kdDebug() << "Host 2: " << host2.toString() << endl; - kdDebug() << "Mask: " << mask.toString() << endl; -// IPAddress mask = IPAddress::calcNetworkMaskFromLength( len ); + kdDebug() << "Mask: " << tqmask.toString() << endl; +// IPAddress tqmask = IPAddress::calcNetworkMaskFromLength( len ); - int nOctA1=host1.getDigit(0) & mask.getDigit(0); - int nOctA2=host1.getDigit(1) & mask.getDigit(1); - int nOctA3=host1.getDigit(2) & mask.getDigit(2); - int nOctA4=host1.getDigit(3) & mask.getDigit(3); + int nOctA1=host1.getDigit(0) & tqmask.getDigit(0); + int nOctA2=host1.getDigit(1) & tqmask.getDigit(1); + int nOctA3=host1.getDigit(2) & tqmask.getDigit(2); + int nOctA4=host1.getDigit(3) & tqmask.getDigit(3); - int nOctB1=host2.getDigit(0) & mask.getDigit(0); - int nOctB2=host2.getDigit(1) & mask.getDigit(1); - int nOctB3=host2.getDigit(2) & mask.getDigit(2); - int nOctB4=host2.getDigit(3) & mask.getDigit(3); + int nOctB1=host2.getDigit(0) & tqmask.getDigit(0); + int nOctB2=host2.getDigit(1) & tqmask.getDigit(1); + int nOctB3=host2.getDigit(2) & tqmask.getDigit(2); + int nOctB4=host2.getDigit(3) & tqmask.getDigit(3); if ((nOctA1==nOctB1) && (nOctA2==nOctB2) && (nOctA3==nOctB3) && (nOctA4==nOctB4)) { kdDebug() << "Hosts on same net." << endl; diff --git a/kmyfirewall/core/ipaddress.h b/kmyfirewall/core/ipaddress.h index b9a71cc..9bf8b2c 100644 --- a/kmyfirewall/core/ipaddress.h +++ b/kmyfirewall/core/ipaddress.h @@ -27,8 +27,8 @@ */ // QT includes -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> // KDE includes #include <kdemacros.h> @@ -53,7 +53,7 @@ public: /** Set the address to the address given in the string. Returns false if the address is invalid */ - bool setAddress( const QString& ); + bool setAddress( const TQString& ); IPAddress& plus(int); // FIXME: remove that!!! @@ -64,11 +64,11 @@ public: /** Return the int for the given posintion in the address */ int getDigit( int num ) const; - /** returns a QString holding the address e.g. 123.234.123.234 */ - const QString& toString() const; + /** returns a TQString holding the address e.g. 123.234.123.234 */ + const TQString& toString() const; /** Return values for the comparision operator== */ - enum { EQUAL, BIGGER, SMALLER }; + enum { ETQUAL, BIGGER, SMALLER }; private: int m_digits[ NUMDIGITS ]; @@ -79,25 +79,25 @@ private: // static stuff public: - /** Calculates the netmask from the mask length + /** Calculates the nettqmask from the tqmask length e.g. 255.255.255.0 -> 24 */ - static IPAddress& calcNetworkMaskFromLength( int maskLen ); + static IPAddress& calcNetworkMaskFromLength( int tqmaskLen ); - /** Calculates the given netmask length to the net mask. + /** Calculates the given nettqmask length to the net tqmask. e.g. 24 -> 255.255.255.0 */ static int calcLenthToMask( IPAddress& ); - /** Returns true it the given adddress is a valid net mask */ + /** Returns true it the given adddress is a valid net tqmask */ static bool isValidMask( IPAddress& ); - /** Returns true it the given adddress is a valid net mask */ + /** Returns true it the given adddress is a valid net tqmask */ static bool isValidAddress( IPAddress& ); /** Checks if the the addresses are on the same network. */ - static bool hostsOnSameNetwork( IPAddress&, IPAddress&, int maskLen ); + static bool hostsOnSameNetwork( IPAddress&, IPAddress&, int tqmaskLen ); /** Checks if the the addresses are on the same network. */ - static bool hostsOnSameNetwork( IPAddress&, IPAddress&, IPAddress& mask ); + static bool hostsOnSameNetwork( IPAddress&, IPAddress&, IPAddress& tqmask ); private: private: static int calcLenthToMaskDigit( int nMask, int *nextOne ); diff --git a/kmyfirewall/core/iptable.cpp b/kmyfirewall/core/iptable.cpp index de54f34..650d723 100644 --- a/kmyfirewall/core/iptable.cpp +++ b/kmyfirewall/core/iptable.cpp @@ -16,8 +16,8 @@ email : chubinger@irrsinnig.org #include "iptable.h" // qt includes -#include <qstring.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqregexp.h> // kde includes #include <kdebug.h> @@ -32,8 +32,8 @@ email : chubinger@irrsinnig.org namespace KMF { -IPTable::IPTable( KMFIPTDoc* doc, const char* name, const QString& tableName ) : NetfilterObject( doc, name ) { - // kdDebug() << "IPTable::IPTable(QString& name)" << endl; +IPTable::IPTable( KMFIPTDoc* doc, const char* name, const TQString& tableName ) : NetfilterObject( doc, name ) { + // kdDebug() << "IPTable::IPTable(TQString& name)" << endl; kmfdoc = doc; // m_object_type = NetfilterObject::TABLE; m_err = new KMFError(); @@ -57,7 +57,7 @@ void IPTable::clear() { } void IPTable::reset() { // kdDebug() << "void IPTable::resetTable()" << endl; - QPtrListIterator<IPTChain> it ( m_chains ); + TQPtrListIterator<IPTChain> it ( m_chains ); while ( it.current() ) { IPTChain* chain = it.current(); if ( chain->isBuildIn() ) { @@ -72,7 +72,7 @@ void IPTable::reset() { void IPTable::settupDefaultChains() { // kdDebug() << "void IPTable::settupDefaultChains()" << endl; - QString target = "ACCEPT"; + TQString target = "ACCEPT"; IPTChain* chain = 0; if ( name() == Constants::FilterTable_Name ) { @@ -150,7 +150,7 @@ void IPTable::settupDefaultChains() { } -IPTChain* IPTable::chainForName( const QString& name ) { +IPTChain* IPTable::chainForName( const TQString& name ) { IPTChain * tmp_chain; for ( tmp_chain = m_chains.first();tmp_chain; tmp_chain = m_chains.next() ) { if ( tmp_chain->name() == name ) @@ -159,7 +159,7 @@ IPTChain* IPTable::chainForName( const QString& name ) { return 0; } -IPTChain* IPTable::chainForUuid( const QUuid& id ) { +IPTChain* IPTable::chainForUuid( const TQUuid& id ) { IPTChain * tmp_chain; for ( tmp_chain = m_chains.first(); tmp_chain; tmp_chain = m_chains.next() ) { if ( tmp_chain->uuid() == id ) @@ -168,28 +168,28 @@ IPTChain* IPTable::chainForUuid( const QUuid& id ) { return 0; } -QPtrList<IPTChain>& IPTable::chains() const { - QPtrList<IPTChain>* ret_val = new QPtrList<IPTChain>; +TQPtrList<IPTChain>& IPTable::chains() const { + TQPtrList<IPTChain>* ret_val = new TQPtrList<IPTChain>; *ret_val = m_chains; return *ret_val; } -IPTChain* IPTable::addChain( const QString& chain_name, const QString& chain_target, bool builtin, KMFError *err ) { - // kdDebug() << "KMFError* IPTable::addChain( QString& chain_name,QString& chain_table,QString& chain_target,bool builtin )" << endl; +IPTChain* IPTable::addChain( const TQString& chain_name, const TQString& chain_target, bool builtin, KMFError *err ) { + // kdDebug() << "KMFError* IPTable::addChain( TQString& chain_name,TQString& chain_table,TQString& chain_target,bool builtin )" << endl; KMFCheckInput* check = new KMFCheckInput(); check->checkInput( chain_name, "CHAINNAME", err ); if ( err->errNum() != 0 ) { return 0; } - QPtrListIterator<IPTChain> it ( m_chains ); + TQPtrListIterator<IPTChain> it ( m_chains ); while ( it.current() ) { IPTChain* tmp_chain = it.current(); ++it; - QString found_name = tmp_chain->name(); + TQString found_name = tmp_chain->name(); if ( found_name == chain_name ) { - const QString msg = i18n( "<qt><p>Chain: <b>%1</b> already exists in table: <b>%2</b>.<br>" - "Please try again with another name. A chain name must be unique in a table.</p></qt>" ).arg( found_name ).arg( name() ); + const TQString msg = i18n( "<qt><p>Chain: <b>%1</b> already exists in table: <b>%2</b>.<br>" + "Please try again with another name. A chain name must be unique in a table.</p></qt>" ).tqarg( found_name ).tqarg( name() ); err->setErrType( KMFError::NORMAL ); err->setErrMsg( msg ); kdDebug() << "\n\nWARNING: Couldn't add chain because of dupilcate name\n\n" << endl; @@ -198,7 +198,7 @@ IPTChain* IPTable::addChain( const QString& chain_name, const QString& chain_tar } IPTChain * chain = new IPTChain( this, chain_name.latin1(), chain_name, builtin ); - if ( builtin && chain_target != QString::null ) + if ( builtin && chain_target != TQString() ) chain->setDefaultTarget( chain_target ); // kdDebug() << "Adding Chain: " << chain->name() << endl; m_chains.append( chain ); @@ -210,18 +210,18 @@ IPTChain* IPTable::addChain( const QString& chain_name, const QString& chain_tar KMFError* IPTable::delChain( IPTChain *chain ) { // kdDebug() << "KMFError* IPTable::delChain( IPTChain *chain )" << endl; m_err = new KMFError(); - QString name = chain->name(); + TQString name = chain->name(); if ( chain->isBuildIn() ) { - const QString msg = i18n( "Cannot delete built-in chain: %1" ).arg( name ); + const TQString msg = i18n( "Cannot delete built-in chain: %1" ).tqarg( name ); m_err->setErrMsg( msg ); m_err->setErrType( KMFError::NORMAL ); return m_err; } - int index = m_chains.find( chain ); + int index = m_chains.tqfind( chain ); // kdDebug() << "fount chain nr: " << index << endl; if ( index < 0 ) { chain->deleteLater(); - const QString msg = i18n( "Cannot delete nonexistent chain" ); + const TQString msg = i18n( "Cannot delete nonexistent chain" ); m_err->setErrMsg( msg ); m_err->setErrType( KMFError::NORMAL ); @@ -229,7 +229,7 @@ KMFError* IPTable::delChain( IPTChain *chain ) { } else { m_chains.remove( index ); chain->deleteLater(); - const QString msg = ""; + const TQString msg = ""; m_err->setErrMsg( msg ); m_err->setErrType( KMFError::OK ); changed(); @@ -241,21 +241,21 @@ KMFError* IPTable::moveRuleToChain( IPTRule* rule, IPTChain *target_chain ) { // kdDebug() << "KMFError* IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain )" << endl; if ( rule == 0 ) { m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" + const TQString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" "rule == 0. This is a bug." ); m_err->setErrMsg( msg ); return m_err; } if ( target_chain == 0 ) { m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" + const TQString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" "target_chain == 0. This is a bug." ); m_err->setErrMsg( msg ); return m_err; } // kdDebug() << "Move Rule: " << rule->name() <<" from Chain: " << rule->chain() ->name() << "to chain" << target_chain->name() << endl; - IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).arg( rule->name() ), m_err ); + IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).tqarg( rule->name() ), m_err ); if ( m_err->errNum() == 0 ) { rule->createRuleClone( new_rule ); IPTRule* ru = rule; @@ -268,36 +268,36 @@ KMFError* IPTable::copyRuleToChain( IPTRule* rule, IPTChain *target_chain ) { // kdDebug() << "KMFError* IPTable::copyRuleToChain(IPTRule* rule, IPTChain *target_chain )" << endl; if ( rule == 0 ) { m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" + const TQString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" "rule == 0. This is a bug " ); m_err->setErrMsg( msg ); return m_err; } if ( target_chain == 0 ) { m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" + const TQString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain" "target_chain == 0. This is a bug " ); m_err->setErrMsg( msg ); return m_err; } // kdDebug() << "Copy Rule: " << rule->name() << " from Chain: " << rule->chain() ->name() << "to chain" << target_chain->name() << endl; - IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).arg( rule->name() ), m_err ); + IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).tqarg( rule->name() ), m_err ); if ( m_err->errNum() == 0 ) { rule->createRuleClone( new_rule ); } return m_err; } -const QDomDocument& IPTable::getDOMTree() { - // kdDebug() << "const QString& IPTChain::getIDOMree( )" << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::Table_Element ); +const TQDomDocument& IPTable::getDOMTree() { + // kdDebug() << "const TQString& IPTChain::getIDOMree( )" << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::Table_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Name_Attribute, name() ); root.setAttribute( XML::Description_Attribute, description() ); - QPtrListIterator<IPTChain> it ( m_chains ); + TQPtrListIterator<IPTChain> it ( m_chains ); IPTChain *chain = 0; while ( ( chain = it.current() ) != 0 ) { ++it; @@ -309,36 +309,36 @@ const QDomDocument& IPTable::getDOMTree() { } } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void IPTable::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void IPTable::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void IPTable::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void IPTable::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void IPTable::loadXML( QDomNode root, QStringList& errors ) { +void IPTable::loadXML( TQDomNode root, TQStringList& errors ) { setName( name() ); NetfilterObject::loadUuid ( root, errors ); -// QDomElement root = doc.documentElement(); - QDomNode curr = root.firstChild(); - QPtrList<IPTChain> used_chains; +// TQDomElement root = doc.documentElement(); + TQDomNode curr = root.firstChild(); + TQPtrList<IPTChain> used_chains; while ( !curr.isNull() ) { // kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::Chain_Element ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); - QString uuid = curr.toElement().attribute( XML::Uuid_Attribute ); - QUuid chain_uuid( uuid ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString uuid = curr.toElement().attribute( XML::Uuid_Attribute ); + TQUuid chain_uuid( uuid ); // kdDebug() << "IPTable: Start Parsing Chain: " << name << endl; - QDomDocument chain_xml; + TQDomDocument chain_xml; chain_xml.appendChild( curr.cloneNode(true) ); IPTChain* chain = 0; chain = chainForUuid( chain_uuid ); if ( ! chain ) { chain = chainForName( name ); if ( ! chain ) { - chain = addChain( name ,*( new QString( "ACCEPT" ) ), false, m_err ); + chain = addChain( name ,*( new TQString( "ACCEPT" ) ), false, m_err ); if ( m_err->errNum() != 0 ) { kdDebug() << "ERROR: Couldn't create Chain: " << name << endl; return; @@ -352,11 +352,11 @@ void IPTable::loadXML( QDomNode root, QStringList& errors ) { curr = curr.nextSibling(); } - QPtrListIterator<IPTChain> it ( m_chains ); + TQPtrListIterator<IPTChain> it ( m_chains ); while ( it.current() ) { // kdDebug() << "IPTChain::xloadXML() cleanup loop." << endl; IPTChain *chain = it.current(); - QPtrListIterator<IPTChain> it2 ( used_chains ); + TQPtrListIterator<IPTChain> it2 ( used_chains ); bool found = false; while ( it2.current() ) { IPTChain *chain2 = it2.current(); diff --git a/kmyfirewall/core/iptable.h b/kmyfirewall/core/iptable.h index 89da260..1278da2 100644 --- a/kmyfirewall/core/iptable.h +++ b/kmyfirewall/core/iptable.h @@ -24,12 +24,12 @@ email : chubinger@irrsinnig.org #include "netfilterobject.h" // qt includes -#include <qptrlist.h> -#include <quuid.h> +#include <tqptrlist.h> +#include <tquuid.h> // project includes #include "iptchain.h" // qt classes -class QString; +class TQString; namespace KMF { // project classes class KMFError; @@ -39,7 +39,7 @@ class KMFIPTDoc; class KDE_EXPORT IPTable : public NetfilterObject { public: /** initialise a IPTable with the given name */ - IPTable( KMFIPTDoc*, const char* name, const QString& tableName ); + IPTable( KMFIPTDoc*, const char* name, const TQString& tableName ); ~IPTable(); virtual int type(); @@ -54,14 +54,14 @@ public: void reset(); /** Return the IPTChain with the name provided */ - IPTChain* chainForName( const QString& ); + IPTChain* chainForName( const TQString& ); /** Return the IPTChain for the given ID */ - IPTChain* chainForUuid( const QUuid& ); + IPTChain* chainForUuid( const TQUuid& ); /** Add a new IPTChain object to this table with the given prperties */ - IPTChain* addChain( const QString& chain_name, - const QString& chain_target, + IPTChain* addChain( const TQString& chain_name, + const TQString& chain_target, bool builtin, KMFError* ); @@ -88,23 +88,23 @@ public: }; /** Returns the list with the iptchains in this table */ - QPtrList<IPTChain>& chains() const; + TQPtrList<IPTChain>& chains() const; - /** Return a QDomDocument representation of this Table */ - virtual const QDomDocument& getDOMTree(); + /** Return a TQDomDocument representation of this Table */ + virtual const TQDomDocument& getDOMTree(); - /** Load the Table from the QDomDocument */ - virtual void loadXML( const QDomDocument&, QStringList& errors ); + /** Load the Table from the TQDomDocument */ + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); /** Load Table From DomNode */ - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); /** Stup the built-in chains */ void settupDefaultChains(); private: /** the list holding the chains in this table */ - private: QPtrList<IPTChain> m_chains; + private: TQPtrList<IPTChain> m_chains; /** used by the current configuration */ private: bool m_used; diff --git a/kmyfirewall/core/iptchain.cpp b/kmyfirewall/core/iptchain.cpp index 9a9d2b1..41fa9fb 100644 --- a/kmyfirewall/core/iptchain.cpp +++ b/kmyfirewall/core/iptchain.cpp @@ -13,9 +13,9 @@ * * ***************************************************************************/ -#include "qptrlist.h" -#include "qstring.h" -#include "qmessagebox.h" +#include "tqptrlist.h" +#include "tqstring.h" +#include "tqmessagebox.h" // kde includes #include <kdebug.h> @@ -31,8 +31,8 @@ namespace KMF { -IPTChain::IPTChain( IPTable* table, const char* name, const QString& chainName, bool buildin ) : NetfilterObject( table, name ) { - // kdDebug() << "IPTChain::IPTChain(const QString& name,IPTable* table,bool buildin)" << endl; +IPTChain::IPTChain( IPTable* table, const char* name, const TQString& chainName, bool buildin ) : NetfilterObject( table, name ) { + // kdDebug() << "IPTChain::IPTChain(const TQString& name,IPTable* table,bool buildin)" << endl; m_err = new KMFError(); // m_object_type = NetfilterObject::CHAIN; @@ -80,8 +80,8 @@ void IPTChain::reset() { changed(); } -void IPTChain::setDefaultTarget( const QString& target ) { - // kdDebug() << "void IPTChain::setDefaultTarget(const QString& target) " << endl; +void IPTChain::setDefaultTarget( const TQString& target ) { + // kdDebug() << "void IPTChain::setDefaultTarget(const TQString& target) " << endl; m_default_target = target; has_default_target = true; changed(); @@ -96,8 +96,8 @@ IPTable* IPTChain::table() const { return m_table; } -QPtrList<IPTRule>& IPTChain::chainRuleset() const { - QPtrList<IPTRule>* ret_list = new QPtrList<IPTRule>; +TQPtrList<IPTRule>& IPTChain::chainRuleset() const { + TQPtrList<IPTRule>* ret_list = new TQPtrList<IPTRule>; *ret_list = m_ruleset; return *ret_list; } @@ -105,7 +105,7 @@ QPtrList<IPTRule>& IPTChain::chainRuleset() const { void IPTChain::setBuildIn( bool build_in ) { is_build_in_chain = build_in; if ( is_build_in_chain ) { - const QString target = "DROP"; + const TQString target = "DROP"; setDefaultTarget( target ); hasCustomDefaultTarget( false ); } @@ -126,21 +126,21 @@ void IPTChain::setUsed( bool valid ) { int IPTChain::indexOf( const IPTRule& rule ) { // kdDebug() << "int IPTChain::indexOf( IPTRule* " << rule.name() << " ) " << endl; - return m_ruleset.find( &rule ); + return m_ruleset.tqfind( &rule ); } -IPTRule* IPTChain::addRule( const QString& rule_name, KMFError *err, int index ) { - kdDebug() << "IPTRule* IPTChain::addRule(QString& " << rule_name << ", KMFError *err) " << endl; +IPTRule* IPTChain::addRule( const TQString& rule_name, KMFError *err, int index ) { + kdDebug() << "IPTRule* IPTChain::addRule(TQString& " << rule_name << ", KMFError *err) " << endl; - QString target = "DROP"; - const QString& new_name = rule_name; - QString name = new_name; + TQString target = "DROP"; + const TQString& new_name = rule_name; + TQString name = new_name; for ( uint i = 0; i < m_ruleset.count(); i++ ) { - QString tmp_name = m_ruleset.at( i ) ->name(); + TQString tmp_name = m_ruleset.at( i ) ->name(); if ( tmp_name == name ) { err->setErrType(KMFError::NORMAL); - err->setErrMsg( i18n( "<qt><p>Unable to add rule: <b>%1</b> into chain: <b>%2</b>.<br>There is already a rule defined with that name. Please try again with another name (must be unique in that chain).</p></qt>" ).arg( tmp_name ).arg( NetfilterObject::name() ) ); + err->setErrMsg( i18n( "<qt><p>Unable to add rule: <b>%1</b> into chain: <b>%2</b>.<br>There is already a rule defined with that name. Please try again with another name (must be unique in that chain).</p></qt>" ).tqarg( tmp_name ).tqarg( NetfilterObject::name() ) ); return 0; } } @@ -158,7 +158,7 @@ IPTRule* IPTChain::addRule( const QString& rule_name, KMFError *err, int index ) } else { if ( index < 0 || index > (int) chainRuleset().count() - -1 ) { err->setErrType(KMFError::FATAL); - err->setErrMsg( i18n("Cannot insert rule at %1 This is a bug ;-(").arg( index ) ); + err->setErrMsg( i18n("Cannot insert rule at %1 This is a bug ;-(").tqarg( index ) ); return 0; } kdDebug() << "IPTChain::addRule: inserting rule at: " << index << endl; @@ -175,14 +175,14 @@ KMFError* IPTChain::delRule( IPTRule* rule ) { if ( m_ruleset.count() < 1 ) return false; - QString name = rule->name(); - if ( m_ruleset.find( rule ) != -1 ) { + TQString name = rule->name(); + if ( m_ruleset.tqfind( rule ) != -1 ) { m_err->setErrType(KMFError::OK ); if ( ! m_ruleset.remove( rule ) ) { rule->deleteLater(); rule = 0; m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).arg( rule->name() ); + const TQString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).tqarg( rule->name() ); m_err->setErrMsg( msg ); return m_err; } @@ -192,7 +192,7 @@ KMFError* IPTChain::delRule( IPTRule* rule ) { return m_err; } else { m_err->setErrType( KMFError::FATAL ); - const QString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).arg( rule->name() ); + const TQString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).tqarg( rule->name() ); m_err->setErrMsg( msg ); return m_err; } @@ -202,7 +202,7 @@ KMFError* IPTChain::delRule( IPTRule* rule ) { bool IPTChain::moveRule( IPTRule* rule, int how_much ) { // kdDebug() << "void IPTChain::moveRule(IPTRule* rule,int how_much)" << endl; - int num = m_ruleset.find( rule ); + int num = m_ruleset.tqfind( rule ); int new_pos = num + how_much; if ( new_pos < 0 || new_pos > ( int ) m_ruleset.count() - 1 ) { // kdDebug() << "New Position is not Valid: " << new_pos << endl; @@ -217,7 +217,7 @@ bool IPTChain::moveRule( IPTRule* rule, int how_much ) { } } -void IPTChain::setDropLogging( bool enabled, QString& limit, QString& burst, QString& prefix ) { +void IPTChain::setDropLogging( bool enabled, TQString& limit, TQString& burst, TQString& prefix ) { enable_log = enabled; if ( !limit.isEmpty() ) @@ -236,45 +236,45 @@ void IPTChain::setDropLogging( bool enabled, QString& limit, QString& burst, QSt } -QPtrList<IPTRule>& IPTChain::chainFwds() { - // kdDebug() << "QPtrList<IPTRule> IPTChain::chainFwds()" << endl; - QPtrList<IPTRule>* fwds = new QPtrList<IPTRule>; - QPtrListIterator<IPTRule> it( m_ruleset ); +TQPtrList<IPTRule>& IPTChain::chainFwds() { + // kdDebug() << "TQPtrList<IPTRule> IPTChain::chainFwds()" << endl; + TQPtrList<IPTRule>* fwds = new TQPtrList<IPTRule>; + TQPtrListIterator<IPTRule> it( m_ruleset ); IPTRule* rule = 0; while ( it.current() ) { rule = it.current(); ++it; - QString target = rule->target(); + TQString target = rule->target(); // FIXME: lots of targets missing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if ( !target.isEmpty() && target != "ACCEPT" && target != "DROP" && target != "LOG" && target != "REJECT" && target != "RETURN" && target != "DNAT" && target != "SNAT" - && target != "QUEUE" && target != "MIRROR" && target != "REDIRECT" && target != "MASQUERADE" ) { + && target != "TQUEUE" && target != "MIRROR" && target != "REDIRECT" && target != "MASTQUERADE" ) { //kdDebug() << "Found Forward to chain: " << target << endl; fwds->append( rule ); } } -// kdDebug() << "EXIT: QPtrList<IPTRule>& IPTChain::chainFwds()" << endl; +// kdDebug() << "EXIT: TQPtrList<IPTRule>& IPTChain::chainFwds()" << endl; return *fwds; } -QPtrList<IPTRule>& IPTChain::chainFeeds() { -// kdDebug() << "QPtrList<IPTRule> IPTChain::chainFeeds()" << endl; - QPtrList<IPTRule>* feeds = new QPtrList<IPTRule>; +TQPtrList<IPTRule>& IPTChain::chainFeeds() { +// kdDebug() << "TQPtrList<IPTRule> IPTChain::chainFeeds()" << endl; + TQPtrList<IPTRule>* feeds = new TQPtrList<IPTRule>; IPTChain* tmp_chain; - QPtrList<IPTChain> table_chains = table() ->chains(); - QPtrListIterator<IPTChain> it( table_chains ); + TQPtrList<IPTChain> table_chains = table() ->chains(); + TQPtrListIterator<IPTChain> it( table_chains ); while ( it.current() ) { tmp_chain = it.current(); ++it; // kdDebug() << "Searching in chain: " << tmp_chain->name() << endl; if ( !tmp_chain->chainRuleset().isEmpty() ) { IPTRule * tmp_rule; - QPtrList<IPTRule> rules = tmp_chain->chainRuleset(); - QPtrListIterator<IPTRule> it2( rules ); + TQPtrList<IPTRule> rules = tmp_chain->chainRuleset(); + TQPtrListIterator<IPTRule> it2( rules ); while ( it2.current() ) { tmp_rule = it2.current(); ++it2; - QString target = tmp_rule->target(); + TQString target = tmp_rule->target(); //kdDebug() << "Found Rule: " << tmp_rule->name() << " with target: " << target << endl; if ( target == name() ) { feeds->append( tmp_rule ); @@ -283,11 +283,11 @@ QPtrList<IPTRule>& IPTChain::chainFeeds() { } } } - // kdDebug() << "EXIT: QPtrList<IPTRule>& IPTChain::chainFeeds()" << endl; + // kdDebug() << "EXIT: TQPtrList<IPTRule>& IPTChain::chainFeeds()" << endl; return *feeds; } -IPTRule* IPTChain::ruleForName( const QString& name ) { +IPTRule* IPTChain::ruleForName( const TQString& name ) { IPTRule * tmp_rule = 0; for ( tmp_rule = m_ruleset.first();tmp_rule; tmp_rule = m_ruleset.next() ) { if ( tmp_rule->name() == name ) { @@ -297,7 +297,7 @@ IPTRule* IPTChain::ruleForName( const QString& name ) { return 0; } -IPTRule* IPTChain::ruleForUuid( const QUuid& id ) { +IPTRule* IPTChain::ruleForUuid( const TQUuid& id ) { IPTRule * tmp_rule = 0; for ( tmp_rule = m_ruleset.first();tmp_rule; tmp_rule = m_ruleset.next() ) { if ( tmp_rule->uuid() == id ) { @@ -308,8 +308,8 @@ IPTRule* IPTChain::ruleForUuid( const QUuid& id ) { } -QString IPTChain::createIPTablesChainDefinition() { - QString chainDef = ""; +TQString IPTChain::createIPTablesChainDefinition() { + TQString chainDef = ""; if ( is_build_in_chain ) { return chainDef; } else { @@ -321,7 +321,7 @@ QString IPTChain::createIPTablesChainDefinition() { } } -QString IPTChain::createIPTablesChainDefaultTarget() { +TQString IPTChain::createIPTablesChainDefaultTarget() { // kdDebug() << "IPTChain::createIPTablesChainDefaultTarget()" << endl; m_cmd_default_target = "$IPT -t "; m_cmd_default_target.append( m_table->name() ); @@ -339,10 +339,10 @@ QString IPTChain::createIPTablesChainDefaultTarget() { return m_cmd_default_target; } -const QDomDocument& IPTChain::getDOMTree() { - // kdDebug() << "const QString& IPTChain::getIDOMree( )" << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::Chain_Element ); +const TQDomDocument& IPTChain::getDOMTree() { + // kdDebug() << "const TQString& IPTChain::getIDOMree( )" << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::Chain_Element ); NetfilterObject::saveUuid( root ); @@ -359,14 +359,14 @@ const QDomDocument& IPTChain::getDOMTree() { } if ( logging() ) { - QDomElement logging = doc.createElement( XML::Logging_Element ); + TQDomElement logging = doc.createElement( XML::Logging_Element ); root.appendChild( logging ); logging.setAttribute( XML::Prefix_Attribute, m_log_prefix ); logging.setAttribute( XML::Limit_Attribute, m_log_limit ); logging.setAttribute( XML::Burst_Attribute, m_log_burst ); } - QPtrListIterator<IPTRule> it ( m_ruleset ); + TQPtrListIterator<IPTRule> it ( m_ruleset ); IPTRule *rule = 0; while ( ( rule = it.current() ) != 0 ) { ++it; @@ -378,24 +378,24 @@ const QDomDocument& IPTChain::getDOMTree() { } } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void IPTChain::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void IPTChain::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void IPTChain::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void IPTChain::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void IPTChain::loadXML( QDomNode root, QStringList& errors ) { +void IPTChain::loadXML( TQDomNode root, TQStringList& errors ) { /* -void IPTChain::loadXML( const QDomDocument& doc ) {*/ - kdDebug() << "\nvoid IPTChain::loadXML( const QDomDocument& doc )" << endl; +void IPTChain::loadXML( const TQDomDocument& doc ) {*/ + kdDebug() << "\nvoid IPTChain::loadXML( const TQDomDocument& doc )" << endl; NetfilterObject::loadUuid( root, errors ); - // QDomNode curr = root.toElement(); + // TQDomNode curr = root.toElement(); - QString target = ""; - QString builtin = ""; - QString desc = ""; + TQString target = ""; + TQString builtin = ""; + TQString desc = ""; kdDebug() << "Parsing node: " << root.nodeName() << endl; builtin = root.toElement().attribute( XML::BuiltIn_Attribute ); if ( !builtin.isEmpty() && builtin == XML::Yes_Value ) { @@ -408,29 +408,29 @@ void IPTChain::loadXML( const QDomDocument& doc ) {*/ if ( !target.isEmpty() ) { if ( ! isBuildIn() ) hasCustomDefaultTarget( true ); - setDefaultTarget( *(new QString( target ) ) ); + setDefaultTarget( *(new TQString( target ) ) ); } desc = root.toElement().attribute( XML::Description_Attribute ); - setDescription( *(new QString( desc ) ) ); + setDescription( *(new TQString( desc ) ) ); kdDebug() << "Loading chain description: " << desc << endl; kdDebug() << "Loading Chain: " << name() << endl; kdDebug() << "Is built in: " << builtin << endl; kdDebug() << "Description chain description: " << desc << endl; - QDomNode curr = root.firstChild(); - QPtrList<IPTRule> used_rules; + TQDomNode curr = root.firstChild(); + TQPtrList<IPTRule> used_rules; while ( !curr.isNull() ) { kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::Rule_Element ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); - QString id = curr.toElement().attribute( XML::Uuid_Attribute ); - QUuid rule_id( id ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString id = curr.toElement().attribute( XML::Uuid_Attribute ); + TQUuid rule_id( id ); // kdDebug() << "IPTChain: Start Parsing Rule: " << name << endl; - QDomDocument rule_xml; + TQDomDocument rule_xml; rule_xml.appendChild( curr.cloneNode(true) ); IPTRule* rule = 0; rule = ruleForUuid( rule_id ); @@ -450,9 +450,9 @@ void IPTChain::loadXML( const QDomDocument& doc ) {*/ used_rules.append( rule ); // kdDebug() << "IPTChain: Finished Parsing Rule: " << name << endl; } else if( curr.isElement() && curr.nodeName() == XML::Logging_Element ) { - QString log_limit = ""; - QString log_burst = ""; - QString log_prefix = ""; + TQString log_limit = ""; + TQString log_burst = ""; + TQString log_prefix = ""; enable_log = true; log_limit = curr.toElement().attribute( XML::Limit_Attribute ); @@ -471,11 +471,11 @@ void IPTChain::loadXML( const QDomDocument& doc ) {*/ } - QPtrListIterator<IPTRule> it ( m_ruleset ); + TQPtrListIterator<IPTRule> it ( m_ruleset ); while ( it.current() ) { // kdDebug() << "IPTChain::xloadXML() cleanup loop." << endl; IPTRule *rule = it.current(); - QPtrListIterator<IPTRule> it2 ( used_rules ); + TQPtrListIterator<IPTRule> it2 ( used_rules ); bool found = false; while ( it2.current() ) { IPTRule *rule2 = it2.current(); @@ -494,21 +494,21 @@ void IPTChain::loadXML( const QDomDocument& doc ) {*/ changed(); } -QPtrList<QStringList>& IPTChain::createIPTablesChainRules() { - // kdDebug() << "QPtrList<QStringList>& IPTChain::createIPTablesChainRules()" << endl; - QPtrList<QStringList>* all_rules = new QPtrList<QStringList>; +TQPtrList<TQStringList>& IPTChain::createIPTablesChainRules() { + // kdDebug() << "TQPtrList<TQStringList>& IPTChain::createIPTablesChainRules()" << endl; + TQPtrList<TQStringList>* all_rules = new TQPtrList<TQStringList>; if ( !m_ruleset.isEmpty() ) { //kdDebug() << "------- Chain Rules --------"<< endl; IPTRule * rule; for ( rule = m_ruleset.first(); rule; rule = m_ruleset.next() ) { - QString rule_name = rule->name(); - QString rule_cmd = rule->toString(); - QStringList* chainDefs = new QStringList(); + TQString rule_name = rule->name(); + TQString rule_cmd = rule->toString(); + TQStringList* chainDefs = new TQStringList(); chainDefs->append( rule_name ); if ( rule->enabled() ) { chainDefs->append( rule_cmd ); } else { - QString warning = "if [ \"$verbose\" = \"1\" ]; then\n" + TQString warning = "if [ \"$verbose\" = \"1\" ]; then\n" " echo \"Skipping Disabled Rule " + rule_name + "!!!\"\n" "fi\n true"; chainDefs->append( warning ); @@ -518,7 +518,7 @@ QPtrList<QStringList>& IPTChain::createIPTablesChainRules() { } if ( enable_log ) { //kdDebug() << "------- Chain Logging --------"<< endl; - QString chain_log = ""; + TQString chain_log = ""; chain_log.append( "$IPT -t " ); chain_log.append( m_table->name() ); chain_log.append( " -A " ); @@ -538,17 +538,17 @@ QPtrList<QStringList>& IPTChain::createIPTablesChainRules() { chain_log.append( "\"" ); } kdDebug() << chain_log << endl; - QStringList* chainDefs = new QStringList(); - QString rule_name = i18n( "Chain: %1 Drop Logging" ).arg( name() ); + TQStringList* chainDefs = new TQStringList(); + TQString rule_name = i18n( "Chain: %1 Drop Logging" ).tqarg( name() ); chainDefs->append( rule_name ); chainDefs->append( chain_log ); all_rules->append( chainDefs ); } //kdDebug() << "------- Chain Default Target --------"<< endl; if ( has_default_target && !m_cmd_default_target.isEmpty() ) { - QString deftg = createIPTablesChainDefaultTarget(); - QStringList* chainDefs = new QStringList(); - QString rule_name = i18n( "Chain: %1 Default Target" ).arg( name() ); + TQString deftg = createIPTablesChainDefaultTarget(); + TQStringList* chainDefs = new TQStringList(); + TQString rule_name = i18n( "Chain: %1 Default Target" ).tqarg( name() ); chainDefs->append( rule_name ); chainDefs->append( deftg ); all_rules->append( chainDefs ); diff --git a/kmyfirewall/core/iptchain.h b/kmyfirewall/core/iptchain.h index 6a6db2b..d1836aa 100644 --- a/kmyfirewall/core/iptchain.h +++ b/kmyfirewall/core/iptchain.h @@ -18,10 +18,10 @@ email : chubinger@irrsinnig.org #include "netfilterobject.h" -#include "qptrlist.h" -#include "qstringlist.h" -#include "qdom.h" -#include "quuid.h" +#include "tqptrlist.h" +#include "tqstringlist.h" +#include "tqdom.h" +#include "tquuid.h" #include <kdemacros.h> @@ -40,7 +40,7 @@ public: /** The Constructor that will set the "Name" and the "Table" of the chain. If buildin is set true the chain will be handeled as bild-in chain. Normaly this is only done at the initiallistaion of the whole KMFIPTDoc. */ - IPTChain( IPTable* table, const char* name, const QString& chainName, bool buildin = false ); + IPTChain( IPTable* table, const char* name, const TQString& chainName, bool buildin = false ); ~IPTChain(); virtual int type(); @@ -58,7 +58,7 @@ public: rule like ( $IPT -A CHAINNAME -j DROP ) which will be added at the end of the chain to avoid that the packetes jump back to the chain that feeded this chain. */ - void setDefaultTarget( const QString& ); + void setDefaultTarget( const TQString& ); /** Enabbles/Disables the build in logging for this Chain. This will generate a Rule like: $IPT -A CHAINNAME --match @@ -69,9 +69,9 @@ public: empty strings to disable those features. If enable is "false" the logging will be deactivated. */ void setDropLogging( bool enable, - QString& limit , - QString& burst , - QString& prefix ); + TQString& limit , + TQString& burst , + TQString& prefix ); /** Defines weather a Chain is build-in or is user-defined */ void setBuildIn( bool ); @@ -87,7 +87,7 @@ public: bool moveRule( IPTRule* rule, int how_much ); /** Simply adds a Rule to the Chains Ruleset. */ - IPTRule* addRule( const QString& name, KMFError*, int index = -1 ); + IPTRule* addRule( const TQString& name, KMFError*, int index = -1 ); /** The the index of the rule in the chain **/ int indexOf( const IPTRule& ); @@ -97,11 +97,11 @@ public: /** Returns a pointer to a rule for the given name if it exists in this chain. If no rule is found 0 is returned */ - IPTRule* ruleForName( const QString& name ); + IPTRule* ruleForName( const TQString& name ); /** Returns a pointer to a rule for the given object id if it exists in this chain. If no rule is found 0 is returned */ - IPTRule* ruleForUuid( const QUuid& ); + IPTRule* ruleForUuid( const TQUuid& ); /** Returns "true" if the logging is enabled, otherwhise "false". */ @@ -129,65 +129,65 @@ public: void reset(); /** Returns the limit of matches for the logging - rule. */ - const QString& logLimit() const { + const TQString& logLimit() const { return m_log_limit; }; /** Returns the log prefix */ - const QString& logPrefix() const { + const TQString& logPrefix() const { return m_log_prefix; }; /** Returns the log limit burst number. */ - const QString& logBurst() const { + const TQString& logBurst() const { return m_log_burst; }; /** Returns the returns the Chaindefinition ($IPT -N chainname) if this is a user defined chain. if it's a build in chain like INPUT it returnes an empty string. */ - const QString& chainDefinitions() const { + const TQString& chainDefinitions() const { return m_cmd_chain_definition ; } ; /** Returns the Chain Policy ( "DROP" "ACCEPT" "LOG" etc ) */ - const QString& defaultTarget() const { + const TQString& defaultTarget() const { return m_default_target; } ; /** Returns rules that forward packets to other chains. Those Rules have a chain as their target ( -j <chainname>) */ - QPtrList<IPTRule>& chainFwds(); + TQPtrList<IPTRule>& chainFwds(); /** Returns rules that forward packets to this chain. Those Rules have this chain as their target ( -j <chainname>) */ - QPtrList<IPTRule>& chainFeeds(); + TQPtrList<IPTRule>& chainFeeds(); /** Returns the whole ruleset defined by the Chain as - an QPtrList<IPTRule>. */ - QPtrList<IPTRule>& chainRuleset() const; + an TQPtrList<IPTRule>. */ + TQPtrList<IPTRule>& chainRuleset() const; /** Returns a list of strings like: "$IPT -A CHAINNAME OPTIONS [ all kind of allowed optiions p.e --match state --state NEW, RELATED --source 192.168.0.2 ... ] -j TARGET [target options p.e --log-prefix 'KMF:' ] */ - QPtrList<QStringList>& createIPTablesChainRules(); + TQPtrList<TQStringList>& createIPTablesChainRules(); /** Returns a String like: "$IPT -P INPUT DROP" for build-in and "$IPT -A CHAINNAME -j DROP" for user defined chans. */ - QString createIPTablesChainDefaultTarget(); + TQString createIPTablesChainDefaultTarget(); /** Returns a String like: "$IPT -N CHAINNAME" that is written to the script. */ - QString createIPTablesChainDefinition(); + TQString createIPTablesChainDefinition(); /** Return DomDocument of this Chain */ - const QDomDocument& getDOMTree(); + const TQDomDocument& getDOMTree(); /** Lad the XML sniplet representing the chain */ - virtual void loadXML( const QDomDocument&, QStringList& errors ); + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); /** Load Table From DomNode */ - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); private: // functions @@ -201,15 +201,15 @@ private: //data bool is_build_in_chain; bool has_default_target; - QString m_log_limit; - QString m_log_prefix; - QString m_log_burst; + TQString m_log_limit; + TQString m_log_prefix; + TQString m_log_burst; - QString m_default_target; - QString m_cmd_chain_definition; - QString m_cmd_default_target; + TQString m_default_target; + TQString m_cmd_chain_definition; + TQString m_cmd_default_target; - QPtrList<IPTRule> m_ruleset; + TQPtrList<IPTRule> m_ruleset; }; } #endif diff --git a/kmyfirewall/core/iptrule.cpp b/kmyfirewall/core/iptrule.cpp index dec79b0..9258db5 100644 --- a/kmyfirewall/core/iptrule.cpp +++ b/kmyfirewall/core/iptrule.cpp @@ -23,8 +23,8 @@ email : chubinger@irrsinnig.org #include "xmlnames.h" //qt includes -#include "qstring.h" -#include "qdict.h" +#include "tqstring.h" +#include "tqdict.h" // kde includes #include <kdebug.h> @@ -32,7 +32,7 @@ email : chubinger@irrsinnig.org namespace KMF { -IPTRule::IPTRule( IPTChain* tmp_chain, const char *name, const QString& tmp_name, const QString& tmp_target ) : NetfilterObject( tmp_chain, name ) { +IPTRule::IPTRule( IPTChain* tmp_chain, const char *name, const TQString& tmp_name, const TQString& tmp_target ) : NetfilterObject( tmp_chain, name ) { // m_object_type = NetfilterObject::RULE; setName( XML::Undefined_Value ); m_target = XML::Undefined_Value; @@ -71,9 +71,9 @@ void IPTRule::clear() { m_options.setAutoDelete( false ); } -KMFError* IPTRule::setRuleName( const QString& tmp_name ) { - kdDebug() << "IPTRule::setName( const QString& tmp_name )" << endl; - QString inp = tmp_name; +KMFError* IPTRule::setRuleName( const TQString& tmp_name ) { + kdDebug() << "IPTRule::setName( const TQString& tmp_name )" << endl; + TQString inp = tmp_name; m_check_input->checkInput( inp, "RULENAME", m_err ); if ( m_err->errType() != KMFError::OK ) { kdDebug() << "-- Name unchanged: invalid name" << tmp_name << endl; @@ -106,18 +106,18 @@ void IPTRule::setLogging( bool on ) { changed(); } -void IPTRule::setTarget( const QString& tmp_target ) { +void IPTRule::setTarget( const TQString& tmp_target ) { if ( !tmp_target.isNull() ) { m_target = tmp_target; } - QPtrList<QString>* available_options = IPTRuleOption::getAvailableOptionTypes(); + TQPtrList<TQString>* available_options = IPTRuleOption::getAvailableOptionTypes(); for ( uint j = 0;j < available_options->count();j++ ) { - QString type = *available_options->at( j ); + TQString type = *available_options->at( j ); IPTRuleOption* opt = 0; opt = getOptionForName( type ); if ( opt && opt->isTargetOption() ) { - QStringList args; + TQStringList args; opt->loadValues( args ); } } @@ -134,18 +134,18 @@ int IPTRule::ruleNum() const { //return m_rule_num; } -const QString& IPTRule::target() const { +const TQString& IPTRule::target() const { return m_target; } bool IPTRule::isForward() const { //FIXME: Is that sematically correct??? if ( m_target == "ACCEPT" || m_target == "DROP" || - m_target == "LOG" || m_target == "QUEUE" || + m_target == "LOG" || m_target == "TQUEUE" || m_target == "RETURN" || m_target == "REJECT" || m_target == "MIRROR" || m_target == "SNAT" || m_target == "DNAT" || m_target == "REDIRECT" || - m_target == "MASQUERADE" || m_target == "MARK" || + m_target == "MASTQUERADE" || m_target == "MARK" || m_target == "TOS" ) { return true; } else { @@ -153,17 +153,17 @@ bool IPTRule::isForward() const { } } -QStringList IPTRule::availableTargets() const { - kdDebug() << "QStringList availableTargets() const {" << endl; - QStringList targets; - QString table = chain() ->table() ->name(); - QString name = chain() ->name(); +TQStringList IPTRule::availableTargets() const { + kdDebug() << "TQStringList availableTargets() const {" << endl; + TQStringList targets; + TQString table = chain() ->table() ->name(); + TQString name = chain() ->name(); if ( table.isEmpty() || name.isEmpty() ) { kdDebug() << "KMFRuleEdit::slotAddValidTargets( const IPTChain& chain ): ERROR: name or table not found in table" << endl; - return *( new QStringList() ); + return *( new TQStringList() ); } // general Targets - targets << "ACCEPT" << "DROP" << "LOG" << "QUEUE" << "RETURN"; + targets << "ACCEPT" << "DROP" << "LOG" << "TQUEUE" << "RETURN"; if ( name == Constants::InputChain_Name || name == Constants::OutputChain_Name || name == Constants::ForwardChain_Name ) targets << "REJECT"; @@ -178,15 +178,15 @@ QStringList IPTRule::availableTargets() const { } if ( table == Constants::NatTable_Name && name == Constants::PostRoutingChain_Name ) - targets << "MASQUERADE"; + targets << "MASTQUERADE"; if ( table == Constants::MangleTable_Name ) { targets << "MARK" << "TOS"; } if ( table == Constants::FilterTable_Name || table == Constants::NatTable_Name || table == Constants::MangleTable_Name ) { - QPtrList<IPTChain> tmp_chains = chain() ->table() ->chains(); - QPtrListIterator<IPTChain> it( tmp_chains ); + TQPtrList<IPTChain> tmp_chains = chain() ->table() ->chains(); + TQPtrListIterator<IPTChain> it( tmp_chains ); while ( it.current() ) { IPTChain * tmp_ch = it.current(); ++it; @@ -199,9 +199,9 @@ QStringList IPTRule::availableTargets() const { return targets; } -IPTRuleOption* IPTRule::getOptionForName( const QString& type ) { +IPTRuleOption* IPTRule::getOptionForName( const TQString& type ) { IPTRuleOption * option_obj; - option_obj = m_options.find( type ); + option_obj = m_options.tqfind( type ); if ( option_obj == 0 && !type.stripWhiteSpace().isEmpty() ) { // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl; option_obj = new IPTRuleOption( this, type.latin1() ); @@ -213,9 +213,9 @@ IPTRuleOption* IPTRule::getOptionForName( const QString& type ) { } } -bool IPTRule::addRuleOption( QString& par_name, QPtrList<QString>& cmds ) { +bool IPTRule::addRuleOption( TQString& par_name, TQPtrList<TQString>& cmds ) { //############# start new implementation ##################// - QString new_par_name = ""; + TQString new_par_name = ""; if ( par_name == "src_ip" || par_name == "dest_ip" ) { // kdDebug() << "Translating to new option name: " << par_name << " -> ip_opt" << endl; new_par_name = "ip_opt"; @@ -230,7 +230,7 @@ bool IPTRule::addRuleOption( QString& par_name, QPtrList<QString>& cmds ) { return false; } IPTRuleOption * option_obj; - option_obj = m_options.find( new_par_name ); + option_obj = m_options.tqfind( new_par_name ); if ( option_obj == 0 ) { // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl; option_obj = new IPTRuleOption( this, new_par_name.latin1() ); @@ -241,9 +241,9 @@ bool IPTRule::addRuleOption( QString& par_name, QPtrList<QString>& cmds ) { kdDebug() << "+ Adding Opiton: " << new_par_name << endl; option_obj->setOptionType( new_par_name ); if ( ! cmds.isEmpty() ) { - QStringList args; + TQStringList args; for ( uint i = 0; i < cmds.count(); i++ ) - args << *( new QString( *cmds.at( i ) ) ); + args << *( new TQString( *cmds.at( i ) ) ); option_obj->loadValues( args ); } else { option_obj->reset(); @@ -253,9 +253,9 @@ bool IPTRule::addRuleOption( QString& par_name, QPtrList<QString>& cmds ) { return true; } -bool IPTRule::addTargetOption( QString& par_name, QPtrList<QString>& cmds ) { +bool IPTRule::addTargetOption( TQString& par_name, TQPtrList<TQString>& cmds ) { //############# start new implementation ##################// - QString new_par_name = ""; + TQString new_par_name = ""; new_par_name = par_name; if ( new_par_name.stripWhiteSpace().isEmpty() ) { @@ -263,7 +263,7 @@ bool IPTRule::addTargetOption( QString& par_name, QPtrList<QString>& cmds ) { } IPTRuleOption * option_obj; - option_obj = m_options.find( new_par_name ); + option_obj = m_options.tqfind( new_par_name ); if ( option_obj == 0 ) { // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl; option_obj = new IPTRuleOption( this, par_name.latin1() ); @@ -276,9 +276,9 @@ bool IPTRule::addTargetOption( QString& par_name, QPtrList<QString>& cmds ) { option_obj->setOptionType( new_par_name ); option_obj->setTargetOption( true ); if ( ! cmds.isEmpty() ) { - QStringList args; + TQStringList args; for ( uint i = 0; i < cmds.count(); i++ ) - args << *( new QString( *cmds.at( i ) ) ); + args << *( new TQString( *cmds.at( i ) ) ); option_obj->loadValues( args ); } else { option_obj->reset(); @@ -289,8 +289,8 @@ bool IPTRule::addTargetOption( QString& par_name, QPtrList<QString>& cmds ) { } -const QString& IPTRule::toString() { - // kdDebug() << "\nconst QString& IPTRule::toString()" << endl; +const TQString& IPTRule::toString() { + // kdDebug() << "\nconst TQString& IPTRule::toString()" << endl; option_cmd = ""; option_cmd.append( ipt_cmd ); // $IPT option_cmd.append( ws ); @@ -303,23 +303,23 @@ const QString& IPTRule::toString() { option_cmd.append( m_chain->name() ); // <CHAIN> option_cmd.append( ws ); // append all normal rule options - QPtrList<QString>* known_types = 0; + TQPtrList<TQString>* known_types = 0; known_types = IPTRuleOption::getAvailableOptionTypes(); if ( known_types == 0 ) { kdDebug() << "ERROR: IPTRuleOption::getAvailableOptionTypes() == 0\n" << endl; } else { // kdDebug() << "Found Number of Types: " << known_types->count() << endl; for ( uint i = 0; i < known_types->count(); i++ ) { - QString* option_name = 0; + TQString* option_name = 0; option_name = known_types->at( i ); if ( option_name == 0 ) { kdDebug() << "ERROR: option_name == 0" << endl; } else { // kdDebug() << "Searching for Option: " << *option_name << endl; IPTRuleOption* opt = 0; - opt = m_options.find( *option_name ); + opt = m_options.tqfind( *option_name ); if ( opt && ! opt->isEmpty() && ! opt->isTargetOption() ) { - QString option = opt->toString(); + TQString option = opt->toString(); // kdDebug() << "Add Option: " << opt->toString() << endl; if ( !option.isEmpty() ) { option_cmd.append( opt->toString() ); @@ -333,7 +333,7 @@ const QString& IPTRule::toString() { option_cmd. append( ws ); option_cmd.simplifyWhiteSpace(); if ( logging() ) { - QString new_line = option_cmd; + TQString new_line = option_cmd; new_line. append( "LOG" ); new_line. append( " --log-prefix \"Rule " + name() + ": \"" ); new_line.simplifyWhiteSpace(); @@ -344,23 +344,23 @@ const QString& IPTRule::toString() { option_cmd. append( m_target ); option_cmd. append( ws ); - QString target_options = ""; + TQString target_options = ""; if ( known_types == 0 ) { kdDebug() << "ERROR: IPTRuleOption::getAvailableOptionTypes() == 0\n" << endl; } else { // kdDebug() << "Found Number of Types: " << known_types->count() << endl; for ( uint i = 0; i < known_types->count(); i++ ) { - QString* option_name = 0; + TQString* option_name = 0; option_name = known_types->at( i ); if ( option_name == 0 ) { kdDebug() << "ERROR: option_name == 0" << endl; } else { // kdDebug() << "Searching for Option: " << *option_name << endl; IPTRuleOption* opt = 0; - opt = m_options.find( *option_name ); + opt = m_options.tqfind( *option_name ); if ( opt && opt->isTargetOption() && ! opt->isEmpty() ) { // kdDebug() << "Add Option: " << opt->toString() << endl; - QString option = ""; + TQString option = ""; option = opt->toString(); if ( !option.isEmpty() ) { target_options.append( opt->toString() ); @@ -376,14 +376,14 @@ const QString& IPTRule::toString() { // kdDebug() << "Rule Cmd Line for Rule " << m_name << ": " << option_cmd << endl; if ( ! logging() ) option_cmd.simplifyWhiteSpace(); - return *( new QString( option_cmd ) ); + return *( new TQString( option_cmd ) ); } -const QDomDocument& IPTRule::getDOMTree( ) { - // kdDebug() << "const QString& IPTRule::getDOMTree( )" << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::Rule_Element ); +const TQDomDocument& IPTRule::getDOMTree( ) { + // kdDebug() << "const TQString& IPTRule::getDOMTree( )" << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::Rule_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Num_Attribute, ruleNum() ); root.setAttribute( XML::Name_Attribute, name() ); @@ -407,16 +407,16 @@ const QDomDocument& IPTRule::getDOMTree( ) { root.setAttribute( XML::Logging_Attribute, XML::No_Value ); } - QPtrList<QString>* available_options = 0; + TQPtrList<TQString>* available_options = 0; available_options = IPTRuleOption::getAvailableOptionTypes(); if ( available_options ) { - QPtrListIterator<QString> it ( *available_options ); - QString *type = 0; + TQPtrListIterator<TQString> it ( *available_options ); + TQString *type = 0; while ( ( type = it.current() ) != 0 ) { ++it; if ( type ) { IPTRuleOption * opt = 0; - opt = m_options.find( *type ); + opt = m_options.tqfind( *type ); if ( opt ) { root.appendChild( opt->getDOMTree( ) ); // kdDebug() << "Got XML for Rule Option Type: " << *type << endl; @@ -427,27 +427,27 @@ const QDomDocument& IPTRule::getDOMTree( ) { } } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void IPTRule::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void IPTRule::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void IPTRule::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void IPTRule::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void IPTRule::loadXML( QDomNode root, QStringList& errors ) { -// void IPTRule::loadXML( const QDomDocument& doc ) { - // kdDebug() << "void IPTRule::loadXML( const QDomDocument& doc )" << endl; +void IPTRule::loadXML( TQDomNode root, TQStringList& errors ) { +// void IPTRule::loadXML( const TQDomDocument& doc ) { + // kdDebug() << "void IPTRule::loadXML( const TQDomDocument& doc )" << endl; // kdDebug() << "Parsing XML:\n" << doc.toString() << endl; -// QDomElement root = doc.documentElement(); +// TQDomElement root = doc.documentElement(); NetfilterObject::loadUuid ( root, errors ); - QString name = ""; - QString num = ""; - QString logging = ""; - QString desc = ""; - QString target = ""; - QString custom = ""; - QString enabled = ""; + TQString name = ""; + TQString num = ""; + TQString logging = ""; + TQString desc = ""; + TQString target = ""; + TQString custom = ""; + TQString enabled = ""; name = root.toElement().attribute( XML::Name_Attribute ); num = root.toElement().attribute( XML::Num_Attribute ); logging = root.toElement().attribute( XML::Logging_Attribute ); @@ -473,38 +473,38 @@ void IPTRule::loadXML( QDomNode root, QStringList& errors ) { setCustomRule( false ); } - setTarget( *( new QString( target ) ) ); - setDescription( *( new QString( desc ) ) ); - setName( *( new QString( name ) ) ); + setTarget( *( new TQString( target ) ) ); + setDescription( *( new TQString( desc ) ) ); + setName( *( new TQString( name ) ) ); /* bool ok; int rule_number = num.toInt( &ok ); if ( ok ) setRuleNum( rule_number );*/ - QPtrList<QString> *avail_opts = IPTRuleOption::getAvailableOptionTypes(); - QPtrListIterator<QString> it ( *avail_opts ); + TQPtrList<TQString> *avail_opts = IPTRuleOption::getAvailableOptionTypes(); + TQPtrListIterator<TQString> it ( *avail_opts ); while ( it.current() ) { - QString name = *it.current(); + TQString name = *it.current(); ++it; IPTRuleOption *opt = getOptionForName( name ); if ( opt ) opt->reset(); } - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { // kdDebug() << "IPTRule: Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::RuleOption_Element ) { - QString type = curr.toElement().attribute( XML::Type_Attribute ); + TQString type = curr.toElement().attribute( XML::Type_Attribute ); // kdDebug() << "IPTRule: Start Parsing Option: " << type << endl; - QDomDocument opt_xml; + TQDomDocument opt_xml; opt_xml.appendChild( curr.cloneNode( true ) ); IPTRuleOption* opt = 0; - opt = m_options.find( *( new QString( type ) ) ); + opt = m_options.tqfind( *( new TQString( type ) ) ); if ( opt == 0 ) { - QPtrList<QString> list; - list.append( new QString( "" ) ); + TQPtrList<TQString> list; + list.append( new TQString( "" ) ); addRuleOption( type, list ); - opt = m_options.find( *( new QString( type ) ) ); + opt = m_options.tqfind( *( new TQString( type ) ) ); if ( ! opt ) { kdDebug() << "ERROR: Couldn't create Option: " << type << endl; return ; @@ -521,7 +521,7 @@ void IPTRule::loadXML( QDomNode root, QStringList& errors ) { void IPTRule::createRuleClone( IPTRule* new_rule ) { // kdDebug() << "IPTRule& IPTRule::createRuleClone()" << endl; - QString na = name(); + TQString na = name(); if ( na.length() > 15 ) { na = na.left( 15 ) ; } @@ -530,16 +530,16 @@ void IPTRule::createRuleClone( IPTRule* new_rule ) { new_rule->setLogging( logging() ); new_rule->setEnabled( enabled() ); new_rule->setTarget( target() ); - QPtrList<QString>* available_types = IPTRuleOption::getAvailableOptionTypes(); - QString type = ""; - QPtrListIterator<QString> it( *available_types ); + TQPtrList<TQString>* available_types = IPTRuleOption::getAvailableOptionTypes(); + TQString type = ""; + TQPtrListIterator<TQString> it( *available_types ); while ( it.current() ) { type = *it.current(); ++it; IPTRuleOption* opt = getOptionForName( type ); IPTRuleOption* clone_opt = new_rule->getOptionForName( type ); // FIXME: Check For Error - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); clone_opt->loadXML( opt->getDOMTree(), *errors ); } } diff --git a/kmyfirewall/core/iptrule.h b/kmyfirewall/core/iptrule.h index 02f0145..ccde076 100644 --- a/kmyfirewall/core/iptrule.h +++ b/kmyfirewall/core/iptrule.h @@ -18,8 +18,8 @@ email : chubinger@irrsinnig.org #include "netfilterobject.h" -#include <qptrlist.h> -#include <qdict.h> +#include <tqptrlist.h> +#include <tqdict.h> #include <kdemacros.h> @@ -29,7 +29,7 @@ email : chubinger@irrsinnig.org *@author Christian Hubinger */ -class QString; +class TQString; namespace KMF { @@ -45,7 +45,7 @@ class KDE_EXPORT IPTRule : public NetfilterObject { public: /** The only constructor that sets the name,chain,target and table. */ - IPTRule( IPTChain* chain, const char *objectname , const QString& name , const QString& target ); + IPTRule( IPTChain* chain, const char *objectname , const TQString& name , const TQString& target ); ~IPTRule(); virtual int type(); @@ -53,13 +53,13 @@ public: /** Sets the name of the rule to name. This name is displayed in the Document View */ - KMFError* setRuleName( const QString& name ); + KMFError* setRuleName( const TQString& name ); /** Sets the chain for which this Rule applies */ void setChain( IPTChain* chain ); /** Sets the Target for the Rule */ - void setTarget( const QString& target ); + void setTarget( const TQString& target ); /** Sets the Table of the rule to table */ void setTable( IPTable* table ); // FIXME: set IPTable to use default="filter" @@ -84,13 +84,13 @@ public: /** Addes a ruleoption defined the a string optionname e.g. "ip_opt" "state" and the strings needed to define all options is given by the list options values of the */ - bool addRuleOption( QString& optionname, QPtrList<QString>& options ); + bool addRuleOption( TQString& optionname, TQPtrList<TQString>& options ); /** Addes a rule target option defined the a string optionname e.g. "ip_opt" "state" and the strings needed to define all options is given by the list options values of the */ - bool addTargetOption( QString& optionname, QPtrList<QString>& options ); + bool addTargetOption( TQString& optionname, TQPtrList<TQString>& options ); /** Returns the chain to which this rule belongs */ IPTChain* chain() const { @@ -106,10 +106,10 @@ public: exists. If no one exists a new rule option will be created with the given type. If the type is invalid 0 is returned. */ - IPTRuleOption* getOptionForName( const QString& ); + IPTRuleOption* getOptionForName( const TQString& ); /** Returns the target of the rule */ - const QString& target() const ; + const TQString& target() const ; /** Return the rule number in it's chain */ @@ -124,23 +124,23 @@ public: void setCustomRule( bool ); /** Returns the commandline that this rule represents */ - const QString& toString(); + const TQString& toString(); - /** Serialize the rule to a QDomDocument */ - const QDomDocument& getDOMTree(); + /** Serialize the rule to a TQDomDocument */ + const TQDomDocument& getDOMTree(); - /** Load the rule from the QDomDocument */ - virtual void loadXML( const QDomDocument&, QStringList& errors ); + /** Load the rule from the TQDomDocument */ + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); /** Load rule From DomNode */ - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); /** Creates a deep copy of the rule */ void createRuleClone( IPTRule* ); /** Returns List of all possible Targets for this rule */ - QStringList availableTargets() const; + TQStringList availableTargets() const; /** Returns true if the target is the name of a chain e.g the rule forwards packets to a chain */ @@ -154,23 +154,23 @@ private: IPTable *m_table; /** The target of the rule */ - QString m_target; + TQString m_target; KMFError *m_err; KMFCheckInput *m_check_input; - QDict<IPTRuleOption> m_options; + TQDict<IPTRuleOption> m_options; bool m_enabled; bool m_log_rule; bool m_custom_rule; - QString opt; - QString ipt_cmd; - QString tab; - QString ap; - QString ws; - QString post; - QString option_cmd; + TQString opt; + TQString ipt_cmd; + TQString tab; + TQString ap; + TQString ws; + TQString post; + TQString option_cmd; }; } #endif diff --git a/kmyfirewall/core/iptruleoption.cpp b/kmyfirewall/core/iptruleoption.cpp index 2532c64..7cab59a 100644 --- a/kmyfirewall/core/iptruleoption.cpp +++ b/kmyfirewall/core/iptruleoption.cpp @@ -19,7 +19,7 @@ email : chubinger@irrsinnig.org // QT -#include <qdom.h> +#include <tqdom.h> // PROJECT #include "kmfdoc.h" @@ -31,10 +31,10 @@ email : chubinger@irrsinnig.org namespace KMF { //############# Initialise static members -QDict<QStringList>* IPTRuleOption::m_dict_option_strings = new QDict<QStringList>; -QDict<QStringList>* IPTRuleOption::m_dict_gui_strings = new QDict<QStringList>; -QDict<QString>* IPTRuleOption::m_dict_option_names = new QDict<QString>; -QPtrList<QString>* IPTRuleOption::m_known_types = new QPtrList<QString>; +TQDict<TQStringList>* IPTRuleOption::m_dict_option_strings = new TQDict<TQStringList>; +TQDict<TQStringList>* IPTRuleOption::m_dict_gui_strings = new TQDict<TQStringList>; +TQDict<TQString>* IPTRuleOption::m_dict_option_names = new TQDict<TQString>; +TQPtrList<TQString>* IPTRuleOption::m_known_types = new TQPtrList<TQString>; bool IPTRuleOption::m_created_dict = false; IPTRuleOption::IPTRuleOption( IPTRule* rule, const char* name ) : NetfilterObject( rule, name ) { @@ -72,15 +72,15 @@ int IPTRuleOption::type() { void IPTRuleOption::clear() { } -void IPTRuleOption::setOptionType( const QString& type ) { +void IPTRuleOption::setOptionType( const TQString& type ) { if ( type.isNull() ) { return; } m_option_type = type; } -const QString& IPTRuleOption::guiName() const { - return *m_dict_option_names->find( m_option_type ); +const TQString& IPTRuleOption::guiName() const { + return *m_dict_option_names->tqfind( m_option_type ); } void IPTRuleOption::setTargetOption( bool is_tg_opt ) { @@ -105,35 +105,35 @@ bool IPTRuleOption::isEmpty() { return true; } -void IPTRuleOption::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void IPTRuleOption::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void IPTRuleOption::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void IPTRuleOption::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void IPTRuleOption::loadXML( QDomNode root, QStringList& errors ) { +void IPTRuleOption::loadXML( TQDomNode root, TQStringList& errors ) { NetfilterObject::loadUuid( root, errors ); - QString new_opt_type = root.toElement().attribute( XML::Type_Attribute ); + TQString new_opt_type = root.toElement().attribute( XML::Type_Attribute ); if ( m_option_type == XML::BoolOff_Value ) { m_option_type = new_opt_type; } if ( m_option_type == new_opt_type ) kdDebug() << "Found Option Type: " << m_option_type << endl; - QString tmp = root.toElement().attribute( XML::TargetOption_Attribute ); + TQString tmp = root.toElement().attribute( XML::TargetOption_Attribute ); if ( tmp == XML::Yes_Value ) setTargetOption( true ); else setTargetOption( false ); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() ) { if ( curr.nodeName() == XML::RuleOptionValue_Element ) { for ( int i = 0; i < MAXOPTNUM;i++ ) { - QDomText textChild = curr.firstChild().toText(); - QString attrib = QString( "value%1" ).arg( i ); - QString val = curr.toElement().attribute( attrib ); + TQDomText textChild = curr.firstChild().toText(); + TQString attrib = TQString( "value%1" ).tqarg( i ); + TQString val = curr.toElement().attribute( attrib ); if ( !val.isEmpty() && val != XML::Undefined_Value ) { m_values[ i ] = val; @@ -147,12 +147,12 @@ void IPTRuleOption::loadXML( QDomNode root, QStringList& errors ) { changed(); } -void IPTRuleOption::loadValues( QStringList args ) { +void IPTRuleOption::loadValues( TQStringList args ) { for ( uint i = 0; i < MAXOPTNUM; i++ ) m_values[ i ] = XML::BoolOff_Value; int i = 0; - for ( QStringList::Iterator it = args.begin(); it != args.end(); ++it ) { + for ( TQStringList::Iterator it = args.begin(); it != args.end(); ++it ) { m_values[ i ] = *it; kdDebug() << "+ Inserted Option Argument Nr: " << i << " value: " << m_values[ i ] << endl; i++; @@ -160,30 +160,30 @@ void IPTRuleOption::loadValues( QStringList args ) { changed(); } -const QStringList& IPTRuleOption::getValues() { - // kdDebug() << "const QStringList& IPTRuleOption::getValues()" << endl; - QStringList vals; +const TQStringList& IPTRuleOption::getValues() { + // kdDebug() << "const TQStringList& IPTRuleOption::getValues()" << endl; + TQStringList vals; for ( uint i = 0; i < MAXOPTNUM; i++ ) { - QString val = m_values[ i ]; + TQString val = m_values[ i ]; // kdDebug() << "Append Value: " << val << endl; vals << val; } - return *( new QStringList( vals ) ); + return *( new TQStringList( vals ) ); } -const QDomDocument& IPTRuleOption::getDOMTree() { - // kdDebug() << "const QString& IPTRuleOption::getDOMTree( )" << endl; - QDomDocument doc; +const TQDomDocument& IPTRuleOption::getDOMTree() { + // kdDebug() << "const TQString& IPTRuleOption::getDOMTree( )" << endl; + TQDomDocument doc; if ( isEmpty() ) - return * ( new QDomDocument( doc ) ); + return * ( new TQDomDocument( doc ) ); bool found = false; for ( uint i = 0; i < MAXOPTNUM; i++ ) if ( !m_values[ i ].isEmpty() && m_values[ i ] != XML::Undefined_Value ) found = true; if ( true ) { - QDomElement root = doc.createElement( XML::RuleOption_Element ); + TQDomElement root = doc.createElement( XML::RuleOption_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Type_Attribute, m_option_type ); if ( m_target_option ) { @@ -194,40 +194,40 @@ const QDomDocument& IPTRuleOption::getDOMTree() { doc.appendChild( root ); for ( uint i = 0; i < MAXOPTNUM; i++ ) { - QString val = m_values[ i ]; + TQString val = m_values[ i ]; if ( !val.isEmpty() && val != XML::Undefined_Value ) { - QDomElement tag = doc.createElement( XML::RuleOptionValue_Element ); + TQDomElement tag = doc.createElement( XML::RuleOptionValue_Element ); tag.setTagName( XML::RuleOptionValue_Element ); // kdDebug() << "Writing Attribute: value" << i << " val: " << val << endl; - QString attrib = QString( "value%1" ).arg( i ); + TQString attrib = TQString( "value%1" ).tqarg( i ); tag.setAttribute( attrib, val ); root.appendChild( tag ); } } } // kdDebug() << "XML:\n " << doc.toString() << endl; - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -const QString& IPTRuleOption::toString() { - // kdDebug() << "const QString& IPTRuleOption::toString()" << endl; +const TQString& IPTRuleOption::toString() { + // kdDebug() << "const TQString& IPTRuleOption::toString()" << endl; - QStringList * commandStrings; - commandStrings = m_dict_option_strings->find( m_option_type ); - QString s = ""; - QTextStream str( &s, IO_WriteOnly ); - QString ws = " "; + TQStringList * commandStrings; + commandStrings = m_dict_option_strings->tqfind( m_option_type ); + TQString s = ""; + TQTextStream str( &s, IO_WriteOnly ); + TQString ws = " "; // kdDebug() << "Option: " << m_option_type << " defined " << used << endl; if ( ! isEmpty() && commandStrings && ! commandStrings->isEmpty() ) { // str << *commandStrings->at( 0 ); str << ws; // bool was_modifier = false; for ( uint i = 0; i < commandStrings->count(); i++ ) { - QString command = *commandStrings->at( i ); - QString val = m_values[ i ]; - QStringList* guiStrings = m_dict_gui_strings->find( m_option_type ); - QString guiName = *guiStrings->at( i ); + TQString command = *commandStrings->at( i ); + TQString val = m_values[ i ]; + TQStringList* guiStrings = m_dict_gui_strings->tqfind( m_option_type ); + TQString guiName = *guiStrings->at( i ); if (! val.isNull() && ! val.isEmpty() && @@ -247,57 +247,57 @@ const QString& IPTRuleOption::toString() { } // kdDebug() << "Returning String: " << s << endl; - return *( new QString( s.simplifyWhiteSpace() ) ); + return *( new TQString( s.simplifyWhiteSpace() ) ); } //############ static members ####################// -QDict<QStringList>* IPTRuleOption::getOptionStringDict() { +TQDict<TQStringList>* IPTRuleOption::getOptionStringDict() { return m_dict_option_strings; } -QDict<QStringList>* IPTRuleOption::getGUIStringDict() { +TQDict<TQStringList>* IPTRuleOption::getGUIStringDict() { return m_dict_gui_strings; } -QPtrList<QString>* IPTRuleOption::getAvailableOptionTypes() { +TQPtrList<TQString>* IPTRuleOption::getAvailableOptionTypes() { return m_known_types; } -void IPTRuleOption::readRuleOptionDefinition( const QDomDocument& doc ) { - QDomElement root = doc.documentElement(); - QDomNode curr = root.firstChild(); +void IPTRuleOption::readRuleOptionDefinition( const TQDomDocument& doc ) { + TQDomElement root = doc.documentElement(); + TQDomNode curr = root.firstChild(); bool inOption = false; - QString name = ""; - QString guiName = ""; - QStringList *vals = 0; - QStringList *gui = 0; + TQString name = ""; + TQString guiName = ""; + TQStringList *vals = 0; + TQStringList *gui = 0; while ( !curr.isNull() ) { // kdDebug() << "IPTRuleOption: Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == "ruleoptiondefinition" ) { name = curr.toElement().attribute( XML::Name_Attribute ); guiName = curr.toElement().attribute( XML::GUIName_Attribute ); // version = root.toElement().attribute( XML::Version_Attribute ); - vals = new QStringList(); - gui = new QStringList(); + vals = new TQStringList(); + gui = new TQStringList(); kdDebug() << "+ Register Rule Option: " << name << " " << guiName << endl; inOption = true; readRuleOptionDefinitionNode( curr, vals, gui ); m_dict_option_strings->insert( name, vals ); m_dict_gui_strings->insert( name, gui ); - m_dict_option_names->insert( name, new QString( guiName ) ); - m_known_types->append( ( new QString( name ) ) ); + m_dict_option_names->insert( name, new TQString( guiName ) ); + m_known_types->append( ( new TQString( name ) ) ); kdDebug() << "+ Testing Key: " << name << endl; - QStringList* list; - list = m_dict_option_strings->find( name ); + TQStringList* list; + list = m_dict_option_strings->tqfind( name ); if ( list ) { for ( uint i = 0; i < list->count(); i ++ ) { - QString s = *list->at( i ); + TQString s = *list->at( i ); kdDebug() << "---+ Found Option String: " << s << endl; s = ""; } } else { - kdDebug() << "!!!!Couldn't fetch QStringList with key: " << name << endl; + kdDebug() << "!!!!Couldn't fetch TQStringList with key: " << name << endl; } } curr = curr.nextSibling(); @@ -305,14 +305,14 @@ void IPTRuleOption::readRuleOptionDefinition( const QDomDocument& doc ) { } -void IPTRuleOption::readRuleOptionDefinitionNode( const QDomNode& currNode, QStringList* vals, QStringList* gui ) { - QDomNode curr = currNode; +void IPTRuleOption::readRuleOptionDefinitionNode( const TQDomNode& currNode, TQStringList* vals, TQStringList* gui ) { + TQDomNode curr = currNode; curr = curr.firstChild(); while ( !curr.isNull() ) { kdDebug() << "IPTRuleOption: Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == "option" ) { - QString cmd = curr.toElement().attribute( "command" ); - QString guiName = curr.toElement().attribute( XML::GUIName_Attribute ); + TQString cmd = curr.toElement().attribute( "command" ); + TQString guiName = curr.toElement().attribute( XML::GUIName_Attribute ); cmd.simplifyWhiteSpace(); vals->append( cmd ); diff --git a/kmyfirewall/core/iptruleoption.h b/kmyfirewall/core/iptruleoption.h index 55a611b..b6503f3 100644 --- a/kmyfirewall/core/iptruleoption.h +++ b/kmyfirewall/core/iptruleoption.h @@ -19,11 +19,11 @@ email : chubinger@irrsinnig.org #include "netfilterobject.h" // QT -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> -#include <qdom.h> +#include <tqdom.h> #include <kdemacros.h> @@ -42,25 +42,25 @@ class KDE_EXPORT IPTRuleOption : public NetfilterObject { public: /** Contains the option commands for each option type. */ - static QDict<QStringList>* getOptionStringDict(); + static TQDict<TQStringList>* getOptionStringDict(); /** Returns a Stringlist containing the user visible strings for the opition */ - static QDict<QStringList>* getGUIStringDict(); + static TQDict<TQStringList>* getGUIStringDict(); /** Return a list of all currently available option types */ - static QPtrList<QString>* getAvailableOptionTypes(); + static TQPtrList<TQString>* getAvailableOptionTypes(); - static void readRuleOptionDefinition( const QDomDocument& ); + static void readRuleOptionDefinition( const TQDomDocument& ); private: /** Reads a XML OptionDefinitionNode */ - static void readRuleOptionDefinitionNode( const QDomNode& curr, QStringList* vals, QStringList* gui ) ; + static void readRuleOptionDefinitionNode( const TQDomNode& curr, TQStringList* vals, TQStringList* gui ) ; private: // DATA - static QDict<QStringList>* m_dict_option_strings; - static QDict<QStringList>* m_dict_gui_strings; - static QDict<QString>* m_dict_option_names; + static TQDict<TQStringList>* m_dict_option_strings; + static TQDict<TQStringList>* m_dict_gui_strings; + static TQDict<TQString>* m_dict_option_names; - static QPtrList<QString>* m_known_types; + static TQPtrList<TQString>* m_known_types; static bool m_created_dict; //########## END STATIC ################ @@ -73,10 +73,10 @@ public: virtual void clear(); /** restore the opotion config from an xml sniplet */ - virtual void loadXML( const QDomDocument&, QStringList& errors ); + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); /** restore the opotion config from an xml sniplet */ - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); /** Makes the option empty. */ void reset(); @@ -85,21 +85,21 @@ public: bool isEmpty(); /** Return DomDocument representing this rule() */ - const QDomDocument& getDOMTree( ); + const TQDomDocument& getDOMTree( ); - /** Returns a QString containing the option. */ - const QString& toString( ); + /** Returns a TQString containing the option. */ + const TQString& toString( ); /** Set Option Type */ - void setOptionType( const QString& ); + void setOptionType( const TQString& ); /** Return the type of the option. */ - const QString& getOptionType() const { + const TQString& getOptionType() const { return m_option_type; }; /** Return the type of the option. */ - const QString& guiName() const ; + const TQString& guiName() const ; /** Returns true if this is a target option otherwise false*/ bool isTargetOption() const { @@ -116,17 +116,17 @@ public: end of the rule */ void setTargetOption( bool ); - /** Load the provided option values in the QStringList. */ - void loadValues( QStringList ); + /** Load the provided option values in the TQStringList. */ + void loadValues( TQStringList ); - /** Returns a QStringList containing the option values. */ - const QStringList& getValues(); + /** Returns a TQStringList containing the option values. */ + const TQStringList& getValues(); private: IPTRule *m_rule; - QString m_option_type; + TQString m_option_type; bool m_target_option; - QString m_values[ MAXOPTNUM ]; + TQString m_values[ MAXOPTNUM ]; }; } diff --git a/kmyfirewall/core/kmfapp.cpp b/kmyfirewall/core/kmfapp.cpp index 0724359..f94931a 100644 --- a/kmyfirewall/core/kmfapp.cpp +++ b/kmyfirewall/core/kmfapp.cpp @@ -15,10 +15,10 @@ // QT includes -#include <qlabel.h> -#include <qpainter.h> -#include <qfont.h> -#include <qwidget.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqfont.h> +#include <tqwidget.h> // KDE includes #include <kstandarddirs.h> @@ -36,49 +36,49 @@ namespace KMF { KMFApp::KMFApp() {} KMFApp::~KMFApp() {} -static QLabel *splash = 0; +static TQLabel *splash = 0; -void set_splash_status( const QString& msg ) { +void set_splash_status( const TQString& msg ) { if ( !splash ) return ; - splash->repaint( FALSE ); - QPainter p( splash ); - QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold ); + splash->tqrepaint( FALSE ); + TQPainter p( splash ); + TQFont f( KGlobalSettings::generalFont().family(), 8, TQFont::Bold ); p.setFont( f ); - p.setPen( Qt::white ); + p.setPen( TQt::white ); p.drawText( splash->width() / 2 - splash->fontMetrics().width( msg ) / 2, 265, msg ); - QApplication::flush(); + TQApplication::flush(); } void showSplash() { - QRect screen = QApplication::desktop() ->screenGeometry(); - QRect mainRect; - screen = QApplication::desktop() ->screenGeometry( QApplication::desktop() ->screenNumber( mainRect.center() ) ); + TQRect screen = TQApplication::desktop() ->screenGeometry(); + TQRect mainRect; + screen = TQApplication::desktop() ->screenGeometry( TQApplication::desktop() ->screenNumber( mainRect.center() ) ); bool show = true; if ( show ) { KStandardDirs std_dir; - QString dir = std_dir.findResource( "data", "kmyfirewall/pics/splash.png" ); + TQString dir = std_dir.findResource( "data", "kmyfirewall/pics/splash.png" ); kdDebug() << "\nFound Splashscreen at: " << dir << endl; - QPixmap pic = QPixmap::fromMimeSource( dir ); - QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold ); + TQPixmap pic = TQPixmap::fromMimeSource( dir ); + TQFont f( KGlobalSettings::generalFont().family(), 8, TQFont::Bold ); if ( pic.isNull() ) return ; - QPainter p( &pic ); + TQPainter p( &pic ); p.setFont( f ); - p.setPen( Qt::white ); - p.drawText( 280, 93, QString( "Version %1" ).arg( KMYFIREWALL_VERSION ) ); - splash = new QLabel( 0, "splash", QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder | QWidget::WX11BypassWM | QWidget::WStyle_StaysOnTop ); - splash->setFrameStyle( QFrame::WinPanel | QFrame::Raised ); + p.setPen( TQt::white ); + p.drawText( 280, 93, TQString( "Version %1" ).tqarg( KMYFIREWALL_VERSION ) ); + splash = new TQLabel( 0, "splash", TQWidget::WDestructiveClose | TQWidget::WStyle_Customize | TQWidget::WStyle_NoBorder | TQWidget::WX11BypassWM | TQWidget::WStyle_StaysOnTop ); + splash->setFrameStyle( TQFrame::WinPanel | TQFrame::Raised ); splash->setPixmap( pic ); splash->adjustSize(); - splash->setFixedSize( splash->sizeHint() ); - splash->move( screen.center() - QPoint( splash->width() / 2, splash->height() / 2 ) ); - splash->repaint( FALSE ); + splash->setFixedSize( splash->tqsizeHint() ); + splash->move( screen.center() - TQPoint( splash->width() / 2, splash->height() / 2 ) ); + splash->tqrepaint( FALSE ); splash->show(); set_splash_status( "Initializing..." ); - QApplication::flush(); + TQApplication::flush(); } } diff --git a/kmyfirewall/core/kmfapp.h b/kmyfirewall/core/kmfapp.h index fa8be21..5adb44a 100644 --- a/kmyfirewall/core/kmfapp.h +++ b/kmyfirewall/core/kmfapp.h @@ -18,7 +18,7 @@ // QT includes -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <kapplication.h> @@ -27,7 +27,7 @@ *@author Christian Hubinger */ -class QLabel; +class TQLabel; namespace KMF { @@ -39,7 +39,7 @@ public: KDE_EXPORT void showSplash(); KDE_EXPORT void closeSplash(); -KDE_EXPORT void set_splash_status( const QString& ); +KDE_EXPORT void set_splash_status( const TQString& ); } #endif diff --git a/kmyfirewall/core/kmfcheckinput.cpp b/kmyfirewall/core/kmfcheckinput.cpp index c45d111..e9024c6 100644 --- a/kmyfirewall/core/kmfcheckinput.cpp +++ b/kmyfirewall/core/kmfcheckinput.cpp @@ -18,8 +18,8 @@ #include "kmferror.h" // QT includes -#include <qstring.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqregexp.h> // KDE includes #include <kdebug.h> #include <klocale.h> @@ -32,29 +32,29 @@ KMFCheckInput::KMFCheckInput() { KMFCheckInput::~KMFCheckInput() {} -void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMFError* err ) { -// kdDebug() << "KMFCheckInput::checkInput(QString& inp, const QString& inp_type)" << endl; +void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, KMFError* err ) { +// kdDebug() << "KMFCheckInput::checkInput(TQString& inp, const TQString& inp_type)" << endl; // KMFError *err = new KMFError(); - QString str_input = inp; + TQString str_input = inp; if ( str_input.isEmpty() ) { - const QString msg = "String is Empty."; + const TQString msg = "String is Empty."; err->setErrMsg( msg ); err->setErrType( KMFError::FATAL ); return; } - if ( inp_type == "IP/NETWORK/FQHN" ) { -// kdDebug() << "Check for IP/NETWORK/FQHN" << endl; + if ( inp_type == "IP/NETWORK/FTQHN" ) { +// kdDebug() << "Check for IP/NETWORK/FTQHN" << endl; bool isIP = checkIP( str_input ); - // bool isFQHN = checkFQHN( str_input ); + // bool isFTQHN = checkFTQHN( str_input ); bool isNETWORK = checkNetWork( str_input ); if ( !isIP && !isNETWORK ) { - const QString msg = *m_msg_dict.find( "IP/NETWORK/FQHN" ); + const TQString msg = *m_msg_dict.tqfind( "IP/NETWORK/FTQHN" ); err->setErrMsg( msg ); err->setErrType( KMFError::HINT ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -64,12 +64,12 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "PORT" ) { bool isPORT = checkPORT( str_input ); if ( !isPORT ) { - const QString msg = *m_msg_dict.find( "PORT" ); + const TQString msg = *m_msg_dict.tqfind( "PORT" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -79,12 +79,12 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "MULTIPORT" ) { bool isMULTIPORT = checkMULTIPORT( str_input ); if ( !isMULTIPORT ) { - const QString msg = *m_msg_dict.find( "MULTIPORT" ); + const TQString msg = *m_msg_dict.tqfind( "MULTIPORT" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -95,27 +95,27 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF bool isPORT = checkPORT( str_input ); bool isPORTRANGE = checkPORTRANGE( str_input ); if ( !isPORT && !isPORTRANGE ) { - const QString msg = *m_msg_dict.find( "PORT" ); + const TQString msg = *m_msg_dict.tqfind( "PORT" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; } } - if ( inp_type == "FQHN" ) { - bool isFQHN = checkFQHN( str_input ); - if ( !isFQHN ) { - const QString msg = *m_msg_dict.find( "FQHN" ); + if ( inp_type == "FTQHN" ) { + bool isFTQHN = checkFTQHN( str_input ); + if ( !isFTQHN ) { + const TQString msg = *m_msg_dict.tqfind( "FTQHN" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType(KMFError::OK ); return; @@ -125,12 +125,12 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "IP" ) { bool isIP = checkIP( str_input ); if ( !isIP ) { - const QString msg = *m_msg_dict.find( "IP" ); + const TQString msg = *m_msg_dict.tqfind( "IP" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -141,12 +141,12 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "CHAINNAME" ) { bool isValid = checkChainName( str_input ); if ( !isValid ) { - const QString msg = *m_msg_dict.find( "CHAINNAME" ); + const TQString msg = *m_msg_dict.tqfind( "CHAINNAME" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -156,12 +156,12 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "RULENAME" ) { bool isValid = checkRuleName( str_input ); if ( !isValid ) { - const QString msg = *m_msg_dict.find( "RULENAME" ); + const TQString msg = *m_msg_dict.tqfind( "RULENAME" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; @@ -171,33 +171,33 @@ void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMF if ( inp_type == "MAC" ) { bool isValid = checkMAC( str_input ); if ( !isValid ) { - const QString msg = *m_msg_dict.find( "MAC" ); + const TQString msg = *m_msg_dict.tqfind( "MAC" ); err->setErrMsg( msg ); err->setErrType( KMFError::NORMAL ); return; } else { - const QString msg = ""; + const TQString msg = ""; err->setErrMsg( msg ); err->setErrType( KMFError::OK ); return; } } - const QString msg = "Misuse of this function."; + const TQString msg = "Misuse of this function."; err->setErrMsg( msg ); err->setErrType( KMFError::FATAL ); return; } -bool KMFCheckInput::checkIP( QString inp ) { - QRegExp exp( "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" ); +bool KMFCheckInput::checkIP( TQString inp ) { + TQRegExp exp( "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" ); // kdDebug() << "RegEx isValid: " << exp.isValid() << endl; - if ( inp.contains( exp ) ) { + if ( inp.tqcontains( exp ) ) { int pos; - QString str_num; + TQString str_num; bool valid = true; while ( !inp.isEmpty() ) { - pos = inp.find( "." ); + pos = inp.tqfind( "." ); if ( pos > -1 ) { str_num = inp.left( pos ); // kdDebug() << "IP Num Part: " << str_num << endl; @@ -226,10 +226,10 @@ bool KMFCheckInput::checkIP( QString inp ) { return false; } -bool KMFCheckInput::checkNetMask ( QString inp ) { - QRegExp exp( "^[0-9]{1,2}$" ); +bool KMFCheckInput::checkNetMask ( TQString inp ) { + TQRegExp exp( "^[0-9]{1,2}$" ); // kdDebug() << "RegEx isValid: " << exp.isValid() << endl; - if ( inp.contains( exp ) ) { + if ( inp.tqcontains( exp ) ) { int val = inp.toInt(); if ( val < 0 || val > 24 ) { kdDebug() << "Mask must not be > 24" << endl; @@ -242,10 +242,10 @@ bool KMFCheckInput::checkNetMask ( QString inp ) { } } -bool KMFCheckInput::checkPORT ( QString inp ) { - QRegExp exp( "^[0-9]{1,5}$" ); +bool KMFCheckInput::checkPORT ( TQString inp ) { + TQRegExp exp( "^[0-9]{1,5}$" ); // kdDebug() << "RegEx isValid: " << exp.isValid() << endl; - if ( inp.contains( exp ) ) { + if ( inp.tqcontains( exp ) ) { int val = inp.toInt(); if ( val < 0 || val > 65535 ) { kdDebug() << "Port must not be > 65535" << endl; @@ -258,11 +258,11 @@ bool KMFCheckInput::checkPORT ( QString inp ) { } } -bool KMFCheckInput::checkMULTIPORT ( QString inp ) { - QString tmp = inp; +bool KMFCheckInput::checkMULTIPORT ( TQString inp ) { + TQString tmp = inp; while ( !tmp.isEmpty() ) { - QString port = ""; - int pos = tmp.find( "," ); + TQString port = ""; + int pos = tmp.tqfind( "," ); if ( pos == -1 ) { port = tmp; port = port.stripWhiteSpace(); @@ -284,17 +284,17 @@ bool KMFCheckInput::checkMULTIPORT ( QString inp ) { return true; } -bool KMFCheckInput::checkPORTRANGE ( QString inp ) { +bool KMFCheckInput::checkPORTRANGE ( TQString inp ) { bool valid_1 = false; bool valid_2 = false; kdDebug() << "Checking for PORTRANGE: " << endl; - int delimiter = inp.find( ":" ); + int delimiter = inp.tqfind( ":" ); if ( delimiter == -1 ) { kdDebug() << "This is no port range" << endl; return false; } else { - QString port1 = inp.left( delimiter ); - QString port2 = inp.right( inp.length() - ( delimiter + 1 ) ); + TQString port1 = inp.left( delimiter ); + TQString port2 = inp.right( inp.length() - ( delimiter + 1 ) ); valid_1 = checkPORT ( port1 ); valid_2 = checkPORT ( port2 ); if ( valid_1 && valid_2 ) { @@ -306,31 +306,31 @@ bool KMFCheckInput::checkPORTRANGE ( QString inp ) { return false; } -bool KMFCheckInput::checkNetWork ( QString inp ) { +bool KMFCheckInput::checkNetWork ( TQString inp ) { bool valid_address = false; - bool valid_mask = false; + bool valid_tqmask = false; kdDebug() << "Checking for NETWORK: " << endl; - int delimiter = inp.find( "/" ); + int delimiter = inp.tqfind( "/" ); if ( delimiter == -1 ) { kdDebug() << "This is no network" << endl; return false; } else { - QString addr = inp.left( delimiter ); - QString mask = inp.right( inp.length() - ( delimiter + 1 ) ); + TQString addr = inp.left( delimiter ); + TQString tqmask = inp.right( inp.length() - ( delimiter + 1 ) ); kdDebug() << "Found address: " << addr << endl; - kdDebug() << "Found mask: " << mask << endl; - if ( mask.isEmpty() ) { + kdDebug() << "Found tqmask: " << tqmask << endl; + if ( tqmask.isEmpty() ) { // kdDebug() << "Mask is Empty\n" << endl; return false; } else { valid_address = checkIP( addr ); - valid_mask = checkIP( mask ); -// kdDebug() << "Mask address valid: " << valid_mask << endl; - if ( !valid_mask ) { - valid_mask = checkNetMask ( mask ); -// kdDebug() << "Mask number valid: " << valid_mask << endl; + valid_tqmask = checkIP( tqmask ); +// kdDebug() << "Mask address valid: " << valid_tqmask << endl; + if ( !valid_tqmask ) { + valid_tqmask = checkNetMask ( tqmask ); +// kdDebug() << "Mask number valid: " << valid_tqmask << endl; } - if ( !valid_address || !valid_mask ) { + if ( !valid_address || !valid_tqmask ) { // kdDebug() << "This is no valid Network" << endl; return false; } else { @@ -341,42 +341,42 @@ bool KMFCheckInput::checkNetWork ( QString inp ) { } } -bool KMFCheckInput::checkFQHN( QString inp ) { +bool KMFCheckInput::checkFTQHN( TQString inp ) { bool valid = TRUE; - // QRegExp exp( "^(\\w{1,256})\\.([a-z]{2,6})$", false ); - QRegExp exp( "^[0-9a-zA-Z_-\\.]{3,256}$", false ); - if ( !inp.contains( exp ) ) + // TQRegExp exp( "^(\\w{1,256})\\.([a-z]{2,6})$", false ); + TQRegExp exp( "^[0-9a-zA-Z_-\\.]{3,256}$", false ); + if ( !inp.tqcontains( exp ) ) valid = false; return valid; } -bool KMFCheckInput::checkMAC( QString inp ) { +bool KMFCheckInput::checkMAC( TQString inp ) { bool valid = TRUE; - QRegExp exp( "^[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}$", false ); - if ( !inp.contains( exp ) ) + TQRegExp exp( "^[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}$", false ); + if ( !inp.tqcontains( exp ) ) valid = false; return valid; } -bool KMFCheckInput::checkChainName( QString inp ) { +bool KMFCheckInput::checkChainName( TQString inp ) { bool valid = TRUE; - QRegExp exp( "^[a-zA-Z0-9_]{1,29}$", false ); - if ( !inp.contains( exp ) ) + TQRegExp exp( "^[a-zA-Z0-9_]{1,29}$", false ); + if ( !inp.tqcontains( exp ) ) valid = false; return valid; } -bool KMFCheckInput::checkRuleName( QString inp ) { +bool KMFCheckInput::checkRuleName( TQString inp ) { bool valid = TRUE; - QRegExp exp( "^[a-zA-Z0-9_-]{1,20}$", false ); - if ( !inp.contains( exp ) ) + TQRegExp exp( "^[a-zA-Z0-9_-]{1,20}$", false ); + if ( !inp.tqcontains( exp ) ) valid = false; return valid; } void KMFCheckInput::generateMsgDict() { - QString key = "IP/NETWORK/FQHN"; - const QString *msg = new QString( i18n( "<p><b>This is not a numerical IP or NETWORK therefore this can only be a HOSTNAME;</b><br>" + TQString key = "IP/NETWORK/FTQHN"; + const TQString *msg = new TQString( i18n( "<p><b>This is not a numerical IP or NETWORK therefore this can only be a HOSTNAME;</b><br>" "there is nothing wrong with that except that you will need to " "have a working name resolution (e.g. DNS) at firewall startup<br>" "and hence the network needs to be up before the firewall can be started. " @@ -390,28 +390,28 @@ void KMFCheckInput::generateMsgDict() { m_msg_dict.insert( key, msg ); key = "IP"; - const QString *msg2 = new QString( i18n( "<p>This is not a valid IP address or hostname." + const TQString *msg2 = new TQString( i18n( "<p>This is not a valid IP address or hostname." "<p>An IP address has the format: [0-255].[0-255].[0-255].[0-255]" ) ); m_msg_dict.insert( key, msg2 ); - key = "FQHN"; - const QString *msg3 = new QString( i18n( "<p>This is not a valid IP address or hostname." + key = "FTQHN"; + const TQString *msg3 = new TQString( i18n( "<p>This is not a valid IP address or hostname." "<p>A hostname looks like www.suse.com" ) ); m_msg_dict.insert( key, msg3 ); key = "CHAINNAME"; - const QString *msg4 = new QString( i18n( "<p>This is not a valid chain name." + const TQString *msg4 = new TQString( i18n( "<p>This is not a valid chain name." "<p>Chain names <b>must not</b> contain special characters (like whitespace, ?, &, %, etc.) " "and <b>must not</b> be longer then 29 characters" ) ); m_msg_dict.insert( key, msg4 ); key = "MAC"; - const QString *msg5 = new QString( i18n( "<p>This is not a valid MAC address." + const TQString *msg5 = new TQString( i18n( "<p>This is not a valid MAC address." "<p>A MAC address has six hex digits from 00-FF<br>A valid address could be: <b>02:E4:5A:90:1B:3C</b>" ) ); m_msg_dict.insert( key, msg5 ); key = "PORT"; - const QString *msg6 = new QString( i18n( "<p><b>This is not a valid numeric PORT number.</b><br>" + const TQString *msg6 = new TQString( i18n( "<p><b>This is not a valid numeric PORT number.</b><br>" "Port numbers are all numbers from 1 to 65535.<br> " "If you specified a service name (e.g. ssh or www) like they are listed " "in <i>/etc/services</i> the rule will work, but it is highly recommended " @@ -421,13 +421,13 @@ void KMFCheckInput::generateMsgDict() { m_msg_dict.insert( key, msg6 ); key = "MULTIPORT"; - const QString *msg7 = new QString( i18n( "<p>This is not a valid MULTIPORT string.<br>" + const TQString *msg7 = new TQString( i18n( "<p>This is not a valid MULTIPORT string.<br>" "A MULTIPORT strings is a comma separated list of PORT numbers.<br>" "Please not that service names are not supported within MULTIPORT strings." ) ); m_msg_dict.insert( key, msg7 ); key = "RULENAME"; - const QString *msg8 = new QString( i18n( "<p>This is not a valid rule name." + const TQString *msg8 = new TQString( i18n( "<p>This is not a valid rule name." "<p>Rule names <b>must not</b> contain special characters (like whitespace, ?, &, %, etc.) " "and <b>must not</b> be longer then 20 characters" ) ); m_msg_dict.insert( key, msg8 ); diff --git a/kmyfirewall/core/kmfcheckinput.h b/kmyfirewall/core/kmfcheckinput.h index 4b85159..bc6ec1b 100644 --- a/kmyfirewall/core/kmfcheckinput.h +++ b/kmyfirewall/core/kmfcheckinput.h @@ -21,10 +21,10 @@ *@author Christian Hubinger */ -#include <qdict.h> +#include <tqdict.h> #include <kdemacros.h> -class QString; +class TQString; namespace KMF { class KMFError; @@ -36,42 +36,42 @@ public: /** Check the given input string is it matches the criterias for the given input type */ - void checkInput( const QString& inp, const QString& inp_type, KMFError* ); + void checkInput( const TQString& inp, const TQString& inp_type, KMFError* ); private: // functions void generateMsgDict(); /** Check if inp is a IP address */ - bool checkIP( QString input ); + bool checkIP( TQString input ); - /** Check if inp is a FQHN */ - bool checkFQHN( QString inp ); + /** Check if inp is a FTQHN */ + bool checkFTQHN( TQString inp ); /** Check if inp can be a chain name */ - bool checkChainName( QString inp ); + bool checkChainName( TQString inp ); /** Check if inp can be a rule name */ - bool checkRuleName( QString inp ); + bool checkRuleName( TQString inp ); /** Check if inp is a MAC address */ - bool checkMAC( QString inp ); + bool checkMAC( TQString inp ); - /** Check if inp is a net mask */ - bool checkNetMask ( QString inp ); + /** Check if inp is a net tqmask */ + bool checkNetMask ( TQString inp ); /** Check if inp is a network */ - bool checkNetWork ( QString inp ); + bool checkNetWork ( TQString inp ); /** Check if inp is a port */ - bool checkPORT( QString inp ); + bool checkPORT( TQString inp ); /** Check if inp is a portrange */ - bool checkPORTRANGE( QString inp ); + bool checkPORTRANGE( TQString inp ); /** Check if inp is a multiport string */ - bool checkMULTIPORT( QString inp ); + bool checkMULTIPORT( TQString inp ); private: // data - QDict<QString> m_msg_dict; + TQDict<TQString> m_msg_dict; }; } #endif diff --git a/kmyfirewall/core/kmfcompilerinterface.cpp b/kmyfirewall/core/kmfcompilerinterface.cpp index 4ccfb9d..fab8a24 100644 --- a/kmyfirewall/core/kmfcompilerinterface.cpp +++ b/kmyfirewall/core/kmfcompilerinterface.cpp @@ -26,8 +26,8 @@ KMFCompilerInterface::~KMFCompilerInterface() { kdDebug() << "Calling Destructor: KMFCompilerInterface::~KMFCompilerInterface()" << endl; } -const QString& KMFCompilerInterface::compile( KMFIPTDoc* ) { - return *( new QString("ERROR: This compiler can not compile for KMFIPTDoc") ); +const TQString& KMFCompilerInterface::compile( KMFIPTDoc* ) { + return *( new TQString("ERROR: This compiler can not compile for KMFIPTDoc") ); } } diff --git a/kmyfirewall/core/kmfcompilerinterface.h b/kmyfirewall/core/kmfcompilerinterface.h index 166ad58..f9cb80a 100644 --- a/kmyfirewall/core/kmfcompilerinterface.h +++ b/kmyfirewall/core/kmfcompilerinterface.h @@ -17,8 +17,8 @@ */ // QT includes -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> // KDE Includes #include <kparts/plugin.h> @@ -35,16 +35,16 @@ class KMFIPTDoc; class KDE_EXPORT KMFCompilerInterface { public: -// KMFCompilerInterface( QObject* parent , const char* name ) : KParts::Plugin( parent , name ) {}; +// KMFCompilerInterface( TQObject* tqparent , const char* name ) : KParts::Plugin( tqparent , name ) {}; KMFCompilerInterface(); virtual ~KMFCompilerInterface(); virtual void compile() = 0; - virtual const QString& compile( KMFGenericDoc* ) = 0; - virtual const QString& compile( KMFIPTDoc* ); - virtual const QString& osName() = 0; - virtual const QString& osGUIName() = 0; - virtual const QString& backendName() = 0; - virtual const QString& backendGUIName() = 0; + virtual const TQString& compile( KMFGenericDoc* ) = 0; + virtual const TQString& compile( KMFIPTDoc* ); + virtual const TQString& osName() = 0; + virtual const TQString& osGUIName() = 0; + virtual const TQString& backendName() = 0; + virtual const TQString& backendGUIName() = 0; }; } #endif diff --git a/kmyfirewall/core/kmfdoc.cpp b/kmyfirewall/core/kmfdoc.cpp index 4d2ce73..c119f34 100644 --- a/kmyfirewall/core/kmfdoc.cpp +++ b/kmyfirewall/core/kmfdoc.cpp @@ -22,22 +22,22 @@ #include <sys/stat.h> // QT includes -#include "qtextstream.h" -#include "qfile.h" -#include "qxml.h" -#include "qregexp.h" -#include "qptrlist.h" -#include "qmessagebox.h" -#include <qstringlist.h> -#include <qvbox.h> -#include <qlabel.h> +#include "tqtextstream.h" +#include "tqfile.h" +#include "tqxml.h" +#include "tqregexp.h" +#include "tqptrlist.h" +#include "tqmessagebox.h" +#include <tqstringlist.h> +#include <tqvbox.h> +#include <tqlabel.h> // KDE includes #include <kdebug.h> #include <kstandarddirs.h> #include <kfiledialog.h> #include <kurl.h> -#include <qfiledialog.h> +#include <tqfiledialog.h> #include <kio/job.h> #include <kio/netaccess.h> #include <klocale.h> @@ -62,8 +62,8 @@ namespace KMF { -KMFDoc::KMFDoc( NetfilterObject *parent, const char *name ) : NetfilterObject( parent, name ) { - kdDebug() << "KMFDoc::KMFDoc( QObject *parent, const char *name ) : NetfilterObject( parent )" << endl; +KMFDoc::KMFDoc( NetfilterObject *tqparent, const char *name ) : NetfilterObject( tqparent, name ) { + kdDebug() << "KMFDoc::KMFDoc( TQObject *tqparent, const char *name ) : NetfilterObject( tqparent )" << endl; /* NetfilterObject::setName( i18n( "Unnamed Document" ) ); NetfilterObject::setDescription( i18n( "No Description Available" ) );*/ m_newSavePathNeeded = true; @@ -81,18 +81,18 @@ bool KMFDoc::newSavePathNeeded() { return m_newSavePathNeeded; } -const QString& KMFDoc::docName() { +const TQString& KMFDoc::docName() { if ( m_url.isEmpty() ) { - return *( new QString( i18n("Unnamed Document") ) ); + return *( new TQString( i18n("Unnamed Document") ) ); } else { - return *( new QString( m_url.fileName() ) ); + return *( new TQString( m_url.fileName() ) ); } } void KMFDoc::resetUrl() { - m_url.setHost( QString::null ); - m_url.setPath( QString::null ); - m_url.setProtocol( QString::null ); + m_url.setHost( TQString() ); + m_url.setPath( TQString() ); + m_url.setProtocol( TQString() ); NetfilterObject::setName( i18n( "Unnamed Document" ) ); NetfilterObject::setDescription( i18n( "No Description Available" ) ); m_newSavePathNeeded = true; @@ -115,32 +115,32 @@ KMFError* KMFDoc::exportXMLRuleset( bool promptFile, bool asTemplate ) { if ( promptFile ) { // KURL url; // bool chooseTemlate = false; - QString path = ":"; - QString filter = "*.kmfrs|KMyFirewall IPTables Ruleset (*.kmfrs)"; + TQString path = ":"; + TQString filter = "*.kmfrs|KMyFirewall IPTables Ruleset (*.kmfrs)"; - QString desc = i18n("KMyFirewall IPTables Ruleset (*.kmfrs)"); - QString tdesc = i18n("KMyFirewall IPTables Ruleset Template (*.tkmfrs)"); + TQString desc = i18n("KMyFirewall IPTables Ruleset (*.kmfrs)"); + TQString tdesc = i18n("KMyFirewall IPTables Ruleset Template (*.tkmfrs)"); - QString gdesc = i18n("KMyFirewall Generic Ruleset (*.kmfgrs)"); - QString tgdesc = i18n("KMyFirewall Generic Ruleset Template (*.tkmfgrs)"); + TQString gdesc = i18n("KMyFirewall Generic Ruleset (*.kmfgrs)"); + TQString tgdesc = i18n("KMyFirewall Generic Ruleset Template (*.tkmfgrs)"); - QString ndesc = i18n("KMyFirewall Network (*.kmfnet)"); + TQString ndesc = i18n("KMyFirewall Network (*.kmfnet)"); KStandardDirs std_dir; - QString tmp_dir = std_dir.findResourceDir( "data", "kmyfirewall/templates/" ); - QDir dir( tmp_dir + "/kmyfirewall/templates/" ); + TQString tmp_dir = std_dir.findResourceDir( "data", "kmyfirewall/templates/" ); + TQDir dir( tmp_dir + "/kmyfirewall/templates/" ); - filter = QString("*.kmfnet|" + ndesc ); + filter = TQString("*.kmfnet|" + ndesc ); /* saveUrl = KFileDialog::getSaveURL( ":", "*.kmfnet|KMyFirewall Network (*.kmfnet)\n*.kmfgrs|KMyFirewall Generic Ruleset(*.kmfgrs)\n*.kmfrs|KMyFirewall IPTables Ruleset(*.kmfrs)" );*/ saveUrl = KFileDialog::getSaveURL( ":", getFileDialogFilter() ); // saveUrl = KFileDialog::getSaveURL( path, filter ); - QString filename = saveUrl.fileName(); + TQString filename = saveUrl.fileName(); if ( saveUrl.fileName().isEmpty() ) { return new KMFError(); } @@ -151,7 +151,7 @@ KMFError* KMFDoc::exportXMLRuleset( bool promptFile, bool asTemplate ) { return exportXMLRuleset( promptFile, asTemplate ); } else { answer = KMessageBox::questionYesNo( 0, i18n( "<qt>File <b>%1</b> already exists!</p>" - "<p><b>Overwrite the existing file?</b></p></qt>" ).arg( saveUrl.url() ) ); + "<p><b>Overwrite the existing file?</b></p></qt>" ).tqarg( saveUrl.url() ) ); } } else { answer = 3; @@ -165,14 +165,14 @@ KMFError* KMFDoc::exportXMLRuleset( bool promptFile, bool asTemplate ) { KMFError* KMFDoc::exportXMLRuleset( const KURL& url ) { kdDebug() << "bool KMFIPTDoc::exportXMLRuleset(const KURL& " << url.url() << " )" << endl; KTempFile file; - const QString& xml = getXMLSniplet(); + const TQString& xml = getXMLSniplet(); // kdDebug() << "Writing XML:\n " << xml << endl; - if ( file.name() != QString::null ) { - QFile f( file.name() ); + if ( file.name() != TQString() ) { + TQFile f( file.name() ); f.remove(); bool isWriteable = f.open( IO_ReadWrite ); if ( isWriteable ) { - QTextStream ts( &f ); + TQTextStream ts( &f ); ts << xml << endl; f.flush(); f.close(); @@ -184,7 +184,7 @@ KMFError* KMFDoc::exportXMLRuleset( const KURL& url ) { "<p>Please make sure that you have the permissions to write to this Directory.<br>" "If you are working with remotely stored files " "make sure that the target host and the directory is reachable. " - "</p></qt>" ).arg( url.url() ) ); + "</p></qt>" ).tqarg( url.url() ) ); file.unlink(); return m_err; } @@ -200,8 +200,8 @@ KMFError* KMFDoc::exportXMLRuleset( const KURL& url ) { } else { // generate retrun error object m_err -> setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file %1 for writing failed.\n" - "Please make sure that you are logged in as root" ).arg( file.name() ); + const TQString& msg = i18n( "Opening file %1 for writing failed.\n" + "Please make sure that you are logged in as root" ).tqarg( file.name() ); m_err -> setErrMsg( msg ); file.unlink(); return m_err; @@ -210,25 +210,25 @@ KMFError* KMFDoc::exportXMLRuleset( const KURL& url ) { } else { // generate retrun error object m_err -> setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file %1 for writing failed.\n" - "Please make sure that you are logged in as root" ).arg( file.name() ); + const TQString& msg = i18n( "Opening file %1 for writing failed.\n" + "Please make sure that you are logged in as root" ).tqarg( file.name() ); m_err -> setErrMsg( msg ); file.unlink(); return m_err; } // generate retrun error object m_err -> setErrType( KMFError::FATAL ); - const QString& msg = i18n( "File to save = QString::null. This is a bug." ); + const TQString& msg = i18n( "File to save = TQString(). This is a bug." ); m_err -> setErrMsg( msg ); file.unlink(); return m_err; } -const QString& KMFDoc::getXMLSniplet() { - return *( new QString( getDOMTree().toString() ) ); +const TQString& KMFDoc::getXMLSniplet() { + return *( new TQString( getDOMTree().toString() ) ); } -const QString& KMFDoc::getXMLRuleset() { +const TQString& KMFDoc::getXMLRuleset() { return getXMLSniplet(); } diff --git a/kmyfirewall/core/kmfdoc.h b/kmyfirewall/core/kmfdoc.h index 4db29f2..f85c28c 100644 --- a/kmyfirewall/core/kmfdoc.h +++ b/kmyfirewall/core/kmfdoc.h @@ -24,11 +24,11 @@ email : chubinger@irrsinnig.org #include "netfilterobject.h" // qt includes -#include "qdict.h" -#include "qvaluelist.h" -#include "qptrlist.h" -#include "qstring.h" -#include "qobject.h" +#include "tqdict.h" +#include "tqvaluelist.h" +#include "tqptrlist.h" +#include "tqstring.h" +#include "tqobject.h" // kde includes #include "kurl.h" @@ -55,49 +55,50 @@ class KMFTarget; class KDE_EXPORT KMFDoc : public NetfilterObject { Q_OBJECT + TQ_OBJECT public: - KMFDoc( NetfilterObject* parent, const char* name ); + KMFDoc( NetfilterObject* tqparent, const char* name ); virtual ~KMFDoc(); /** resets the document to the initial values */ virtual void clear() = 0; -// /** return a QString containing the documents script to +// /** return a TQString containing the documents script to // setup the firewall configuration */ -// virtual const QString& compile() = 0; +// virtual const TQString& compile() = 0; /** Writes the xml-representation of this document a String and returns it. */ - virtual const QString& getXMLRuleset(); + virtual const TQString& getXMLRuleset(); /** return true if the document is in it's initial state */ virtual bool isEmpty() = 0; // /** Writes the shellscrip that contains the iptables commands to settup // the firewall to file. -// If file = QString::null a SaveAs dialog will popup. */ -// KMFError* createFirewallScript( const QString& fi ); +// If file = TQString() a SaveAs dialog will popup. */ +// KMFError* createFirewallScript( const TQString& fi ); // /** Return DomDocument of this Chain */ -// virtual const QDomDocument& getDOMTree() = 0; +// virtual const TQDomDocument& getDOMTree() = 0; - /** Return String representation of the DomDocument generated by const QDomDocument& getDOMTree() */ - virtual const QString& getXMLSniplet(); + /** Return String representation of the DomDocument generated by const TQDomDocument& getDOMTree() */ + virtual const TQString& getXMLSniplet(); - /** Load configuratuion from the QDomDocument */ -// virtual void loadXML( const QDomDocument&, QStringList& errors ) = 0; + /** Load configuratuion from the TQDomDocument */ +// virtual void loadXML( const TQDomDocument&, TQStringList& errors ) = 0; - /** Load configuratuion from the QDomDocument */ -// virtual void loadXML( QDomNode, QStringList& errors ) = 0; + /** Load configuratuion from the TQDomDocument */ +// virtual void loadXML( TQDomNode, TQStringList& errors ) = 0; /** Save the rule set to the given file defined by the KURL */ virtual KMFError* exportXMLRuleset( bool promptFile, bool asTemplate ); /** Get the File dialog filter string for the document type */ - virtual const QString& getFileDialogFilter() = 0; + virtual const TQString& getFileDialogFilter() = 0; /** Load the ruleset from the given url */ - virtual void parseDocument( const KURL&, QStringList& errors ) = 0; + virtual void parseDocument( const KURL&, TQStringList& errors ) = 0; /** return the documents KURL pointer */ KURL& url(); @@ -106,18 +107,18 @@ public: void resetUrl(); /** Set Description for this Object */ -// virtual void setDescription( const QString& ) = 0; +// virtual void setDescription( const TQString& ) = 0; /** Return the Object's Description */ -/* const QString description() const { +/* const TQString description() const { return m_description; };*/ /** Set Name for this Object */ -// virtual void setName( const QString& ) = 0; +// virtual void setName( const TQString& ) = 0; /** Return the Object's Description */ - virtual const QString& docName(); + virtual const TQString& docName(); // void objChanged(); diff --git a/kmyfirewall/core/kmferror.cpp b/kmyfirewall/core/kmferror.cpp index 13c2219..f05a043 100644 --- a/kmyfirewall/core/kmferror.cpp +++ b/kmyfirewall/core/kmferror.cpp @@ -16,7 +16,7 @@ #include "kmferror.h" // QT includes -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <kdebug.h> @@ -28,17 +28,17 @@ namespace KMF { -KMFError* KMFError::parseErrors( QStringList& errors ) { +KMFError* KMFError::parseErrors( TQStringList& errors ) { KMFError *err = new KMFError(); - QStringList::iterator it = errors.begin(); - QString msg = ""; + TQStringList::iterator it = errors.begin(); + TQString msg = ""; while( it != errors.end() ) { - QString s = *it; + TQString s = *it; kdDebug() << "Parsing Error: " << s << endl; msg += s; - if ( s.contains( i18n("WARNING: ") ) != 0 && err->errType() == KMFError::OK ) { + if ( s.tqcontains( i18n("WARNING: ") ) != 0 && err->errType() == KMFError::OK ) { err->setErrType( KMFError::HINT ); - } else if ( s.contains( i18n("ERROR: ") ) != 0 ) { + } else if ( s.tqcontains( i18n("ERROR: ") ) != 0 ) { err->setErrType( KMFError::FATAL ); } ++it; @@ -48,8 +48,8 @@ KMFError* KMFError::parseErrors( QStringList& errors ) { return err; } -const QString& KMFError::getAsString( int error_type, const QString& msg ) { - QString s; +const TQString& KMFError::getAsString( int error_type, const TQString& msg ) { + TQString s; s += "<b>"; if ( error_type == KMFError::OK ) { s += "<font color=\"green\">" + i18n("SUCCESS: "); @@ -61,7 +61,7 @@ const QString& KMFError::getAsString( int error_type, const QString& msg ) { s += "</font></b> "; s += msg; s += "<br />"; - return *( new QString( s ) ); + return *( new TQString( s ) ); } //########### end static ##############// @@ -74,7 +74,7 @@ KMFError::KMFError() { } KMFError::~KMFError() {} -void KMFError::setErrMsg( const QString &msg ) { +void KMFError::setErrMsg( const TQString &msg ) { m_err_msg = msg; } diff --git a/kmyfirewall/core/kmferror.h b/kmyfirewall/core/kmferror.h index 04917fc..0121a40 100644 --- a/kmyfirewall/core/kmferror.h +++ b/kmyfirewall/core/kmferror.h @@ -16,9 +16,9 @@ #ifndef KMFERROR_H #define KMFERROR_H -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> -#include <qstringlist.h> +#include <tqstringlist.h> /** *@author Christian Hubinger @@ -32,8 +32,8 @@ class KDE_EXPORT KMFError { public: /** Contains the option commands for each option type. */ - static KMFError* parseErrors( QStringList& errors ); - static const QString& getAsString( int error_type, const QString& msg ); + static KMFError* parseErrors( TQStringList& errors ); + static const TQString& getAsString( int error_type, const TQString& msg ); public: KMFError(); @@ -42,13 +42,13 @@ public: enum { OK = 0, HINT = 1, NORMAL = 2, FATAL = 3, WARNING = 4 }; /** Set the error message */ - void setErrMsg( const QString& msg ); + void setErrMsg( const TQString& msg ); /** Sets the message type */ void setErrType( int type ); /** get the Error message */ - const QString& errMsg() const { + const TQString& errMsg() const { return m_err_msg; }; @@ -64,7 +64,7 @@ public: private: int m_err_type; - QString m_err_msg; + TQString m_err_msg; int m_err_num; }; } diff --git a/kmyfirewall/core/kmferrorhandler.cpp b/kmyfirewall/core/kmferrorhandler.cpp index 667f6c7..ebe51be 100644 --- a/kmyfirewall/core/kmferrorhandler.cpp +++ b/kmyfirewall/core/kmferrorhandler.cpp @@ -17,7 +17,7 @@ // QT includes #include <kmessagebox.h> -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <kdebug.h> @@ -27,14 +27,14 @@ namespace KMF { -KMFErrorHandler::KMFErrorHandler( const QString& name ) { - m_caller_name = new QString( name ); +KMFErrorHandler::KMFErrorHandler( const TQString& name ) { + m_caller_name = new TQString( name ); } KMFErrorHandler::~KMFErrorHandler() {} bool KMFErrorHandler::showError( KMFError* err ) { // kdDebug() << "KMFErrorHandler::showError(KMFError* err)" << endl; - QString header = ""; + TQString header = ""; if ( err->errType() == KMFError::OK ) { // kdDebug() << "Found Error Type: KMFError::OK" << endl; return true; @@ -43,7 +43,7 @@ bool KMFErrorHandler::showError( KMFError* err ) { if ( err->errType() == KMFError::HINT ) { // kdDebug() << "Found Error Type: KMFError::HINT" << endl; header += i18n( "Hint" ); - const QString err_msg = err->errMsg(); + const TQString err_msg = err->errMsg(); // kdDebug() << "Error Msg: " + err_msg << endl; KMessageBox::information( 0, err_msg, header, err_msg); return true; @@ -51,7 +51,7 @@ bool KMFErrorHandler::showError( KMFError* err ) { if ( err->errType() == KMFError::NORMAL ) { // kdDebug() << "Found Error Type: KMFError::NORMAL " << endl; header += *m_caller_name; - const QString err_msg = err->errMsg(); + const TQString err_msg = err->errMsg(); // kdDebug() << "Error Msg: " + err_msg << endl; KMessageBox::sorry( 0, err_msg, header ); return false; @@ -60,7 +60,7 @@ bool KMFErrorHandler::showError( KMFError* err ) { if ( err->errType() == KMFError::FATAL ) { // kdDebug() << "Found Error Type: KMFError::FATAL" << endl; header += *m_caller_name; - const QString err_msg = err->errMsg(); + const TQString err_msg = err->errMsg(); // kdDebug() << "Error Msg: " + err_msg << endl; KMessageBox::error( 0, err_msg, header ); return false; diff --git a/kmyfirewall/core/kmferrorhandler.h b/kmyfirewall/core/kmferrorhandler.h index 1df496f..0b6611c 100644 --- a/kmyfirewall/core/kmferrorhandler.h +++ b/kmyfirewall/core/kmferrorhandler.h @@ -21,14 +21,14 @@ /** *@author Christian Hubinger */ -class QString; +class TQString; namespace KMF { class KMFError; class KDE_EXPORT KMFErrorHandler { public: - KMFErrorHandler( const QString& name ); + KMFErrorHandler( const TQString& name ); ~KMFErrorHandler(); /** Show a messagebox with the error message if the @@ -36,7 +36,7 @@ public: bool showError( KMFError* err ); private: - QString *m_caller_name; + TQString *m_caller_name; }; } diff --git a/kmyfirewall/core/kmfgenericdoc.cpp b/kmyfirewall/core/kmfgenericdoc.cpp index 91f5e21..b94f328 100644 --- a/kmyfirewall/core/kmfgenericdoc.cpp +++ b/kmyfirewall/core/kmfgenericdoc.cpp @@ -24,10 +24,10 @@ // QT includes -#include <qfile.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> // KDE includes #include <kapplication.h> @@ -55,8 +55,8 @@ namespace KMF { -KMFGenericDoc::KMFGenericDoc( NetfilterObject* parent, const char* name, KMFTarget* target ) : KMFDoc( parent, name ), KMFRulesetDoc( target ) { - kdDebug() << "KMFGenericDoc::KMFGenericDoc( QObject *parent, const char *name ) : KMFDoc( parent, name )" << endl; +KMFGenericDoc::KMFGenericDoc( NetfilterObject* tqparent, const char* name, KMFTarget* target ) : KMFDoc( tqparent, name ), KMFRulesetDoc( target ) { + kdDebug() << "KMFGenericDoc::KMFGenericDoc( TQObject *tqparent, const char *name ) : KMFDoc( tqparent, name )" << endl; m_zones.setAutoDelete( false ); m_zone_incoming = 0; m_zone_outgoing = 0; @@ -136,9 +136,9 @@ void KMFGenericDoc::initDoc() { m_zone_badClients->setZone( IPAddress( 0, 0, 0, 0 ),0 ); m_zone_badServers->setZone( IPAddress( 0, 0, 0, 0 ), 0 ); - m_zone_incoming->setDescription( i18n( "This is the global zone that contains\n" + m_zone_incoming->setDescription( i18n( "This is the global zone that tqcontains\n" "all valid IP addresses." ) ); - m_zone_outgoing->setDescription( i18n( "This is the global zone that contains\n" + m_zone_outgoing->setDescription( i18n( "This is the global zone that tqcontains\n" "all valid IP addresses." ) ); m_zone_trusted->setDescription( i18n( "Traffic coming from and going to hosts\n" "will be accepted always.\n" @@ -151,8 +151,8 @@ void KMFGenericDoc::initDoc() { "of the hosts in that list." ) ); } -const QString& KMFGenericDoc::getFileDialogFilter() { - return *( new QString("*.kmfgrs|KMyFirewall Generic Ruleset(*.kmfgrs)") ); +const TQString& KMFGenericDoc::getFileDialogFilter() { + return *( new TQString("*.kmfgrs|KMyFirewall Generic Ruleset(*.kmfgrs)") ); } @@ -172,7 +172,7 @@ void KMFGenericDoc::setLimitLog( bool onoff ) { m_limitLog = onoff; } -void KMFGenericDoc::setLogPrefix( const QString& pre ) { +void KMFGenericDoc::setLogPrefix( const TQString& pre ) { if ( ! pre.isNull() ) m_logPrefix = pre; else @@ -201,25 +201,25 @@ void KMFGenericDoc::setUseMasquerade( bool onoff ) { m_useMasquerade = onoff; } -void KMFGenericDoc::setNatAddress( const QString& addr ) { +void KMFGenericDoc::setNatAddress( const TQString& addr ) { m_natAddress->setAddress( addr ); } -void KMFGenericDoc::setOutgoingInterface( const QString& str ) { +void KMFGenericDoc::setOutgoingInterface( const TQString& str ) { m_outgoingInterface = str; } -QPtrList<KMFNetZone>& KMFGenericDoc::zones() const { - QPtrList<KMFNetZone>* ret_val = new QPtrList<KMFNetZone>; +TQPtrList<KMFNetZone>& KMFGenericDoc::zones() const { + TQPtrList<KMFNetZone>* ret_val = new TQPtrList<KMFNetZone>; *ret_val = m_zones; return *ret_val; } -KMFNetZone* KMFGenericDoc::addZone( const QString& name, KMFError* err ) { -// kdDebug() << "KMFNetZone* addZone( const QString& name, KMFError* err )" << endl; +KMFNetZone* KMFGenericDoc::addZone( const TQString& name, KMFError* err ) { +// kdDebug() << "KMFNetZone* addZone( const TQString& name, KMFError* err )" << endl; bool found = false; - QPtrListIterator<KMFNetZone> it ( m_zones ); + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() && ! found ) { KMFNetZone * zone = it.current(); ++it; @@ -230,7 +230,7 @@ KMFNetZone* KMFGenericDoc::addZone( const QString& name, KMFError* err ) { err->setErrType( KMFError::NORMAL ); err->setErrMsg( i18n( "<qt>Sorry, cannot create Zone with name '<b>%1</b>':<br>" "there already exists a zone with that name. Please try again" - " with another name that is unique within your configuration.</qt>" ).arg(name) ); + " with another name that is unique within your configuration.</qt>" ).tqarg(name) ); return 0; } @@ -241,9 +241,9 @@ KMFNetZone* KMFGenericDoc::addZone( const QString& name, KMFError* err ) { } KMFError* KMFGenericDoc::delZone( KMFNetZone* zone ) { -// kdDebug() << "KMFError* delZone( const QString& name )" << endl; +// kdDebug() << "KMFError* delZone( const TQString& name )" << endl; bool found = false; - QPtrListIterator<KMFNetZone> it ( m_zones ); + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() && ! found ) { KMFNetZone * z = it.current(); ++it; @@ -258,14 +258,14 @@ KMFError* KMFGenericDoc::delZone( KMFNetZone* zone ) { m_err->setErrType( KMFError::NORMAL ); m_err->setErrMsg( i18n( "<qt>Sorry, cannot create Zone with name: <b>%1</b>.<br>" "There already exists a zone with that name; please try again" - " with another name that is unique within your configuration.</qt>" ).arg( zone->name() ) ); + " with another name that is unique within your configuration.</qt>" ).tqarg( zone->name() ) ); } return m_err; } -KMFNetZone* KMFGenericDoc::findZone( const QString& name ) const { -// kdDebug() << "KMFNetZone* KMFGenericDoc::findZone( const QString& name ) const" << endl; - QPtrListIterator<KMFNetZone> it ( m_zones ); +KMFNetZone* KMFGenericDoc::findZone( const TQString& name ) const { +// kdDebug() << "KMFNetZone* KMFGenericDoc::findZone( const TQString& name ) const" << endl; + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() ) { KMFNetZone *z = it.current(); ++it; @@ -275,18 +275,18 @@ KMFNetZone* KMFGenericDoc::findZone( const QString& name ) const { return 0; } -const QString& KMFGenericDoc::compile() { -// kdDebug() << "const QString& KMFGenericDoc::compile()" << endl; +const TQString& KMFGenericDoc::compile() { +// kdDebug() << "const TQString& KMFGenericDoc::compile()" << endl; KMFCompilerInterface* compiler = target()->compiler(); if ( ! compiler ) { - return *( new QString("ERROR") ); + return *( new TQString("ERROR") ); } return compiler->compile( this ); } -void KMFGenericDoc::parseDocument( const KURL& url, QStringList& errors ) { +void KMFGenericDoc::parseDocument( const KURL& url, TQStringList& errors ) { // kdDebug() << "KMFDoc* KMFGenericDoc::parseDocument( const KURL& )" << endl; - QString xmlfile; + TQString xmlfile; if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) { clear(); m_url.setFileName( i18n( "Untitled" ) ); @@ -298,8 +298,8 @@ void KMFGenericDoc::parseDocument( const KURL& url, QStringList& errors ) { // kdDebug() << "Found xmlfile: " << xmlfile << endl; // delete old chainsets if there clear(); - QFile kmfrsFile( xmlfile ); - QDomDocument domTree; + TQFile kmfrsFile( xmlfile ); + TQDomDocument domTree; if ( !kmfrsFile.open( IO_ReadOnly ) ) { return; // return 0; @@ -326,10 +326,10 @@ void KMFGenericDoc::parseDocument( const KURL& url, QStringList& errors ) { // return this; } -const QDomDocument& KMFGenericDoc::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFGenericDoc::getDOMTree()" << endl; - QDomDocument doc( "kmyfirewall-ruleset" ); - QDomElement root = doc.createElement( XML::GenericDoc_DocumentElement ); +const TQDomDocument& KMFGenericDoc::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFGenericDoc::getDOMTree()" << endl; + TQDomDocument doc( "kmyfirewall-ruleset" ); + TQDomElement root = doc.createElement( XML::GenericDoc_DocumentElement ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION ); root.setAttribute( XML::MinVersion_Attribute, "1.0.0" ); @@ -341,7 +341,7 @@ const QDomDocument& KMFGenericDoc::getDOMTree() { root.appendChild( m_zone_badServers->getDOMTree() ); root.appendChild( m_zone_malicious->getDOMTree() ); root.appendChild( m_zone_trusted->getDOMTree() ); - QDomElement abstract = doc.createElement( XML::Abstract_Element ); + TQDomElement abstract = doc.createElement( XML::Abstract_Element ); if ( restrictOutgoingConnections() ) abstract.setAttribute( XML::RestrictOutgoingConnections_Attribute ,XML::BoolOn_Value ); else @@ -356,7 +356,7 @@ const QDomDocument& KMFGenericDoc::getDOMTree() { root.appendChild( abstract ); - QDomElement logging = doc.createElement( XML::Logging_Element ); + TQDomElement logging = doc.createElement( XML::Logging_Element ); if ( logDropped() ) logging.setAttribute( XML::LogDropped_Attribute, XML::BoolOn_Value ); else @@ -370,7 +370,7 @@ const QDomDocument& KMFGenericDoc::getDOMTree() { logging.setAttribute( XML::LogPrefix_Attribute, logPrefix() ); root.appendChild( logging ); - QDomElement icmp = doc.createElement( XML::ICMP_Element ); + TQDomElement icmp = doc.createElement( XML::ICMP_Element ); if ( allowPingReply() ) { icmp.setAttribute( XML::AllowPingReply_Attribute, XML::BoolOn_Value ); } else { @@ -383,7 +383,7 @@ const QDomDocument& KMFGenericDoc::getDOMTree() { icmp.setAttribute( XML::LimitPingReply_Attribute, XML::BoolOff_Value ); root.appendChild( icmp ); - QDomElement nat = doc.createElement( XML::NAT_Element ); + TQDomElement nat = doc.createElement( XML::NAT_Element ); if ( useNat() ) nat.setAttribute( XML::UseNat_Attribute, XML::BoolOn_Value ); else @@ -396,38 +396,38 @@ const QDomDocument& KMFGenericDoc::getDOMTree() { nat.setAttribute( XML::NatAddress_Attribute, m_natAddress->toString() ); - QString allowedIn = ""; + TQString allowedIn = ""; nat.setAttribute( XML::OutgoingInterface_Attribute, m_outgoingInterface ); root.appendChild( nat ); doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFGenericDoc::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void KMFGenericDoc::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFGenericDoc::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void KMFGenericDoc::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); if ( root.nodeName() != XML::GenericDoc_DocumentElement ) { kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl; - errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfgrs").arg( root.nodeName() ) ) ); + errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfgrs").tqarg( root.nodeName() ) ) ); return; } loadXML( root, errors ); } -void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) { -// void KMFGenericDoc::loadXML( const QDomDocument& doc ) { -// kdDebug() << "void KMFGenericDoc::loadXML( const QDomDocument& )" << endl; -// QDomElement root = doc.documentElement(); +void KMFGenericDoc::loadXML( TQDomNode root, TQStringList& errors ) { +// void KMFGenericDoc::loadXML( const TQDomDocument& doc ) { +// kdDebug() << "void KMFGenericDoc::loadXML( const TQDomDocument& )" << endl; +// TQDomElement root = doc.documentElement(); NetfilterObject::loadUuid ( root, errors ); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::NetZone_Element ) { - QString name = ""; + TQString name = ""; name = curr.toElement().attribute( XML::Name_Attribute ); - QDomDocument zone_doc; + TQDomDocument zone_doc; zone_doc.appendChild( curr.cloneNode(true) ); if ( name == "incoming_world" ) { // kdDebug() << "\nKMFIPTDoc: Start Parsing INCOMMING ZONES" << endl; @@ -461,9 +461,9 @@ void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) { } } else if ( curr.isElement() && curr.nodeName() == XML::Logging_Element ) { // kdDebug() << "\nKMFIPTDoc: Start Parsing Logging" << endl; - QString logDropped = ""; - QString limitLog = ""; - QString logPrefix = ""; + TQString logDropped = ""; + TQString limitLog = ""; + TQString logPrefix = ""; logDropped = curr.toElement().attribute( XML::LogDropped_Attribute ); limitLog = curr.toElement().attribute( XML::LimitLog_Attribute ); @@ -483,8 +483,8 @@ void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) { // kdDebug() << "KMFIPTDoc: Finished Parsing Logging" << endl; } else if ( curr.isElement() && curr.nodeName() == XML::ICMP_Element ) { // kdDebug() << "\nKMFIPTDoc: Start Parsing ICMP" << endl; - QString allowPing = ""; - QString limitPing = ""; + TQString allowPing = ""; + TQString limitPing = ""; allowPing = curr.toElement().attribute( XML::AllowPingReply_Attribute ); limitPing = curr.toElement().attribute( XML::LimitPingReply_Attribute ); @@ -501,10 +501,10 @@ void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) { // kdDebug() << "KMFIPTDoc: Finished Parsing ICMP" << endl; } else if ( curr.isElement() && curr.nodeName() == XML::NAT_Element ) { // kdDebug() << "\nKMFIPTDoc: Start Parsing NAT" << endl; - QString useNat = ""; - QString useMasquerade = ""; - QString natAddress = ""; - QString outgoingInterface = ""; + TQString useNat = ""; + TQString useMasquerade = ""; + TQString natAddress = ""; + TQString outgoingInterface = ""; useNat = curr.toElement().attribute( XML::UseNat_Attribute ); useMasquerade = curr.toElement().attribute( XML::UseMasquerade_Attribute ); natAddress = curr.toElement().attribute( XML::NatAddress_Attribute ); @@ -528,20 +528,20 @@ void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) { // kdDebug() << "KMFIPTDoc: Finished Parsing NAT" << endl; }else if ( curr.isElement() && curr.nodeName() == XML::Abstract_Element ) { kdDebug() << "KMFIPTDoc: Start Parsing Abstract" << endl; - QString allowIncomingConnections = ""; - QString restrictOutgoingConnections = ""; - QString description = ""; - QString name = ""; + TQString allowIncomingConnections = ""; + TQString restrictOutgoingConnections = ""; + TQString description = ""; + TQString name = ""; allowIncomingConnections =curr.toElement().attribute( XML::AllowIncomingConnections_Attribute ); restrictOutgoingConnections =curr.toElement().attribute( XML::RestrictOutgoingConnections_Attribute ); description += curr.toElement().attribute( XML::Description_Attribute ); if ( ! description.isNull() ) - setDescription( *( new QString( description ) ) ); + setDescription( *( new TQString( description ) ) ); name += curr.toElement().attribute( XML::Name_Attribute ); if ( ! name.isNull() ) - setName( *( new QString( name ) ) ); + setName( *( new TQString( name ) ) ); if ( allowIncomingConnections == XML::BoolOn_Value ) diff --git a/kmyfirewall/core/kmfgenericdoc.h b/kmyfirewall/core/kmfgenericdoc.h index 62ea2a2..91ba527 100644 --- a/kmyfirewall/core/kmfgenericdoc.h +++ b/kmyfirewall/core/kmfgenericdoc.h @@ -27,10 +27,10 @@ #include "kmfrulesetdoc.h" // QT includes -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqptrlist.h> // KDE includes @@ -62,20 +62,20 @@ public: bool isEmpty(); - /** return a QString containing the documents script to + /** return a TQString containing the documents script to setup the firewall configuration */ - const QString& compile(); + const TQString& compile(); /** Return DomDocument of this Chain */ - const QDomDocument& getDOMTree(); + const TQDomDocument& getDOMTree(); - virtual void loadXML( const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); virtual int type(); - virtual void parseDocument( const KURL&, QStringList& errors ); + virtual void parseDocument( const KURL&, TQStringList& errors ); /** Get the File dialog filter string for the document type */ - virtual const QString& getFileDialogFilter(); + virtual const TQString& getFileDialogFilter(); KMFNetZone *incomingZone() const { return m_zone_incoming; @@ -100,7 +100,7 @@ public: KMFNetZone *badClientsHostsZone() const { return m_zone_badClients; }; - QPtrList<KMFNetZone>& zones() const; + TQPtrList<KMFNetZone>& zones() const; bool restrictOutgoingConnections() const { return m_restrictOutgoingConnections; @@ -137,12 +137,12 @@ public: return m_natAddress; }; - void setNatAddress( const QString& ); + void setNatAddress( const TQString& ); - const QString& outgoingInterface() const { + const TQString& outgoingInterface() const { return m_outgoingInterface; }; - void setOutgoingInterface( const QString& ); + void setOutgoingInterface( const TQString& ); bool logDropped() const { return m_logDropped; @@ -154,23 +154,23 @@ public: }; void setLimitLog( bool ); - const QString& logPrefix() const { + const TQString& logPrefix() const { return m_logPrefix; }; - void setLogPrefix( const QString& ); + void setLogPrefix( const TQString& ); protected: void initDoc(); - KMFNetZone* addZone( const QString& name, KMFError* err ); + KMFNetZone* addZone( const TQString& name, KMFError* err ); KMFError* delZone( KMFNetZone* zone ); - KMFNetZone* findZone( const QString& name ) const; + KMFNetZone* findZone( const TQString& name ) const; private: // bool loadProtocolLibrary(); private: // DATA - // QPtrList<KMFProtocol> m_protocol_library; - QPtrList<KMFNetZone> m_zones; + // TQPtrList<KMFProtocol> m_protocol_library; + TQPtrList<KMFNetZone> m_zones; KMFNetZone* m_zone_incoming; KMFNetZone* m_zone_outgoing; @@ -182,7 +182,7 @@ private: // DATA bool m_useNat, m_useMasquerade, m_logDropped, m_limitLog; IPAddress *m_natAddress; - QString m_outgoingInterface, m_logPrefix; + TQString m_outgoingInterface, m_logPrefix; }; } diff --git a/kmyfirewall/core/kmfinstallerinterface.cpp b/kmyfirewall/core/kmfinstallerinterface.cpp index 3b33073..3f50eb0 100644 --- a/kmyfirewall/core/kmfinstallerinterface.cpp +++ b/kmyfirewall/core/kmfinstallerinterface.cpp @@ -15,7 +15,7 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001 #include <kdebug.h> // QT Inludes -#include <qvaluelist.h> +#include <tqvaluelist.h> // Project Includes #include "kmfpluginfactory.h" diff --git a/kmyfirewall/core/kmfinstallerinterface.h b/kmyfirewall/core/kmfinstallerinterface.h index c5e5438..a2a3619 100644 --- a/kmyfirewall/core/kmfinstallerinterface.h +++ b/kmyfirewall/core/kmfinstallerinterface.h @@ -15,10 +15,10 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001 #include <kdemacros.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> -class QString; -class QStringList; +class TQString; +class TQStringList; class KURL; namespace KMF { @@ -35,13 +35,13 @@ class KDE_EXPORT KMFInstallerInterface { virtual KMFCompilerInterface* compiler() = 0; virtual void cmdRunFW() = 0; virtual void cmdStopFW() = 0; - virtual void cmdShowRunningConfig( const QString& ) = 0; + virtual void cmdShowRunningConfig( const TQString& ) = 0; virtual void cmdInstallFW() = 0; virtual void cmdUninstallFW() = 0; virtual void generateInstallerPackage( KMFTarget *, const KURL& ) = 0; - virtual const QString& osName() const = 0; - virtual const QString& osGUIName() const = 0; - virtual QValueList<KMFCompilerInterface*>* compilers() = 0; + virtual const TQString& osName() const = 0; + virtual const TQString& osGUIName() const = 0; + virtual TQValueList<KMFCompilerInterface*>* compilers() = 0; }; } diff --git a/kmyfirewall/core/kmfiptdoc.cpp b/kmyfirewall/core/kmfiptdoc.cpp index 560eaad..fc111cd 100644 --- a/kmyfirewall/core/kmfiptdoc.cpp +++ b/kmyfirewall/core/kmfiptdoc.cpp @@ -31,22 +31,22 @@ #include <sys/stat.h> // QT includes -#include <qtextstream.h> -#include <qfile.h> -#include <qxml.h> -#include <qregexp.h> -#include <qptrlist.h> -#include <qmessagebox.h> -#include <qstringlist.h> -#include <qvbox.h> -#include <qlabel.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqxml.h> +#include <tqregexp.h> +#include <tqptrlist.h> +#include <tqmessagebox.h> +#include <tqstringlist.h> +#include <tqvbox.h> +#include <tqlabel.h> // KDE includes #include <kdebug.h> #include <kstandarddirs.h> #include <kfiledialog.h> #include <kurl.h> -#include <qfiledialog.h> +#include <tqfiledialog.h> #include <kio/job.h> #include <kio/netaccess.h> #include <klocale.h> @@ -79,7 +79,7 @@ namespace KMF { -KMFIPTDoc::KMFIPTDoc( NetfilterObject *parent, const char *name, KMFTarget* target ) : KMFDoc( parent, name ), KMFRulesetDoc( target ) { +KMFIPTDoc::KMFIPTDoc( NetfilterObject *tqparent, const char *name, KMFTarget* target ) : KMFDoc( tqparent, name ), KMFRulesetDoc( target ) { initDoc(); } @@ -150,8 +150,8 @@ void KMFIPTDoc::clear() { resetUrl(); } -const QString& KMFIPTDoc::getFileDialogFilter() { - return *( new QString("*.kmfrs|KMyFirewall IPTables Ruleset(*.kmfrs)") ); +const TQString& KMFIPTDoc::getFileDialogFilter() { + return *( new TQString("*.kmfrs|KMyFirewall IPTables Ruleset(*.kmfrs)") ); } void KMFIPTDoc::setUseFilter( bool on ) { @@ -216,16 +216,16 @@ bool KMFIPTDoc::isEmpty() { return false; } -const QDomDocument& KMFIPTDoc::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFIPTDoc::getDOMTree()" << endl; - QDomDocument doc( "kmyfirewall-ruleset" ); - QDomElement root = doc.createElement( XML::IPTDoc_DocumentElement ); +const TQDomDocument& KMFIPTDoc::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFIPTDoc::getDOMTree()" << endl; + TQDomDocument doc( "kmyfirewall-ruleset" ); + TQDomElement root = doc.createElement( XML::IPTDoc_DocumentElement ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION ); root.setAttribute( XML::MinVersion_Attribute, "1.0.0" ); root.setAttribute( XML::MaxVersion_Attribute, "~" ); - QDomElement abstract = doc.createElement( XML::Abstract_Element ); + TQDomElement abstract = doc.createElement( XML::Abstract_Element ); root.appendChild( abstract ); if ( useFilter() ) { abstract.setAttribute( XML::UseFilter_Attribute, XML::Yes_Value ); @@ -274,33 +274,33 @@ const QDomDocument& KMFIPTDoc::getDOMTree() { root.appendChild( m_ipt_nat->getDOMTree( ) ); root.appendChild( m_ipt_mangle->getDOMTree( ) ); doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFIPTDoc::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void KMFIPTDoc::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFIPTDoc::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void KMFIPTDoc::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); if ( root.nodeName() != XML::IPTDoc_DocumentElement ) { kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl; - errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").arg( root.nodeName() ) ) ); + errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").tqarg( root.nodeName() ) ) ); return; } loadXML( root, errors ); } -void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors ) { - kdDebug() << "void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors )" << endl; +void KMFIPTDoc::loadXML( TQDomNode root, TQStringList& errors ) { + kdDebug() << "void KMFIPTDoc::loadXML( TQDomNode root, TQStringList& errors )" << endl; if ( root.nodeName() != XML::IPTDoc_DocumentElement ) { kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl; - errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").arg( root.nodeName() ) ) ); + errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").tqarg( root.nodeName() ) ) ); return; } NetfilterObject::loadUuid( root, errors ); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::Table_Element ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); kdDebug() << "KMFIPTDoc: Start Parsing Table: " << name << endl; - QDomDocument table; + TQDomDocument table; table.appendChild( curr.cloneNode( true ) ); if ( name == Constants::FilterTable_Name ) { m_ipt_filter->loadXML( table, errors ); @@ -312,16 +312,16 @@ void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors ) { kdDebug() << "KMFIPTDoc: Finished Parsing Table: " << name << endl; } else if ( curr.isElement() && curr.nodeName() == XML::Abstract_Element ) { kdDebug() << "KMFIPTDoc: Start Parsing Abstract" << endl; - QString filter; - QString nat; - QString mangle; - QString martians; - QString ipfwd; - QString syncookies; - QString rpfilter; - QString modules; - QString description = ""; - QString name = ""; + TQString filter; + TQString nat; + TQString mangle; + TQString martians; + TQString ipfwd; + TQString syncookies; + TQString rpfilter; + TQString modules; + TQString description = ""; + TQString name = ""; filter = curr.toElement().attribute( XML::UseFilter_Attribute ); nat = curr.toElement().attribute( XML::Use_Nat_Attribute ); mangle = curr.toElement().attribute( XML::UseMangle_Attribute ); @@ -333,11 +333,11 @@ void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors ) { description += curr.toElement().attribute( XML::Description_Attribute ); if ( ! description.isNull() ) - setDescription( *( new QString( description ) ) ); + setDescription( *( new TQString( description ) ) ); name = curr.toElement().attribute( XML::Name_Attribute ); if ( ! name.isNull() ) - setName( *( new QString( name ) ) ); + setName( *( new TQString( name ) ) ); if ( filter == XML::Yes_Value ) m_use_filter = true; @@ -387,7 +387,7 @@ void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors ) { changed(); } -IPTable* KMFIPTDoc::table( const QString& table ) { +IPTable* KMFIPTDoc::table( const TQString& table ) { if ( table == Constants::FilterTable_Name ) return m_ipt_filter; if ( table == Constants::NatTable_Name ) @@ -397,17 +397,17 @@ IPTable* KMFIPTDoc::table( const QString& table ) { return 0; } -const QString& KMFIPTDoc::compile() { +const TQString& KMFIPTDoc::compile() { KMFCompilerInterface* compiler = target()->compiler(); if ( ! compiler ) { - return *( new QString("ERROR") ); + return *( new TQString("ERROR") ); } return compiler->compile( this ); } -void KMFIPTDoc::parseDocument( const KURL& url, QStringList& errors ) { +void KMFIPTDoc::parseDocument( const KURL& url, TQStringList& errors ) { // kdDebug() << "KMFIPTDoc::parseDocument()" << endl; - QString xmlfile; + TQString xmlfile; if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) { clear(); m_url.setFileName( i18n( "Untitled" ) ); @@ -425,8 +425,8 @@ void KMFIPTDoc::parseDocument( const KURL& url, QStringList& errors ) { if ( !m_ipt_mangle->chains().isEmpty() ) m_ipt_mangle->reset(); clear(); - QFile kmfrsFile( xmlfile ); - QDomDocument domTree; + TQFile kmfrsFile( xmlfile ); + TQDomDocument domTree; if ( !kmfrsFile.open( IO_ReadOnly ) ) { return; // return 0; @@ -459,14 +459,14 @@ void KMFIPTDoc::registerRuleOptions() { kdDebug() << "KMFIPTDoc::registerRuleOptions()" << endl; KStandardDirs std_dir; - QStringList files = std_dir.findAllResources( + TQStringList files = std_dir.findAllResources( "data", "kmyfirewall/ruleoptions/kmfruleoption*.xml", false, true ); - for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it ) { + for ( TQStringList::Iterator it = files.begin(); it != files.end(); ++it ) { kdDebug() << "Found Option XML File: " << *it << endl; - QString xmlfile = *it; - QFile document( xmlfile ); - QDomDocument domTree; + TQString xmlfile = *it; + TQFile document( xmlfile ); + TQDomDocument domTree; if ( !document.open( IO_ReadOnly ) ) { kdDebug() << "ERROR: Can't read XML ruole option definition" << endl; return; diff --git a/kmyfirewall/core/kmfiptdoc.h b/kmyfirewall/core/kmfiptdoc.h index 37f530f..39b4564 100644 --- a/kmyfirewall/core/kmfiptdoc.h +++ b/kmyfirewall/core/kmfiptdoc.h @@ -26,11 +26,11 @@ #include "kmfrulesetdoc.h" // qt includes -#include <qdict.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qobject.h> +#include <tqdict.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqobject.h> // kde includes #include <kurl.h> @@ -67,27 +67,27 @@ public: ~KMFIPTDoc(); /** Compiles the document to an iptables script */ - const QString& compile(); + const TQString& compile(); // /** Writes the shellscrip that contains the iptables commands to settup // the firewall to file. -// If file = QString::null a SaveAs dialog will popup. */ - // KMFError* createFirewallScript( const QString& file = QString::null ); +// If file = TQString() a SaveAs dialog will popup. */ + // KMFError* createFirewallScript( const TQString& file = TQString() ); /** loads the ruleset defined by the KURL object */ - virtual void parseDocument( const KURL&, QStringList& errors ); + virtual void parseDocument( const KURL&, TQStringList& errors ); /** Get the File dialog filter string for the document type */ - virtual const QString& getFileDialogFilter(); + virtual const TQString& getFileDialogFilter(); - /** loads the ruleset defined by the QDomDocument object */ - virtual void loadXML( const QDomDocument&, QStringList& errors ); + /** loads the ruleset defined by the TQDomDocument object */ + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); - /** loads the ruleset defined by the QDomNode object */ - virtual void loadXML( QDomNode, QStringList& errors ); + /** loads the ruleset defined by the TQDomNode object */ + virtual void loadXML( TQDomNode, TQStringList& errors ); -/* virtual void setDescription( const QString& ); */ -// virtual void setName( const QString& ); +/* virtual void setDescription( const TQString& ); */ +// virtual void setName( const TQString& ); virtual int type(); @@ -165,10 +165,10 @@ public: }; /** Returns the IPTable with the given name if it exists */ - IPTable* table( const QString& table ); + IPTable* table( const TQString& table ); /** Return DomDocument of this Chain */ - const QDomDocument& getDOMTree(); + const TQDomDocument& getDOMTree(); /** Read the rule option definitions from the XML files in diff --git a/kmyfirewall/core/kmfnethost.cpp b/kmyfirewall/core/kmfnethost.cpp index 4677b26..20bdefa 100644 --- a/kmyfirewall/core/kmfnethost.cpp +++ b/kmyfirewall/core/kmfnethost.cpp @@ -24,7 +24,7 @@ #include "kmftarget.h" // QT includes -#include <qdom.h> +#include <tqdom.h> // KDE includes #include <kdebug.h> @@ -46,7 +46,7 @@ namespace KMF { -KMFNetHost::KMFNetHost( NetfilterObject *parent, const char* name, const QString& hostName, KMFNetwork* net ) : KMFTarget( parent, name, hostName, net ) { +KMFNetHost::KMFNetHost( NetfilterObject *tqparent, const char* name, const TQString& hostName, KMFNetwork* net ) : KMFTarget( tqparent, name, hostName, net ) { m_logIncoming = false; m_logOutgoing = false; m_guiName = i18n("New Host"); @@ -56,7 +56,7 @@ KMFNetHost::KMFNetHost( NetfilterObject *parent, const char* name, const QString m_protocols.setAutoDelete( false ); setName( hostName ); // m_object_type = NETHOST; - if ( KMFNetZone* zone = dynamic_cast<KMFNetZone*> ( parent ) ) { + if ( KMFNetZone* zone = dynamic_cast<KMFNetZone*> ( tqparent ) ) { m_zone = zone; m_address->setAddress( m_zone->address()->toString() ); } else { @@ -95,7 +95,7 @@ void KMFNetHost::setLogOutgoing( bool onoff ) { changed(); } -void KMFNetHost::setLimit( int num, const QString& scale ) { +void KMFNetHost::setLimit( int num, const TQString& scale ) { if ( num < 1 ) { m_limitNum = -1; m_limitScale = "minute"; @@ -117,23 +117,23 @@ int KMFNetHost::limitRate() const { return m_limitNum; } -const QString& KMFNetHost::limitScale() const { +const TQString& KMFNetHost::limitScale() const { return m_limitScale; } -QPtrList<KMFProtocolUsage>& KMFNetHost::protocols() const { - QPtrList<KMFProtocolUsage>* ret_val = new QPtrList<KMFProtocolUsage>; +TQPtrList<KMFProtocolUsage>& KMFNetHost::protocols() const { + TQPtrList<KMFProtocolUsage>* ret_val = new TQPtrList<KMFProtocolUsage>; *ret_val = m_protocols; return *ret_val; } -KMFProtocolUsage* KMFNetHost::findProtocolUsageByProtocolUuid( const QUuid& uuid ) const { - kdDebug() << "KMFProtocol* KMFNetHost::findProtocolUsageByProtocolUuid( const QUuid& " << uuid.toString() << " ) const" << endl; - if ( (new QUuid(uuid))->isNull() ) { +KMFProtocolUsage* KMFNetHost::findProtocolUsageByProtocolUuid( const TQUuid& uuid ) const { + kdDebug() << "KMFProtocol* KMFNetHost::findProtocolUsageByProtocolUuid( const TQUuid& " << uuid.toString() << " ) const" << endl; + if ( (new TQUuid(uuid))->isNull() ) { exit(1); } - QPtrListIterator<KMFProtocolUsage> it(m_protocols); + TQPtrListIterator<KMFProtocolUsage> it(m_protocols); while ( it.current() ) { KMFProtocolUsage *p = it.current(); ++it; @@ -145,8 +145,8 @@ KMFProtocolUsage* KMFNetHost::findProtocolUsageByProtocolUuid( const QUuid& uuid return 0; } -KMFProtocolUsage* KMFNetHost::addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml ) { - // kdDebug() << "KMFNetHost* KMFNetZone::addProtocolUsage( const QUuid& " << protocolUuid.toString() << ", const QDomDocument& xml )" << endl; +KMFProtocolUsage* KMFNetHost::addProtocolUsage( const TQUuid& protocolUuid, const TQDomDocument& xml ) { + // kdDebug() << "KMFNetHost* KMFNetZone::addProtocolUsage( const TQUuid& " << protocolUuid.toString() << ", const TQDomDocument& xml )" << endl; if ( protocolUuid.isNull() ) { kdDebug() << "ERROR: protocolUuid.isNull()" << endl; exit(1); @@ -167,7 +167,7 @@ KMFProtocolUsage* KMFNetHost::addProtocolUsage( const QUuid& protocolUuid, const KMFProtocolUsage* new_protocol = prot->createUsage(); // FIXME: Check For Error - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); new_protocol->loadXML( xml, *errors ); if ( ! new_protocol->validUsage() ) { kdDebug() << "WARNING: ProtocolUsage parsed from: " << xml.toString() << " is not Valid! Skippin Usage." << endl; @@ -175,10 +175,10 @@ KMFProtocolUsage* KMFNetHost::addProtocolUsage( const QUuid& protocolUuid, const } new_protocol->setProtocol( prot ); m_protocols.append( new_protocol ); - disconnect( new_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) ); - connect( new_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) ); + disconnect( new_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolUsageDeleted( TQObject* ) ) ); + connect( new_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolUsageDeleted( TQObject* ) ) ); changed(); return new_protocol; } @@ -186,7 +186,7 @@ KMFProtocolUsage* KMFNetHost::addProtocolUsage( const QUuid& protocolUuid, const void KMFNetHost::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ){ // kdDebug() << "void KMFNetHost::delProtocol( KMFProtocol* prot )" << endl; - QPtrListIterator<KMFProtocolUsage> it( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it( m_protocols ); bool deleted = false; while ( it.current() ) { KMFProtocolUsage *p = it.current(); @@ -208,9 +208,9 @@ void KMFNetHost::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ){ changed(); } -void KMFNetHost::slotOnProtocolUsageDeleted( QObject* prot ) { +void KMFNetHost::slotOnProtocolUsageDeleted( TQObject* prot ) { kdDebug() << "KMFNetHost::slotOnProtocolUsageDeleted... Host name: " << this->name() << endl; - QPtrListIterator<KMFProtocolUsage> it( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it( m_protocols ); while ( it.current() ) { KMFProtocolUsage * p = it.current(); ++it; @@ -226,7 +226,7 @@ void KMFNetHost::slotOnProtocolUsageDeleted( QObject* prot ) { -bool KMFNetHost::protocolInherited( const QUuid& uuid ) const { +bool KMFNetHost::protocolInherited( const TQUuid& uuid ) const { // kdDebug() << "bool KMFNetHost::protocolInherited() const" << endl; if ( ! m_zone ) return false; @@ -236,7 +236,7 @@ bool KMFNetHost::protocolInherited( const QUuid& uuid ) const { exit(1); } - QPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() ); + TQPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() ); while ( it.current() ) { KMFProtocolUsage *p = it.current(); ++it; @@ -248,10 +248,10 @@ bool KMFNetHost::protocolInherited( const QUuid& uuid ) const { return m_zone->protocolInherited( uuid ); } -const QDomDocument& KMFNetHost::getDOMTree() { - kdDebug() << "const QDomDocument& KMFNetHost::getDOMTree() " << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::NetHost_Element ); +const TQDomDocument& KMFNetHost::getDOMTree() { + kdDebug() << "const TQDomDocument& KMFNetHost::getDOMTree() " << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::NetHost_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Name_Attribute, name() ); @@ -272,32 +272,32 @@ const QDomDocument& KMFNetHost::getDOMTree() { root.setAttribute( XML::LimitRate_Attribute, limitRate() ); root.setAttribute( XML::LimitScale_Attribute, limitScale() ); - QPtrListIterator<KMFProtocolUsage> it2 ( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it2 ( m_protocols ); while ( it2.current() ) { root.appendChild( it2.current()->getDOMTree( ) ); ++it2; } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFNetHost::loadXML( const QDomDocument& doc, QStringList& errors ) { - // kdDebug() << "void KMFNetHost::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFNetHost::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + // kdDebug() << "void KMFNetHost::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) { - kdDebug() << "void KMFNetHost::loadXML( QDomNode root )" << endl; - //QDomElement root = doc.documentElement(); +void KMFNetHost::loadXML( TQDomNode root, TQStringList& errors ) { + kdDebug() << "void KMFNetHost::loadXML( TQDomNode root )" << endl; + //TQDomElement root = doc.documentElement(); NetfilterObject::loadUuid( root, errors ); - QString name = ""; - QString guiName = ""; - QString desc = ""; - QString address = ""; - QString logIn = ""; - QString logOut = ""; - QString limitRate = ""; - QString limitScale = ""; + TQString name = ""; + TQString guiName = ""; + TQString desc = ""; + TQString address = ""; + TQString logIn = ""; + TQString logOut = ""; + TQString limitRate = ""; + TQString limitScale = ""; name = root.toElement().attribute( XML::Name_Attribute ); guiName = root.toElement().attribute( XML::GUIName_Attribute ); @@ -322,26 +322,26 @@ void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) { bool ok; int lRate = limitRate.toInt( &ok ); if ( ok ) { - setLimit( lRate, *( new QString( limitScale ) ) ); + setLimit( lRate, *( new TQString( limitScale ) ) ); } - setDescription( *( new QString( desc ) ) ); - // setName( *( new QString( name ) ) ); - setGuiName( *( new QString( guiName ) ) ); + setDescription( *( new TQString( desc ) ) ); + // setName( *( new TQString( name ) ) ); + setGuiName( *( new TQString( guiName ) ) ); this->address()->setAddress( address ); - QValueList< KMFProtocolUsage* > xmlDefinedProtocols; - QDomNode curr = root.firstChild(); + TQValueList< KMFProtocolUsage* > xmlDefinedProtocols; + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) { // FIXME: Remove later // keep for compatibility - QString name = curr.toElement().attribute( XML::Name_Attribute ); - QDomDocument protocol_doc; + TQString name = curr.toElement().attribute( XML::Name_Attribute ); + TQDomDocument protocol_doc; protocol_doc.appendChild( curr.cloneNode(true) ); KMFProtocol *protocol = KMFProtocolLibrary::instance()->findProtocolByName( name ); if ( ! protocol ) { - KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").arg( name ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").tqarg( name ), KMFError::OK, this ); continue; } @@ -352,8 +352,8 @@ void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) { } } if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) { - QString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute ); - QDomDocument protocol_doc; + TQString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute ); + TQDomDocument protocol_doc; protocol_doc.appendChild( curr.cloneNode(true) ); KMFProtocolUsage* pu = addProtocolUsage( protocolUuid , protocol_doc ); if ( pu ) { @@ -364,14 +364,14 @@ void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) { } { - QPtrList< KMFProtocolUsage >& allprotocols = protocols(); - QPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols ); + TQPtrList< KMFProtocolUsage >& allprotocols = protocols(); + TQPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols ); while( itAllProtocols.current() ) { KMFProtocolUsage *oldProtocolUsage = itAllProtocols.current(); ++itAllProtocols; bool found = false; - QValueList< KMFProtocolUsage* >::iterator itProtocols; + TQValueList< KMFProtocolUsage* >::iterator itProtocols; for( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) { KMFProtocolUsage* pu = *itProtocols; if ( pu == oldProtocolUsage ) { @@ -380,7 +380,7 @@ void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) { } if ( ! found ) { - KMFUndoEngine::instance()->log( i18n("Removing unused oldProtocolUsage: %1").arg( oldProtocolUsage->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Removing unused oldProtocolUsage: %1").tqarg( oldProtocolUsage->name() ), KMFError::OK, this ); delProtocolUsage( oldProtocolUsage, true ); } } diff --git a/kmyfirewall/core/kmfnethost.h b/kmyfirewall/core/kmfnethost.h index d1f71c6..44c2dad 100644 --- a/kmyfirewall/core/kmfnethost.h +++ b/kmyfirewall/core/kmfnethost.h @@ -27,11 +27,11 @@ // QT includes -#include <qptrlist.h> -#include <qguardedptr.h> -#include <qstring.h> -#include <qdom.h> -#include <quuid.h> +#include <tqptrlist.h> +#include <tqguardedptr.h> +#include <tqstring.h> +#include <tqdom.h> +#include <tquuid.h> // KDE includes #include <kdemacros.h> @@ -55,8 +55,9 @@ class KMFNetwork; class KDE_EXPORT KMFNetHost : public KMFTarget { Q_OBJECT + TQ_OBJECT public: - KMFNetHost( NetfilterObject *parent, const char* name, const QString& Hostname, KMFNetwork* net ); + KMFNetHost( NetfilterObject *tqparent, const char* name, const TQString& Hostname, KMFNetwork* net ); virtual ~KMFNetHost(); virtual int type(); @@ -72,32 +73,32 @@ public: } void setLogOutgoing( bool ); - void setLimit( int num, const QString& scale ); + void setLimit( int num, const TQString& scale ); bool limit() const; int limitRate() const; - const QString& limitScale() const; + const TQString& limitScale() const; - virtual const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); - KMFProtocolUsage* addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml ); + KMFProtocolUsage* addProtocolUsage( const TQUuid& protocolUuid, const TQDomDocument& xml ); void delProtocolUsage( KMFProtocolUsage*, bool destructive = true ); - bool protocolInherited( const QUuid& uuid ) const; - KMFProtocolUsage* findProtocolUsageByProtocolUuid( const QUuid& uuid ) const; + bool protocolInherited( const TQUuid& uuid ) const; + KMFProtocolUsage* findProtocolUsageByProtocolUuid( const TQUuid& uuid ) const; - QPtrList<KMFProtocolUsage>& protocols() const; + TQPtrList<KMFProtocolUsage>& protocols() const; protected slots: - void slotOnProtocolUsageDeleted( QObject* protocol ); + void slotOnProtocolUsageDeleted( TQObject* protocol ); private: // Data -// int m_maskLen; - QPtrList<KMFProtocolUsage> m_protocols; +// int m_tqmaskLen; + TQPtrList<KMFProtocolUsage> m_protocols; bool m_logIncoming, m_logOutgoing; - QString m_limitScale; + TQString m_limitScale; int m_limitNum; }; } diff --git a/kmyfirewall/core/kmfnetwork.cpp b/kmyfirewall/core/kmfnetwork.cpp index b9ba35e..0b269e5 100644 --- a/kmyfirewall/core/kmfnetwork.cpp +++ b/kmyfirewall/core/kmfnetwork.cpp @@ -23,10 +23,10 @@ #include "kmfnetwork.h" // QT includes -#include <qfile.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> // KDE includes #include <kapplication.h> @@ -56,8 +56,8 @@ namespace KMF { -KMFNetwork::KMFNetwork( NetfilterObject* parent, const char* name, KMyFirewallInterface* ) : KMFDoc( parent, name ) { - kdDebug() << "KMFNetwork::KMFNetwork( QObject *parent, const char *name ) : KMFDoc( parent, name )" << endl; +KMFNetwork::KMFNetwork( NetfilterObject* tqparent, const char* name, KMyFirewallInterface* ) : KMFDoc( tqparent, name ) { + kdDebug() << "KMFNetwork::KMFNetwork( TQObject *tqparent, const char *name ) : KMFDoc( tqparent, name )" << endl; m_target = 0; m_myNetwork = 0; @@ -98,8 +98,8 @@ void KMFNetwork::clear() { initDoc(); } -const QString& KMFNetwork::getFileDialogFilter() { - return *( new QString("*.kmfnet|KMyFirewall Network (*.kmfnet)") ); +const TQString& KMFNetwork::getFileDialogFilter() { + return *( new TQString("*.kmfnet|KMyFirewall Network (*.kmfnet)") ); } void KMFNetwork::setupDefaultHosts() { @@ -213,9 +213,9 @@ bool KMFNetwork::isEmpty() { return false; } -void KMFNetwork::parseDocument( const KURL& url, QStringList& errors ) { +void KMFNetwork::parseDocument( const KURL& url, TQStringList& errors ) { kdDebug() << "KMFDoc* KMFNetwork::parseDocument( const KURL& url )" << endl; - QString xmlfile; + TQString xmlfile; if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) { clear(); m_url.setFileName( i18n( "Untitled" ) ); @@ -226,8 +226,8 @@ void KMFNetwork::parseDocument( const KURL& url, QStringList& errors ) { // kdDebug() << "Found xmlfile: " << xmlfile << endl; // delete old chainsets if there clear(); - QFile kmfrsFile( xmlfile ); - QDomDocument domTree; + TQFile kmfrsFile( xmlfile ); + TQDomDocument domTree; if ( !kmfrsFile.open( IO_ReadOnly ) ) { return; } @@ -263,10 +263,10 @@ void KMFNetwork::parseDocument( const KURL& url, QStringList& errors ) { return; } -const QDomDocument& KMFNetwork::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFNetwork::getDOMTree()" << endl; - QDomDocument doc( "kmyfirewall-ruleset" ); - QDomElement root = doc.createElement( XML::KMFNetwork_DocumentElement ); +const TQDomDocument& KMFNetwork::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFNetwork::getDOMTree()" << endl; + TQDomDocument doc( "kmyfirewall-ruleset" ); + TQDomElement root = doc.createElement( XML::KMFNetwork_DocumentElement ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION ); root.setAttribute( XML::MinVersion_Attribute, "1.1.0" ); @@ -279,30 +279,30 @@ const QDomDocument& KMFNetwork::getDOMTree() { root.appendChild( m_myNetwork->getDOMTree() ); doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFNetwork::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void KMFNetwork::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFNetwork::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void KMFNetwork::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); if ( root.nodeName() != XML::KMFNetwork_DocumentElement ) { kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl; - errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfnet").arg( root.nodeName() ) ) ); + errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfnet").tqarg( root.nodeName() ) ) ); return; } loadXML( root, errors ); } -void KMFNetwork::loadXML( QDomNode root, QStringList& errors ) { -// void KMFNetwork::loadXML( const QDomDocument& doc ) { - // kdDebug() << "void KMFNetwork::loadXML( const QDomDocument& )" << endl; - // QDomElement root = doc.documentElement(); +void KMFNetwork::loadXML( TQDomNode root, TQStringList& errors ) { +// void KMFNetwork::loadXML( const TQDomDocument& doc ) { + // kdDebug() << "void KMFNetwork::loadXML( const TQDomDocument& )" << endl; + // TQDomElement root = doc.documentElement(); NetfilterObject::loadUuid( root, errors ); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::NetZone_Element ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); if ( name == Constants::MyNetwork_Name ) { kdDebug() << "Parsing netzone: " << curr.toElement().attribute( XML::Name_Attribute ) << endl; m_myNetwork->loadXML( curr, errors ); diff --git a/kmyfirewall/core/kmfnetwork.h b/kmyfirewall/core/kmfnetwork.h index 458853f..248e393 100644 --- a/kmyfirewall/core/kmfnetwork.h +++ b/kmyfirewall/core/kmfnetwork.h @@ -27,10 +27,10 @@ #include "kmfundoengine.h" // QT includes -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqptrlist.h> // KDE includes #include <kurl.h> @@ -70,16 +70,16 @@ public: bool isEmpty(); /** Return DomDocument of this Chain */ - const QDomDocument& getDOMTree(); + const TQDomDocument& getDOMTree(); - virtual void loadXML( const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual void loadXML( const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); virtual int type(); - void parseDocument( const KURL&, QStringList& errors ); + void parseDocument( const KURL&, TQStringList& errors ); /** Get the File dialog filter string for the document type */ - virtual const QString& getFileDialogFilter(); + virtual const TQString& getFileDialogFilter(); KMFDoc* currentDoc(); KMFIPTDoc* currentDocAsIPTDoc(); @@ -105,8 +105,8 @@ private: // KMFCompilerInterface* compiler(); private: // DATA - QGuardedPtr<KMFNetZone> m_myNetwork; - QGuardedPtr<KMFTarget> m_target; + TQGuardedPtr<KMFNetZone> m_myNetwork; + TQGuardedPtr<KMFTarget> m_target; /* KMFNetZone *m_myNetwork; KMFTarget *m_target;*/ diff --git a/kmyfirewall/core/kmfnetzone.cpp b/kmyfirewall/core/kmfnetzone.cpp index b666838..6beeb06 100644 --- a/kmyfirewall/core/kmfnetzone.cpp +++ b/kmyfirewall/core/kmfnetzone.cpp @@ -22,9 +22,9 @@ #include "kmfnetzone.h" // QT includes -#include <qdom.h> -#include <qvaluelist.h> -#include <qobject.h> +#include <tqdom.h> +#include <tqvaluelist.h> +#include <tqobject.h> // KDE includes #include <kdebug.h> @@ -50,8 +50,8 @@ namespace KMF { -KMFNetZone::KMFNetZone( NetfilterObject *parent, const char* name, const QString& zoneName ) : NetfilterObject( parent, name ) { - kdDebug() << "KMFNetZone::KMFNetZone( NetfilterObject *parent, const char* name, const QString& zoneName )" << endl; +KMFNetZone::KMFNetZone( NetfilterObject *tqparent, const char* name, const TQString& zoneName ) : NetfilterObject( tqparent, name ) { + kdDebug() << "KMFNetZone::KMFNetZone( NetfilterObject *tqparent, const char* name, const TQString& zoneName )" << endl; m_doc = 0; m_network = 0; m_zone = 0; @@ -67,14 +67,14 @@ KMFNetZone::KMFNetZone( NetfilterObject *parent, const char* name, const QString } else { setName( zoneName ); } - if ( KMFNetZone * zone = dynamic_cast<KMFNetZone*> ( parent ) ) { + if ( KMFNetZone * zone = dynamic_cast<KMFNetZone*> ( tqparent ) ) { m_zoneType = NODE; m_zone = zone; - setZone( *m_zone->address(), m_zone->maskLength() /* , *m_zone->mask() */ ); - } else if ( KMFGenericDoc * doc = dynamic_cast<KMFGenericDoc*> ( parent ) ) { + setZone( *m_zone->address(), m_zone->tqmaskLength() /* , *m_zone->tqmask() */ ); + } else if ( KMFGenericDoc * doc = dynamic_cast<KMFGenericDoc*> ( tqparent ) ) { m_zoneType = ROOT; m_doc = doc; - } else if ( KMFNetwork * doc = dynamic_cast<KMFNetwork*> ( parent ) ) { + } else if ( KMFNetwork * doc = dynamic_cast<KMFNetwork*> ( tqparent ) ) { m_zoneType = ROOT; m_network = doc; } @@ -93,9 +93,9 @@ KMFNetZone::~KMFNetZone() { } int KMFNetZone::operator==( const KMFNetZone& zone ) { - if ( IPAddress::calcLenthToMask( *mask() ) > IPAddress::calcLenthToMask( *zone.mask() ) ) { + if ( IPAddress::calcLenthToMask( *tqmask() ) > IPAddress::calcLenthToMask( *zone.tqmask() ) ) { return 1; - } else if ( IPAddress::calcLenthToMask( *mask() ) == IPAddress::calcLenthToMask( *zone.mask() ) ){ + } else if ( IPAddress::calcLenthToMask( *tqmask() ) == IPAddress::calcLenthToMask( *zone.tqmask() ) ){ return 0; } else { return -1; @@ -103,9 +103,9 @@ int KMFNetZone::operator==( const KMFNetZone& zone ) { } bool KMFNetZone::isSameZone( KMFNetZone* zone ) { - if ( IPAddress::calcLenthToMask( *mask() ) > IPAddress::calcLenthToMask( *zone->mask() ) ) { + if ( IPAddress::calcLenthToMask( *tqmask() ) > IPAddress::calcLenthToMask( *zone->tqmask() ) ) { return false; - } else if ( IPAddress::calcLenthToMask( *mask() ) == IPAddress::calcLenthToMask( *zone->mask() ) ){ + } else if ( IPAddress::calcLenthToMask( *tqmask() ) == IPAddress::calcLenthToMask( *zone->tqmask() ) ){ return true; } else { return false; @@ -180,26 +180,26 @@ bool KMFNetZone::isRootZone() { return false; } -const QString& KMFNetZone::name() { - // kdDebug() << "QString& KMFNetZone::name()" << endl; +const TQString& KMFNetZone::name() { + // kdDebug() << "TQString& KMFNetZone::name()" << endl; // return "" + uuid(); - const QString& s = generateName( "" ); + const TQString& s = generateName( "" ); return s; } -const QString& KMFNetZone::generateName( const QString& nam ) { - // kdDebug() << "QString& KMFNetZone::generateName(" << nam << ")" << endl; +const TQString& KMFNetZone::generateName( const TQString& nam ) { + // kdDebug() << "TQString& KMFNetZone::generateName(" << nam << ")" << endl; if ( ! isRootZone() ) { - QString s = ""; - s.setNum( zone()->zones().find( this ) ); - return *(new QString( zone()->generateName( "_zone_" + s + "_" + nam ))); + TQString s = ""; + s.setNum( zone()->zones().tqfind( this ) ); + return *(new TQString( zone()->generateName( "_zone_" + s + "_" + nam ))); } else { - QString s = ""; + TQString s = ""; s.append( NetfilterObject::name() ); s.append( nam ); - // kdDebug() << "QString& KMFNetZone::generateName(" << nam << ") on Root Zone returns: " << s << endl; - return *(new QString(s)); + // kdDebug() << "TQString& KMFNetZone::generateName(" << nam << ") on Root Zone returns: " << s << endl; + return *(new TQString(s)); } } @@ -207,7 +207,7 @@ void KMFNetZone::setReadOnly( bool onOff ) { m_readOnly = onOff; } -void KMFNetZone::setGuiName( const QString& name ) { +void KMFNetZone::setGuiName( const TQString& name ) { if ( name == m_guiName ) { return; } @@ -215,38 +215,38 @@ void KMFNetZone::setGuiName( const QString& name ) { changed(); } -QString KMFNetZone::zoneInfo() { - return QString("Zone: guiName: %1 name: %2 objectUuid: %3" ).arg( guiName() ).arg( name() ).arg( uuid() ); +TQString KMFNetZone::zoneInfo() { + return TQString("Zone: guiName: %1 name: %2 objectUuid: %3" ).tqarg( guiName() ).tqarg( name() ).tqarg( uuid() ); } void KMFNetZone::setMaskLength( int len ){ // kdDebug() << "void KMFNetZone::setMaskLength( int len )" << endl; if ( len < 0 || len > 32 ) { kdDebug() << "ERROR: Mask Lengh invalid: " << len << endl; - m_maskLen = -1; + m_tqmaskLen = -1; return; } - if ( m_maskLen == len ) { + if ( m_tqmaskLen == len ) { return; } - m_maskLen = len; + m_tqmaskLen = len; changed(); } -QPtrList<KMFProtocolUsage>& KMFNetZone::protocols() const { - QPtrList<KMFProtocolUsage>* ret_val = new QPtrList<KMFProtocolUsage>; +TQPtrList<KMFProtocolUsage>& KMFNetZone::protocols() const { + TQPtrList<KMFProtocolUsage>* ret_val = new TQPtrList<KMFProtocolUsage>; *ret_val = m_protocols; return *ret_val; } -QPtrList<KMFNetZone>& KMFNetZone::zones () const { - QPtrList<KMFNetZone>* ret_val = new QPtrList<KMFNetZone>; +TQPtrList<KMFNetZone>& KMFNetZone::zones () const { + TQPtrList<KMFNetZone>* ret_val = new TQPtrList<KMFNetZone>; *ret_val = m_zones; return *ret_val; } -QPtrList<KMFTarget>& KMFNetZone::hosts () const { - QPtrList<KMFTarget>* ret_val = new QPtrList<KMFTarget>; +TQPtrList<KMFTarget>& KMFNetZone::hosts () const { + TQPtrList<KMFTarget>* ret_val = new TQPtrList<KMFTarget>; *ret_val = m_hosts; return *ret_val; } @@ -257,7 +257,7 @@ void KMFNetZone::setParentZone( KMFNetZone* zone ) { changed(); } -KMFNetHost* KMFNetZone::findNetHostByName( const QString& name, bool fromRoot ) { +KMFNetHost* KMFNetZone::findNetHostByName( const TQString& name, bool fromRoot ) { KMFTarget* t = findTargetByName( name, fromRoot ); if ( t && dynamic_cast<KMFNetHost*>(t) ) { return dynamic_cast<KMFNetHost*>(t); @@ -265,8 +265,8 @@ KMFNetHost* KMFNetZone::findNetHostByName( const QString& name, bool fromRoot ) return 0; } -KMFTarget* KMFNetZone::findTargetByName( const QString& name, bool fromRoot ) { - kdDebug() << "KMFTarget* KMFNetZone::findTargetByName( const QString& " << name << ", " << fromRoot <<" )" << endl; +KMFTarget* KMFNetZone::findTargetByName( const TQString& name, bool fromRoot ) { + kdDebug() << "KMFTarget* KMFNetZone::findTargetByName( const TQString& " << name << ", " << fromRoot <<" )" << endl; if ( ! fromRoot ) { return findTargetByName_internal( name ); } else { @@ -278,10 +278,10 @@ KMFTarget* KMFNetZone::findTargetByName( const QString& name, bool fromRoot ) { } } -KMFTarget* KMFNetZone::findTargetByName_internal( const QString& name ) { - kdDebug() << "KMFTarget* KMFNetZone::findTargetByName_internal( const QString& " << name << "" << endl; +KMFTarget* KMFNetZone::findTargetByName_internal( const TQString& name ) { + kdDebug() << "KMFTarget* KMFNetZone::findTargetByName_internal( const TQString& " << name << "" << endl; KMFTarget* foundHost = 0; - QPtrListIterator<KMFNetZone> it ( m_zones ); + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() ) { KMFNetZone *z = *it; ++it; @@ -292,7 +292,7 @@ KMFTarget* KMFNetZone::findTargetByName_internal( const QString& name ) { } } - QPtrListIterator<KMFTarget> itHosts ( m_hosts ); + TQPtrListIterator<KMFTarget> itHosts ( m_hosts ); while ( itHosts.current() ) { KMFTarget *z = *itHosts; ++itHosts; @@ -306,8 +306,8 @@ KMFTarget* KMFNetZone::findTargetByName_internal( const QString& name ) { return 0; } -KMFNetZone* KMFNetZone::findNetZoneByName( const QString& name, bool fromRoot ) { - kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName( const QString& " << name << ", " << fromRoot <<" )" << endl; +KMFNetZone* KMFNetZone::findNetZoneByName( const TQString& name, bool fromRoot ) { + kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName( const TQString& " << name << ", " << fromRoot <<" )" << endl; if ( ! fromRoot ) { return findNetZoneByName_internal( name ); } else { @@ -319,10 +319,10 @@ KMFNetZone* KMFNetZone::findNetZoneByName( const QString& name, bool fromRoot ) } } -KMFNetZone* KMFNetZone::findNetZoneByName_internal( const QString& name ) { - kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName_internal( const QString& " << name << "" << endl; +KMFNetZone* KMFNetZone::findNetZoneByName_internal( const TQString& name ) { + kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName_internal( const TQString& " << name << "" << endl; KMFNetZone* foundHost = 0; - QPtrListIterator<KMFNetZone> it ( m_zones ); + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() ) { KMFNetZone *z = *it; ++it; @@ -333,7 +333,7 @@ KMFNetZone* KMFNetZone::findNetZoneByName_internal( const QString& name ) { } } - QPtrListIterator<KMFNetZone> itHosts ( m_zones ); + TQPtrListIterator<KMFNetZone> itHosts ( m_zones ); while ( itHosts.current() ) { KMFNetZone *z = *itHosts; ++itHosts; @@ -350,13 +350,13 @@ KMFNetZone* KMFNetZone::findNetZoneByName_internal( const QString& name ) { -KMFProtocolUsage* KMFNetZone::findProtocolUsageByProtocolUuid( const QUuid& uuid ) const { - kdDebug() << "KMFProtocol* KMFNetZone::findProtocolUsageByProtocolUuid( const QString& " << uuid << " ) const" << endl; - if ( (new QUuid(uuid))->isNull() ) { +KMFProtocolUsage* KMFNetZone::findProtocolUsageByProtocolUuid( const TQUuid& uuid ) const { + kdDebug() << "KMFProtocol* KMFNetZone::findProtocolUsageByProtocolUuid( const TQString& " << uuid << " ) const" << endl; + if ( (new TQUuid(uuid))->isNull() ) { exit(1); } - QPtrListIterator<KMFProtocolUsage> it( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it( m_protocols ); while ( it.current() ) { KMFProtocolUsage * p = it.current(); ++it; @@ -368,7 +368,7 @@ KMFProtocolUsage* KMFNetZone::findProtocolUsageByProtocolUuid( const QUuid& uuid return 0; } -bool KMFNetZone::protocolInherited( const QUuid& uuid ) const { +bool KMFNetZone::protocolInherited( const TQUuid& uuid ) const { // kdDebug() << "bool KMFNetZone::protocolInherited() const" << endl; if ( m_zoneType != NODE ) { // kdDebug() << "At ROOT node stopping search" << endl; @@ -379,7 +379,7 @@ bool KMFNetZone::protocolInherited( const QUuid& uuid ) const { exit(1); } - QPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() ); + TQPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() ); while ( it.current() ) { KMFProtocolUsage * p = it.current(); ++it; @@ -391,22 +391,22 @@ bool KMFNetZone::protocolInherited( const QUuid& uuid ) const { return m_zone->protocolInherited( uuid ); } -void KMFNetZone::setZone( const IPAddress& from, int maskLen ) { +void KMFNetZone::setZone( const IPAddress& from, int tqmaskLen ) { m_address->setAddress( from.toString() ); - setMaskLength( maskLen ); + setMaskLength( tqmaskLen ); changed(); } -KMFNetZone* KMFNetZone::addZone( const QString& name, KMFError* err ) { -// kdDebug() << "KMFProtocol* KMFNetZone::addZone( const QString& name, KMFError* err )" << endl; - QPtrListIterator<KMFNetZone> it( m_zones ); +KMFNetZone* KMFNetZone::addZone( const TQString& name, KMFError* err ) { +// kdDebug() << "KMFProtocol* KMFNetZone::addZone( const TQString& name, KMFError* err )" << endl; + TQPtrListIterator<KMFNetZone> it( m_zones ); while ( it.current() ) { KMFNetZone * z = it.current(); ++it; if ( z->name() == name ) { err->setErrType( KMFError::NORMAL ); - err->setErrMsg( i18n( "Zone %1 already exists, please try again with another name" ).arg( name ) ); + err->setErrMsg( i18n( "Zone %1 already exists, please try again with another name" ).tqarg( name ) ); return 0; } } @@ -433,8 +433,8 @@ void KMFNetZone::delZone( KMFNetZone* zone, bool destructive ) { -KMFProtocolUsage* KMFNetZone::addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml ) { - kdDebug() << "KMFProtocol* KMFNetZone::addProtocol( const QUuid& " << protocolUuid << " , const QDomDocument& " << xml.toString() << " )" << endl; +KMFProtocolUsage* KMFNetZone::addProtocolUsage( const TQUuid& protocolUuid, const TQDomDocument& xml ) { + kdDebug() << "KMFProtocol* KMFNetZone::addProtocol( const TQUuid& " << protocolUuid << " , const TQDomDocument& " << xml.toString() << " )" << endl; if ( protocolUuid.isNull() ) { exit(1); @@ -453,7 +453,7 @@ KMFProtocolUsage* KMFNetZone::addProtocolUsage( const QUuid& protocolUuid, const } KMFProtocolUsage* new_protocol = prot->createUsage(); - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); new_protocol->loadXML( xml, *errors ); // FIXME: Check Errors @@ -463,16 +463,16 @@ KMFProtocolUsage* KMFNetZone::addProtocolUsage( const QUuid& protocolUuid, const } new_protocol->setProtocol( prot ); m_protocols.append( new_protocol ); - disconnect( new_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) ); - connect( new_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) ); + disconnect( new_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolUsageDeleted( TQObject* ) ) ); + connect( new_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolUsageDeleted( TQObject* ) ) ); changed(); return new_protocol; } void KMFNetZone::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ) { - QPtrListIterator<KMFProtocolUsage> it( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it( m_protocols ); bool deleted = false; while ( it.current() ) { KMFProtocolUsage * p = it.current(); @@ -492,9 +492,9 @@ void KMFNetZone::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ) { } } -void KMFNetZone::slotOnProtocolUsageDeleted( QObject* prot ) { +void KMFNetZone::slotOnProtocolUsageDeleted( TQObject* prot ) { kdDebug() << "KMFNetZone::slotOnProtocolUsageDeleted... Zone name: " << this->name() << endl; - QPtrListIterator<KMFProtocolUsage> it( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it( m_protocols ); while ( it.current() ) { KMFProtocolUsage * p = it.current(); ++it; @@ -517,9 +517,9 @@ KMFNetZone* KMFNetZone::placeZoneInZone( KMFNetZone* zone ) { zone->setParentZone( this ); zone->setNetwork( network() ); if ( ! zone->readOnly() ) { - QString hostnum; + TQString hostnum; hostnum = hostnum.setNum( m_zones.count() + 1 ); -/* QString host_name = "zone_" + this->name() + "_" + hostnum; +/* TQString host_name = "zone_" + this->name() + "_" + hostnum; zone->setName( host_name );*/ } m_zones.append( zone ); @@ -527,12 +527,12 @@ KMFNetZone* KMFNetZone::placeZoneInZone( KMFNetZone* zone ) { return zone; } -QString KMFNetZone::toString() { - QString ret = QString( +TQString KMFNetZone::toString() { + TQString ret = TQString( "Zone: " + address()->toString() + "/%1" + " name: " + NetfilterObject::name() + - " GUIName: " + guiName() ).arg(maskLength()) ; + " GUIName: " + guiName() ).tqarg(tqmaskLength()) ; return ret; } @@ -545,7 +545,7 @@ QString KMFNetZone::toString() { KMFTarget* KMFNetZone::placeHostInZone( KMFTarget* host ) { -/* QString s = name(); +/* TQString s = name(); // kdDebug() << "KMFNetZone::placeHostInZone_internal..." << " Zone name: " << name() << endl; @@ -564,9 +564,9 @@ KMFTarget* KMFNetZone::placeHostInZone( KMFTarget* host ) { kdDebug() << "Placing zhostone: " << host->name() << " in zone: " << this->name() << endl; host->setParentZone( this ); if ( ! host->readOnly() ) { - QString hostnum; + TQString hostnum; hostnum = hostnum.setNum( m_hosts.count() + 1 ); - QString host_name = "host_" + this->name() + "_" + hostnum; + TQString host_name = "host_" + this->name() + "_" + hostnum; host->setName( host_name ); } m_hosts.append( host ); @@ -577,7 +577,7 @@ KMFTarget* KMFNetZone::placeHostInZone( KMFTarget* host ) { void KMFNetZone::refreshNetworkTree() { kdDebug() << "KMFNetZone::refreshNetworkTree()" << endl; - // QPtrList<KMFNetZone>* allZones = new QPtrList<KMFNetZone>(); + // TQPtrList<KMFNetZone>* allZones = new TQPtrList<KMFNetZone>(); KMFNetZoneList* allZones = new KMFNetZoneList(); kdDebug() << "Fetch All Zones..." << endl; getAllZones( rootZone(), allZones ); @@ -585,14 +585,14 @@ void KMFNetZone::refreshNetworkTree() { kdDebug() << "Found " << allZones->count() << " Zones" << endl; // Resort Zones - QPtrListIterator<KMFNetZone> it( *allZones ); + TQPtrListIterator<KMFNetZone> it( *allZones ); // while ( it.current() ) { // // kdDebug() << "Found Zone : " << it.current()->toString() << endl; // ++it; // } // Reinsert Zones - QPtrListIterator<KMFNetZone> it3( *allZones ); + TQPtrListIterator<KMFNetZone> it3( *allZones ); for( int i = allZones->count() - 1; allZones->count() > 0 && i >= 0; i-- ) { KMFNetZone *currZone = allZones->at(i); @@ -600,13 +600,13 @@ void KMFNetZone::refreshNetworkTree() { for( int j = i - 1; allZones->count() > 1 && j >= 0; j-- ) { KMFNetZone *thisTry = allZones->at(j); if ( thisTry != currZone && ! ( - ( thisTry->address() == currZone->address() ) == IPAddress::EQUAL && - thisTry->maskLength() == currZone->maskLength() + ( thisTry->address() == currZone->address() ) == IPAddress::ETQUAL && + thisTry->tqmaskLength() == currZone->tqmaskLength() ) && - IPAddress::hostsOnSameNetwork( *thisTry->address(), *currZone->address(), thisTry->maskLength() ) ) { + IPAddress::hostsOnSameNetwork( *thisTry->address(), *currZone->address(), thisTry->tqmaskLength() ) ) { thisTry->placeZoneInZone( currZone ); // allZones->remove( thisTry ); // kdDebug() << "Add Zone: " << currZone->toString() << endl; @@ -619,12 +619,12 @@ void KMFNetZone::refreshNetworkTree() { kdDebug() << "Finished Zone Reorder" << endl << endl; - QPtrList<KMFTarget>* allHosts = new QPtrList<KMFTarget>(); + TQPtrList<KMFTarget>* allHosts = new TQPtrList<KMFTarget>(); kdDebug() << "Fetch All Hosts..." << endl; for( uint i = 0; i < allZones->count(); i++ ) { - QPtrListIterator<KMFTarget> it_hosts( allZones->at(i)->hosts() ); + TQPtrListIterator<KMFTarget> it_hosts( allZones->at(i)->hosts() ); while ( it_hosts.current() ) { allHosts->append( it_hosts.current() ); // kdDebug() << "Found: " << it_hosts.current()->toString() << endl; @@ -636,7 +636,7 @@ void KMFNetZone::refreshNetworkTree() { // kdDebug() << "Found " << allZones->count() << " Zones" << endl; // Resort Zones - QPtrListIterator<KMFNetZone> it_2( *allZones ); + TQPtrListIterator<KMFNetZone> it_2( *allZones ); while ( it_2.current() ) { // kdDebug() << "Found Zone : " << it_2.current()->toString() << endl; ++it_2; @@ -646,7 +646,7 @@ void KMFNetZone::refreshNetworkTree() { KMFTarget *currHost = allHosts->at(i); for( int j = allZones->count() - 1; allZones->count() > 0 && j >= 0; j-- ) { KMFNetZone *currZone = allZones->at(j); - if ( IPAddress::hostsOnSameNetwork( *currZone->address(), *currHost->address(), currZone->maskLength() ) ) { + if ( IPAddress::hostsOnSameNetwork( *currZone->address(), *currHost->address(), currZone->tqmaskLength() ) ) { currZone->placeHostInZone( currHost ); /* kdDebug() << "Add Host: " << currHost->toString() << endl; kdDebug() << "to Zone : " << currZone->toString() << endl;*/ @@ -668,9 +668,9 @@ void KMFNetZone::refreshNetworkTree() { // // } -void KMFNetZone::getAllZones( KMFNetZone* zone, QPtrList<KMFNetZone>* list ) { +void KMFNetZone::getAllZones( KMFNetZone* zone, TQPtrList<KMFNetZone>* list ) { // kdDebug() << "KMFNetZone::getAllZones(...)" << endl; - QPtrListIterator<KMFNetZone> it( zone->zones() ); + TQPtrListIterator<KMFNetZone> it( zone->zones() ); while ( it.current() ) { getAllZones( it.current(), list ); ++it; @@ -678,30 +678,30 @@ void KMFNetZone::getAllZones( KMFNetZone* zone, QPtrList<KMFNetZone>* list ) { list->append( zone ); } -void KMFNetZone::getAllHosts( KMFNetZone* zone, QPtrList<KMFTarget>* list ) { +void KMFNetZone::getAllHosts( KMFNetZone* zone, TQPtrList<KMFTarget>* list ) { // kdDebug() << "KMFNetZone::getAllHosts(...)" << endl; - QPtrListIterator<KMFNetZone> it( zone->zones() ); + TQPtrListIterator<KMFNetZone> it( zone->zones() ); while ( it.current() ) { getAllHosts( it.current(), list ); ++it; } - QPtrListIterator<KMFTarget> it2( zone->hosts() ); + TQPtrListIterator<KMFTarget> it2( zone->hosts() ); while ( it2.current() ) { list->append( it2.current() ); ++it2; } } -void KMFNetZone::getAllTargets( KMFNetZone* zone, QPtrList<KMFTarget>* list ) { +void KMFNetZone::getAllTargets( KMFNetZone* zone, TQPtrList<KMFTarget>* list ) { kdDebug() << "KMFNetZone::getAllTargets(...)" << endl; - QPtrListIterator<KMFNetZone> it( zone->zones() ); + TQPtrListIterator<KMFNetZone> it( zone->zones() ); while ( it.current() ) { getAllTargets( it.current(), list ); ++it; } - QPtrListIterator<KMFTarget> it2( zone->hosts() ); + TQPtrListIterator<KMFTarget> it2( zone->hosts() ); while ( it2.current() ) { if ( it2.current()->type() == NetfilterObject::KMFTARGET ) { list->append( it2.current() ); @@ -710,18 +710,18 @@ void KMFNetZone::getAllTargets( KMFNetZone* zone, QPtrList<KMFTarget>* list ) { } } -KMFNetHost* KMFNetZone::addNetHost( const QString& name, const QDomDocument& xml ) { - kdDebug() << "KMFProtocol* KMFNetHost::addNetHost( const QString& name, const QDomDocument& xml )" << endl; - QString hostnum; +KMFNetHost* KMFNetZone::addNetHost( const TQString& name, const TQDomDocument& xml ) { + kdDebug() << "KMFProtocol* KMFNetHost::addNetHost( const TQString& name, const TQDomDocument& xml )" << endl; + TQString hostnum; hostnum = hostnum.setNum( m_hosts.count() + 1 ); - QString host_name = "nethost_" + this->name() + "_" + hostnum; + TQString host_name = "nethost_" + this->name() + "_" + hostnum; KMFNetHost* new_host = new KMFNetHost( this, host_name.latin1(), host_name, network() ); if ( ! new_host ) { kdDebug() << "ERROR couldn't create Host" << endl; return 0; } kdDebug() << "xml.toString(): " << xml.toString() << endl; - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); new_host->loadXML( xml, *errors ); // FIXME: Check Errors if ( ! new_host->readOnly() ) { @@ -736,18 +736,18 @@ KMFNetHost* KMFNetZone::addNetHost( const QString& name, const QDomDocument& xml return retHost; } -KMFTarget* KMFNetZone::addTarget( const QString& name, const QDomDocument& xml ) { - kdDebug() << "KMFProtocol* KMFNetHost::addTarget( const QString& name, const QDomDocument& xml )" << endl; - QString hostnum; +KMFTarget* KMFNetZone::addTarget( const TQString& name, const TQDomDocument& xml ) { + kdDebug() << "KMFProtocol* KMFNetHost::addTarget( const TQString& name, const TQDomDocument& xml )" << endl; + TQString hostnum; hostnum = hostnum.setNum( hosts().count() + 1 ); - QString host_name = "target_" + this->name() + "_" + hostnum; + TQString host_name = "target_" + this->name() + "_" + hostnum; KMFTarget* new_host = new KMFTarget( this , host_name.latin1(), host_name, network() ); if ( ! new_host ) { kdDebug() << "ERROR couldn't create Host" << endl; return 0; } kdDebug() << xml.toString() << endl; - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); new_host->loadXML( xml, *errors ); // FIXME: Check Errors if ( ! new_host->readOnly() ) { @@ -763,7 +763,7 @@ KMFTarget* KMFNetZone::addTarget( const QString& name, const QDomDocument& xml ) } void KMFNetZone::delHost( KMFTarget* host, bool destructive ) { - QPtrListIterator<KMFTarget> it( m_hosts ); + TQPtrListIterator<KMFTarget> it( m_hosts ); bool deleted = false; while ( it.current() ) { KMFTarget * p = it.current(); @@ -782,69 +782,69 @@ void KMFNetZone::delHost( KMFTarget* host, bool destructive ) { } } -const QDomDocument& KMFNetZone::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFNetZone::getDOMTree() " << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::NetZone_Element ); +const TQDomDocument& KMFNetZone::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFNetZone::getDOMTree() " << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::NetZone_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Name_Attribute, name() ); root.setAttribute( XML::GUIName_Attribute, guiName() ); root.setAttribute( XML::Description_Attribute, description() ); root.setAttribute( XML::ReadOnly_Attribute, readOnly() ? XML::BoolOn_Value : XML::BoolOff_Value ); - QDomElement from = doc.createElement( XML::FromIP_Element ); + TQDomElement from = doc.createElement( XML::FromIP_Element ); root.appendChild( from ); - QString num; + TQString num; from.setAttribute( XML::Address_Attribute, address()->toString() ); - QDomElement mask = doc.createElement( XML::NetMask_Element ); - root.appendChild( mask ); - mask.setAttribute( XML::Address_Attribute, maskLength() ); + TQDomElement tqmask = doc.createElement( XML::NetMask_Element ); + root.appendChild( tqmask ); + tqmask.setAttribute( XML::Address_Attribute, tqmaskLength() ); - QPtrListIterator<KMFNetZone> it ( m_zones ); + TQPtrListIterator<KMFNetZone> it ( m_zones ); while ( it.current() ) { root.appendChild( it.current() ->getDOMTree( ) ); ++it; } - QPtrListIterator<KMFProtocolUsage> it2 ( m_protocols ); + TQPtrListIterator<KMFProtocolUsage> it2 ( m_protocols ); while ( it2.current() ) { root.appendChild( it2.current() ->getDOMTree( ) ); ++it2; } - QPtrListIterator<KMFTarget> it3 ( m_hosts ); + TQPtrListIterator<KMFTarget> it3 ( m_hosts ); while ( it3.current() ) { root.appendChild( it3.current() ->getDOMTree( ) ); ++it3; } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFNetZone::loadXML( const QDomDocument& doc, QStringList& errors ) { - // kdDebug() << "void KMFNetZone::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFNetZone::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + // kdDebug() << "void KMFNetZone::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { -// void KMFNetZone::loadXML( const QDomDocument& doc ) { - kdDebug() << "void KMFNetZone::loadXML( QDomNode root )" << endl; +void KMFNetZone::loadXML( TQDomNode root, TQStringList& errors ) { +// void KMFNetZone::loadXML( const TQDomDocument& doc ) { + kdDebug() << "void KMFNetZone::loadXML( TQDomNode root )" << endl; NetfilterObject::loadUuid ( root, errors ); -// QDomElement root = doc.documentElement(); - QString name = ""; - QString guiName = ""; - QString desc = ""; - QString readonly = ""; +// TQDomElement root = doc.documentElement(); + TQString name = ""; + TQString guiName = ""; + TQString desc = ""; + TQString readonly = ""; name = root.toElement().attribute( XML::Name_Attribute ); guiName = root.toElement().attribute( XML::GUIName_Attribute ); desc = root.toElement().attribute( XML::Description_Attribute ); readonly = root.toElement().attribute( XML::ReadOnly_Attribute ); - setDescription( *( new QString( desc ) ) ); + setDescription( *( new TQString( desc ) ) ); // if ( - setName( *( new QString( name ) ) ); - setGuiName( *( new QString( guiName ) ) ); + setName( *( new TQString( name ) ) ); + setGuiName( *( new TQString( guiName ) ) ); if ( readonly == XML::BoolOn_Value ) { setReadOnly( true ); @@ -852,13 +852,13 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { setReadOnly( false ); } - QValueList< KMFNetZone* > xmlDefinedZones; - QValueList< KMFTarget* > xmlDefinedTargets; - QValueList< KMFProtocolUsage* > xmlDefinedProtocols; - QDomNode curr = root.firstChild(); + TQValueList< KMFNetZone* > xmlDefinedZones; + TQValueList< KMFTarget* > xmlDefinedTargets; + TQValueList< KMFProtocolUsage* > xmlDefinedProtocols; + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() && ( curr.nodeName() == XML::FromIP_Element || curr.nodeName() == XML::NetMask_Element ) ) { - QString addr = curr.toElement().attribute( XML::Address_Attribute ); + TQString addr = curr.toElement().attribute( XML::Address_Attribute ); if ( curr.nodeName() == XML::FromIP_Element ) m_address->setAddress( addr ); if ( curr.nodeName() == XML::NetMask_Element ) { @@ -867,16 +867,16 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { if ( ok ) { setMaskLength( len ); } else { - kdDebug() << "Parsing mask failed" << endl; + kdDebug() << "Parsing tqmask failed" << endl; } } } if ( curr.isElement() && ( curr.nodeName() == XML::NetZone_Element ) ) { - QString name = ""; + TQString name = ""; name = curr.toElement().attribute( XML::Name_Attribute ); kdDebug() << "KMFNetZone: parsing netzone: " << curr.toElement().attribute( XML::Name_Attribute ) << endl; - QDomDocument zone_doc; + TQDomDocument zone_doc; zone_doc.appendChild( curr.cloneNode( true ) ); KMFNetZone *z = 0; @@ -893,15 +893,15 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) { // FIXME: Remove later // Keep that for compatiblity - QString name = ""; + TQString name = ""; name = curr.toElement().attribute( XML::Name_Attribute ); kdDebug() << "KMFNetZone: parsing protocol: " << curr.toElement().attribute( XML::Name_Attribute ) << endl; - QDomDocument protocol_doc; + TQDomDocument protocol_doc; protocol_doc.appendChild( curr.cloneNode( true ) ); KMFProtocol *p = KMFProtocolLibrary::instance()->findProtocolByName( name ); if ( ! p ) { - KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").arg( name ), KMFError::NORMAL, this ); + KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").tqarg( name ), KMFError::NORMAL, this ); continue; } @@ -910,26 +910,26 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { if ( ! pu ) { pu = findProtocolUsageByProtocolUuid( p->uuid() ); } - KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").arg( pu->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").tqarg( pu->name() ), KMFError::OK, this ); xmlDefinedProtocols.append( pu ); } if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) { - QString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute ); + TQString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute ); kdDebug() << "KMFNetZone: parsing protocol: " << curr.toElement().attribute( XML::Name_Attribute ) << endl; - QDomDocument protocol_doc; + TQDomDocument protocol_doc; protocol_doc.appendChild( curr.cloneNode( true ) ); KMFProtocolUsage *pu = addProtocolUsage( protocolUuid, protocol_doc ); if ( ! pu ) { pu = findProtocolUsageByProtocolUuid( protocolUuid ); } - KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").arg( pu->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").tqarg( pu->name() ), KMFError::OK, this ); xmlDefinedProtocols.append( pu ); } if ( curr.isElement() && ( curr.nodeName() == XML::NetHost_Element ) ) { - QString name = ""; + TQString name = ""; name = curr.toElement().attribute( XML::Name_Attribute ); - QDomDocument host_doc; + TQDomDocument host_doc; host_doc.appendChild( curr.cloneNode( true ) ); KMFNetHost *h = 0; h = findNetHostByName( name, true ); @@ -944,10 +944,10 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { } } if ( curr.isElement() && ( curr.nodeName() == XML::Target_Element ) ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); kdDebug() << "KMFNetZone: parsing target: " << curr.toElement().attribute( XML::Name_Attribute ) << endl; KMFTarget *h = 0; - QDomDocument host_doc; + TQDomDocument host_doc; host_doc.appendChild( curr.cloneNode( true ) ); h = findTargetByName( name, true ); if ( ! h ) { @@ -965,13 +965,13 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { } { - QPtrList< KMFNetZone >& allZones = zones(); - QPtrListIterator<KMFNetZone> itAllZones( allZones ); + TQPtrList< KMFNetZone >& allZones = zones(); + TQPtrListIterator<KMFNetZone> itAllZones( allZones ); while( itAllZones.current() ) { KMFNetZone *oldZone = itAllZones.current(); ++itAllZones; bool found = false; - QValueList< KMFNetZone* >::iterator itZones; + TQValueList< KMFNetZone* >::iterator itZones; for( itZones = xmlDefinedZones.begin(); itZones != xmlDefinedZones.end() && ! found; ++itZones ) { KMFNetZone* z = *itZones; @@ -981,20 +981,20 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { } if ( ! found ) { - KMFUndoEngine::instance()->log( i18n("Removing unused Zone: %1").arg( oldZone->guiName() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Removing unused Zone: %1").tqarg( oldZone->guiName() ), KMFError::OK, this ); delZone( oldZone, true ); } } } { - QPtrList< KMFTarget >& allTargets = hosts(); - QPtrListIterator< KMFTarget > itAllTargets( allTargets ); + TQPtrList< KMFTarget >& allTargets = hosts(); + TQPtrListIterator< KMFTarget > itAllTargets( allTargets ); while( itAllTargets.current() ) { KMFTarget *oldTarget = itAllTargets.current(); ++itAllTargets; bool found = false; - QValueList< KMFTarget* >::iterator itTargets; + TQValueList< KMFTarget* >::iterator itTargets; for( itTargets = xmlDefinedTargets.begin(); itTargets != xmlDefinedTargets.end() && ! found; ++itTargets ) { KMFTarget* t = *itTargets; if ( t == oldTarget ) { @@ -1003,7 +1003,7 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { } if ( ! found ) { - KMFUndoEngine::instance()->log( i18n("Removing unused target: %1").arg( oldTarget->guiName() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Removing unused target: %1").tqarg( oldTarget->guiName() ), KMFError::OK, this ); delHost( oldTarget, true ); } } @@ -1012,26 +1012,26 @@ void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) { { - QPtrList< KMFProtocolUsage >& allprotocols = protocols(); - QPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols ); + TQPtrList< KMFProtocolUsage >& allprotocols = protocols(); + TQPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols ); while( itAllProtocols.current() ) { KMFProtocolUsage *oldProtocoUsagel = itAllProtocols.current(); ++itAllProtocols; - KMFUndoEngine::instance()->log( i18n("Existing protocol: %1").arg( oldProtocoUsagel->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Existing protocol: %1").tqarg( oldProtocoUsagel->name() ), KMFError::OK, this ); bool found = false; - QValueList< KMFProtocolUsage* >::iterator itProtocols; + TQValueList< KMFProtocolUsage* >::iterator itProtocols; for( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) { KMFProtocolUsage* protocolUsage = *itProtocols; - KMFUndoEngine::instance()->log( i18n("Compare with xml protocol: %1").arg( protocolUsage->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Compare with xml protocol: %1").tqarg( protocolUsage->name() ), KMFError::OK, this ); if ( protocolUsage == oldProtocoUsagel ) { found = true; } } if ( ! found ) { - KMFUndoEngine::instance()->log( i18n("Removing unused protocol: %1").arg( oldProtocoUsagel->name() ), KMFError::OK, this ); + KMFUndoEngine::instance()->log( i18n("Removing unused protocol: %1").tqarg( oldProtocoUsagel->name() ), KMFError::OK, this ); delProtocolUsage( oldProtocoUsagel, true ); // delHost( oldTarget, true ); } diff --git a/kmyfirewall/core/kmfnetzone.h b/kmyfirewall/core/kmfnetzone.h index 79a59d4..064bd3c 100644 --- a/kmyfirewall/core/kmfnetzone.h +++ b/kmyfirewall/core/kmfnetzone.h @@ -25,11 +25,11 @@ #include "netfilterobject.h" // QT includes -#include <qptrlist.h> -#include <qguardedptr.h> -#include <qstring.h> -#include <quuid.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqguardedptr.h> +#include <tqstring.h> +#include <tquuid.h> +#include <tqobject.h> // KDE includes #include <kdemacros.h> @@ -51,8 +51,9 @@ class KMFNetwork; //############ KMFNetZone ############# class KDE_EXPORT KMFNetZone : public NetfilterObject { Q_OBJECT + TQ_OBJECT public: - KMFNetZone( NetfilterObject *parent, const char* objectname, const QString& name ); + KMFNetZone( NetfilterObject *tqparent, const char* objectname, const TQString& name ); virtual ~KMFNetZone(); @@ -67,14 +68,14 @@ public: bool isSameZone( KMFNetZone* ); - IPAddress* mask() const { + IPAddress* tqmask() const { IPAddress *addr = new IPAddress(); - addr->setAddress( IPAddress::calcNetworkMaskFromLength( m_maskLen ).toString() ); + addr->setAddress( IPAddress::calcNetworkMaskFromLength( m_tqmaskLen ).toString() ); return addr; }; - int maskLength() const { - return m_maskLen; + int tqmaskLength() const { + return m_tqmaskLen; } KMFGenericDoc* doc() const; @@ -87,15 +88,15 @@ public: return m_zoneType; }; - const QString& guiName() const { + const TQString& guiName() const { return m_guiName; }; - virtual const QString& name(); - const QString& generateName( const QString& ); + virtual const TQString& name(); + const TQString& generateName( const TQString& ); - void setGuiName( const QString& ); + void setGuiName( const TQString& ); void setNetwork( KMFNetwork* ); void setZone( const IPAddress& , int ); @@ -106,33 +107,33 @@ public: - const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); - KMFNetZone* addZone( const QString& , KMFError* ); + KMFNetZone* addZone( const TQString& , KMFError* ); void delZone( KMFNetZone*, bool desructive = true ); - KMFProtocolUsage* addProtocolUsage( const QUuid& uuid, const QDomDocument& xml ); + KMFProtocolUsage* addProtocolUsage( const TQUuid& uuid, const TQDomDocument& xml ); void delProtocolUsage( KMFProtocolUsage*, bool desructive = true ); - KMFNetHost* addNetHost( const QString& name, const QDomDocument& xml ); - KMFTarget* addTarget( const QString& name, const QDomDocument& xml ); + KMFNetHost* addNetHost( const TQString& name, const TQDomDocument& xml ); + KMFTarget* addTarget( const TQString& name, const TQDomDocument& xml ); - KMFTarget* findTargetByName( const QString& name, bool fromRoot = true ); - KMFNetHost* findNetHostByName( const QString& name, bool fromRoot = true ); - KMFNetZone* findNetZoneByName( const QString& name, bool fromRoot = true ); + KMFTarget* findTargetByName( const TQString& name, bool fromRoot = true ); + KMFNetHost* findNetHostByName( const TQString& name, bool fromRoot = true ); + KMFNetZone* findNetZoneByName( const TQString& name, bool fromRoot = true ); void delHost( KMFTarget*, bool desructive = true ); - QPtrList<KMFProtocolUsage>& protocols() const; - QPtrList<KMFNetZone>& zones() const; - QPtrList<KMFTarget>& hosts() const; + TQPtrList<KMFProtocolUsage>& protocols() const; + TQPtrList<KMFNetZone>& zones() const; + TQPtrList<KMFTarget>& hosts() const; - KMFProtocolUsage* findProtocolUsageByProtocolUuid( const QUuid& uuid ) const; + KMFProtocolUsage* findProtocolUsageByProtocolUuid( const TQUuid& uuid ) const; - bool protocolInherited( const QUuid& uuid ) const; + bool protocolInherited( const TQUuid& uuid ) const; KMFTarget* placeHostInZone( KMFTarget* host ); KMFNetZone* placeZoneInZone( KMFNetZone* zone ); @@ -143,40 +144,40 @@ public: }; void setReadOnly( bool ); - QString toString(); + TQString toString(); enum { ROOT, NODE } Type; - void getAllTargets( KMFNetZone* zone, QPtrList<KMFTarget>* list ); + void getAllTargets( KMFNetZone* zone, TQPtrList<KMFTarget>* list ); protected slots: - void slotOnProtocolUsageDeleted( QObject* protocol ); + void slotOnProtocolUsageDeleted( TQObject* protocol ); private: // Methods - KMFTarget* findTargetByName_internal( const QString& name ); - KMFNetZone* findNetZoneByName_internal( const QString& name ); - QString zoneInfo(); + KMFTarget* findTargetByName_internal( const TQString& name ); + KMFNetZone* findNetZoneByName_internal( const TQString& name ); + TQString zoneInfo(); - void getAllZones( KMFNetZone* zone, QPtrList<KMFNetZone>* list ); - void getAllHosts( KMFNetZone* zone, QPtrList<KMFTarget>* list ); + void getAllZones( KMFNetZone* zone, TQPtrList<KMFNetZone>* list ); + void getAllHosts( KMFNetZone* zone, TQPtrList<KMFTarget>* list ); private: // Data - QGuardedPtr<KMFGenericDoc> m_doc; - QGuardedPtr<KMFNetZone> m_zone; - QGuardedPtr<KMFNetwork> m_network; + TQGuardedPtr<KMFGenericDoc> m_doc; + TQGuardedPtr<KMFNetZone> m_zone; + TQGuardedPtr<KMFNetwork> m_network; IPAddress* m_address; - QPtrList<KMFProtocolUsage> m_protocols; - QPtrList<KMFNetZone> m_zones; - QPtrList<KMFTarget> m_hosts; + TQPtrList<KMFProtocolUsage> m_protocols; + TQPtrList<KMFNetZone> m_zones; + TQPtrList<KMFTarget> m_hosts; KMFError *m_err; int m_zoneType; - int m_maskLen; + int m_tqmaskLen; // bool m_deadEnd; - QString m_guiName; + TQString m_guiName; bool m_readOnly; }; } diff --git a/kmyfirewall/core/kmfnetzonelist.cpp b/kmyfirewall/core/kmfnetzonelist.cpp index 11913ba..50cf68b 100644 --- a/kmyfirewall/core/kmfnetzonelist.cpp +++ b/kmyfirewall/core/kmfnetzonelist.cpp @@ -10,7 +10,7 @@ namespace KMF { -KMFNetZoneList::KMFNetZoneList() : QPtrList<KMFNetZone>() +KMFNetZoneList::KMFNetZoneList() : TQPtrList<KMFNetZone>() { } @@ -19,14 +19,14 @@ KMFNetZoneList::~KMFNetZoneList() { } -int KMFNetZoneList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { +int KMFNetZoneList::compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { KMFNetZone* z1 = (KMFNetZone*) item1; KMFNetZone* z2 = (KMFNetZone*) item2; // KMFNetZone* z2 = static_cast<KMFNetZone>( *item2 ); - if ( z1->maskLength() > z2->maskLength() ) { + if ( z1->tqmaskLength() > z2->tqmaskLength() ) { return 1; - } else if ( z1->maskLength() == z2->maskLength() ){ + } else if ( z1->tqmaskLength() == z2->tqmaskLength() ){ return 0; } else { return -1; diff --git a/kmyfirewall/core/kmfnetzonelist.h b/kmyfirewall/core/kmfnetzonelist.h index aaa28e6..e8425e0 100644 --- a/kmyfirewall/core/kmfnetzonelist.h +++ b/kmyfirewall/core/kmfnetzonelist.h @@ -9,8 +9,8 @@ #ifndef KMFNETZONELIST_H #define KMFNETZONELIST_H -#include <qptrcollection.h> -#include <qptrlist.h> +#include <tqptrcollection.h> +#include <tqptrlist.h> #include "kmfnetzone.h" /** @@ -18,7 +18,7 @@ */ namespace KMF { -class KMFNetZoneList : public QPtrList<KMFNetZone> +class KMFNetZoneList : public TQPtrList<KMFNetZone> { public: KMFNetZoneList(); @@ -26,7 +26,7 @@ public: ~KMFNetZoneList(); protected: - virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ); + virtual int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ); }; } #endif diff --git a/kmyfirewall/core/kmfplugin.cpp b/kmyfirewall/core/kmfplugin.cpp index f5fbe30..26b4687 100644 --- a/kmyfirewall/core/kmfplugin.cpp +++ b/kmyfirewall/core/kmfplugin.cpp @@ -12,7 +12,7 @@ #include "kmfplugin.h" // QT includes -#include <qwidget.h> +#include <tqwidget.h> // KDE includes #include <kapplication.h> @@ -29,7 +29,7 @@ namespace KMF { -KMFPlugin::KMFPlugin( QObject* parent , const char* name ) : KParts::Plugin( parent , name ) { +KMFPlugin::KMFPlugin( TQObject* tqparent , const char* name ) : KParts::Plugin( tqparent , name ) { m_err = new KMFError(); } @@ -73,7 +73,7 @@ KMFRulesetDoc* KMFPlugin::rulesetDoc() { return 0; } -void KMFPlugin::setOutputWidget( QWidget* wid ) { +void KMFPlugin::setOutputWidget( TQWidget* wid ) { KMyFirewallInterface::instance()->setOutputWidget( wid ); } @@ -85,8 +85,8 @@ void KMFPlugin::showOutput() { KMyFirewallInterface::instance()->showOutput(); } -void KMFPlugin::checkStatus() { - KMyFirewallInterface::instance()->checkStatus(); +void KMFPlugin::checktqStatus() { + KMyFirewallInterface::instance()->checktqStatus(); } } diff --git a/kmyfirewall/core/kmfplugin.h b/kmyfirewall/core/kmfplugin.h index 1ce085c..d15c396 100644 --- a/kmyfirewall/core/kmfplugin.h +++ b/kmyfirewall/core/kmfplugin.h @@ -13,9 +13,9 @@ #define KMFPLUGIN_H // QT includes -class QWidget; +class TQWidget; -#include <qobject.h> +#include <tqobject.h> // KDE includes #include <kparts/plugin.h> @@ -37,12 +37,12 @@ class KMFError; class KDE_EXPORT KMFPlugin : public KParts::Plugin { public: - KMFPlugin( QObject* parent , const char* name ); + KMFPlugin( TQObject* tqparent , const char* name ); virtual ~KMFPlugin(); - void setOutputWidget( QWidget* wid ); + void setOutputWidget( TQWidget* wid ); void showEditor(); void showOutput(); - void checkStatus(); + void checktqStatus(); protected: KMFRulesetDoc* rulesetDoc(); diff --git a/kmyfirewall/core/kmfpluginfactory.cpp b/kmyfirewall/core/kmfpluginfactory.cpp index 089c334..6128bd9 100644 --- a/kmyfirewall/core/kmfpluginfactory.cpp +++ b/kmyfirewall/core/kmfpluginfactory.cpp @@ -13,7 +13,7 @@ #include "kmfpluginfactory.h" // QT includes -#include <qobject.h> +#include <tqobject.h> // KDE includes @@ -42,9 +42,9 @@ KMFPluginFactory::KMFPluginFactory() {} KMFPluginFactory::~KMFPluginFactory() {} -KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* parent, KMFError* err ) { +KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* tqparent, KMFError* err ) { err->setErrType( KMFError::OK ); - QString libName; + TQString libName; if ( KMFConfig::useGenericInterface() ) { kdDebug() << "Loading generic GUI" << endl; libName = "libkmfgenericinterfacepart"; @@ -55,7 +55,7 @@ KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* parent KLibFactory * factory = KLibLoader::self() ->factory( libName.latin1() ); if ( factory ) { - KParts::ReadWritePart * m_ruleeditpart = static_cast<KParts::ReadWritePart *>( factory->create( parent, + KParts::ReadWritePart * m_ruleeditpart = static_cast<KParts::ReadWritePart *>( factory->create( TQT_TQOBJECT(tqparent), libName.latin1() , "KParts::ReadWritePart" ) ); if ( m_ruleeditpart ) { @@ -66,7 +66,7 @@ KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* parent return 0; } else { err->setErrType( KMFError::FATAL ); - err->setErrMsg( i18n( "Could not find %1 in the library search path." ).arg( libName ) ); + err->setErrMsg( i18n( "Could not tqfind %1 in the library search path." ).tqarg( libName ) ); return 0; } err->setErrType( KMFError::FATAL ); @@ -80,8 +80,8 @@ KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* parent -QValueList<KMFCompilerInterface*>* KMFPluginFactory::CompilersForInstaller( const QString& osName ) { - QValueList<KMFCompilerInterface*> *list = new QValueList<KMFCompilerInterface*>(); +TQValueList<KMFCompilerInterface*>* KMFPluginFactory::CompilersForInstaller( const TQString& osName ) { + TQValueList<KMFCompilerInterface*> *list = new TQValueList<KMFCompilerInterface*>(); kdDebug() << "Query: KMyFirewall/Compiler [X-KMyFirewall-Platform] == '" << osName.lower() << "'" << endl; KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Compiler", "[X-KMyFirewall-Platform] == '" + osName.lower() + "'"); KTrader::OfferList::iterator it; @@ -105,8 +105,8 @@ QValueList<KMFCompilerInterface*>* KMFPluginFactory::CompilersForInstaller( cons return list; } -QPtrList<KMFRuleOptionEditInterface>* KMFPluginFactory::KMFRuleOptionEditors( QObject *parent ){ - QPtrList<KMFRuleOptionEditInterface> *list = new QPtrList<KMFRuleOptionEditInterface>; +TQPtrList<KMFRuleOptionEditInterface>* KMFPluginFactory::KMFRuleOptionEditors( TQObject *tqparent ){ + TQPtrList<KMFRuleOptionEditInterface> *list = new TQPtrList<KMFRuleOptionEditInterface>; KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/RuleOptionEdit"); kdDebug() << "Query performed" << endl; @@ -119,7 +119,7 @@ QPtrList<KMFRuleOptionEditInterface>* KMFPluginFactory::KMFRuleOptionEditors( QO if ( !factory ) { kdDebug() << "Couldn't load plugin: " << ptr->name() << endl; } - if ( KMFRuleOptionEditInterface *part = dynamic_cast<KMFRuleOptionEditInterface*> ( factory->create( parent , "KMFRuleOptionEditInterface") ) ) { + if ( KMFRuleOptionEditInterface *part = dynamic_cast<KMFRuleOptionEditInterface*> ( factory->create( tqparent , "KMFRuleOptionEditInterface") ) ) { if ( ! part ) { KMessageBox::error(0, "Couldn't load plugin"); } @@ -130,8 +130,8 @@ QPtrList<KMFRuleOptionEditInterface>* KMFPluginFactory::KMFRuleOptionEditors( QO return list; } -QPtrList<KMFRuleTargetOptionEditInterface>* KMFPluginFactory::KMFRuleTargetOptionEditors( QObject *parent ) { - QPtrList<KMFRuleTargetOptionEditInterface> *list = new QPtrList<KMFRuleTargetOptionEditInterface>; +TQPtrList<KMFRuleTargetOptionEditInterface>* KMFPluginFactory::KMFRuleTargetOptionEditors( TQObject *tqparent ) { + TQPtrList<KMFRuleTargetOptionEditInterface> *list = new TQPtrList<KMFRuleTargetOptionEditInterface>; KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/RuleTargetOptionEdit"); kdDebug() << "Query performed" << endl; @@ -144,7 +144,7 @@ QPtrList<KMFRuleTargetOptionEditInterface>* KMFPluginFactory::KMFRuleTargetOptio if ( !factory ) { kdDebug() << "Couldn't load plugin: " << ptr->name() << endl; } - if ( KMFRuleTargetOptionEditInterface *part = dynamic_cast<KMFRuleTargetOptionEditInterface*> ( factory->create( parent , "KMFRuleTargetOptionEditInterface") ) ) { + if ( KMFRuleTargetOptionEditInterface *part = dynamic_cast<KMFRuleTargetOptionEditInterface*> ( factory->create( tqparent , "KMFRuleTargetOptionEditInterface") ) ) { if ( ! part ) { KMessageBox::error(0, "Couldn't load plugin"); } @@ -173,7 +173,7 @@ KMFInstallerInterface* KMFPluginFactory::KMFInstaller( KMFTarget* target ) { kdDebug() << "Couldn't load plugin: " << ptr->name() << endl; return 0; } - if ( KMFInstallerInterface *part = dynamic_cast<KMFInstallerInterface*> ( factory->create( KApplication::kApplication() , "KMFInstallerInterface") ) + if ( KMFInstallerInterface *part = dynamic_cast<KMFInstallerInterface*> ( factory->create( TQT_TQOBJECT(KApplication::kApplication()) , "KMFInstallerInterface") ) ) { if ( ! part ) { KMessageBox::error(0, "Couldn't load plugin"); @@ -208,7 +208,7 @@ KMFCompilerInterface* KMFPluginFactory::KMFCompiler( KMFTarget* target ) { return 0; } - if ( KMFCompilerInterface *part = dynamic_cast<KMFCompilerInterface*> ( factory->create( KApplication::kApplication() , "KMFCompilerInterface" ) ) ) { + if ( KMFCompilerInterface *part = dynamic_cast<KMFCompilerInterface*> ( factory->create( TQT_TQOBJECT(KApplication::kApplication()) , "KMFCompilerInterface" ) ) ) { kdDebug() << "Returning Compiler Plugin." << endl; return part; } diff --git a/kmyfirewall/core/kmfpluginfactory.h b/kmyfirewall/core/kmfpluginfactory.h index 2d37963..46bfc85 100644 --- a/kmyfirewall/core/kmfpluginfactory.h +++ b/kmyfirewall/core/kmfpluginfactory.h @@ -16,15 +16,15 @@ @author Christian Hubinger */ // QT includes -#include <qstring.h> -#include <qptrlist.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> // KDE includes // #include <kparts> #include <kparts/part.h> #include <kparts/mainwindow.h> -class QObject; +class TQObject; namespace KMF { class KMFTarget; class KMFError; @@ -40,12 +40,12 @@ private: KMFPluginFactory(); ~KMFPluginFactory(); public: -static QPtrList<KMFRuleOptionEditInterface>* KMFRuleOptionEditors( QObject *parent ); +static TQPtrList<KMFRuleOptionEditInterface>* KMFRuleOptionEditors( TQObject *tqparent ); -static QPtrList<KMFRuleTargetOptionEditInterface>* KMFRuleTargetOptionEditors( QObject *parent ); -static QValueList<KMFCompilerInterface*>* CompilersForInstaller( const QString& osName ); +static TQPtrList<KMFRuleTargetOptionEditInterface>* KMFRuleTargetOptionEditors( TQObject *tqparent ); +static TQValueList<KMFCompilerInterface*>* CompilersForInstaller( const TQString& osName ); -static KParts::ReadWritePart* KMFMainView( KParts::MainWindow* parent, KMFError* err ); +static KParts::ReadWritePart* KMFMainView( KParts::MainWindow* tqparent, KMFError* err ); private: static KMFCompilerInterface* KMFCompiler( KMFTarget* ); diff --git a/kmyfirewall/core/kmfprotocol.cpp b/kmyfirewall/core/kmfprotocol.cpp index 2fe4dbf..34278f0 100644 --- a/kmyfirewall/core/kmfprotocol.cpp +++ b/kmyfirewall/core/kmfprotocol.cpp @@ -22,12 +22,12 @@ #include "kmfprotocol.h" // QT includes -#include <qfile.h> -#include <qdir.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> // KDE includes #include <kdebug.h> @@ -55,13 +55,13 @@ namespace KMF { KMFProtocol::KMFProtocol( KMFProtocolCategory* protCat, const char* name ) : NetfilterObject( protCat, name ) { - // kdDebug() << "KMFProtocol::KMFProtocol( NetfilterObject* parent, const char* name )" << endl; + // kdDebug() << "KMFProtocol::KMFProtocol( NetfilterObject* tqparent, const char* name )" << endl; m_category = protCat; m_customProtocol = true; m_tcpPorts.clear(); m_udpPorts.clear(); -/* m_udpPorts = new QValueList<int>; - m_tcpPorts = new QValueList<int>;*/ +/* m_udpPorts = new TQValueList<int>; + m_tcpPorts = new TQValueList<int>;*/ } @@ -89,43 +89,43 @@ void KMFProtocol::setCategory( KMFProtocolCategory* protCat ) { } -const QString& KMFProtocol::tcpPortsList() { +const TQString& KMFProtocol::tcpPortsList() { kdDebug() << "void KMFProtocol::tcpPortsList()" << endl; kdDebug() << "Contains: " << tcpPorts().size() << " ports" << endl; - QStringList *l = new QStringList(); - QValueList<int>::iterator it; + TQStringList *l = new TQStringList(); + TQValueList<int>::iterator it; for ( it = tcpPorts().begin(); it != tcpPorts().end(); ++it ) { - QString s = ""; + TQString s = ""; s.setNum( *it ); *l << s; } - return *(new QString( l->join(",") ) ); + return *(new TQString( l->join(",") ) ); } -const QString& KMFProtocol::udpPortsList() { +const TQString& KMFProtocol::udpPortsList() { kdDebug() << "void KMFProtocol::udpPortsList()" << endl; kdDebug() << "Contains: " << m_udpPorts.size() << " ports" << endl; - QStringList *l = new QStringList(); - QValueList<int>::iterator it; + TQStringList *l = new TQStringList(); + TQValueList<int>::iterator it; for ( it = m_udpPorts.begin(); it != m_udpPorts.end(); ++it ) { - QString s = ""; + TQString s = ""; s.setNum( *it ); *l << s; } - return *(new QString( l->join(",") ) ); + return *(new TQString( l->join(",") ) ); } -void KMFProtocol::addPort( const QString& port, int protocol ) { - // kdDebug() << "void KMFProtocol::addPort( const QString& )" << endl; - if ( protocol == UDP && udpPorts().contains( port.toInt() ) == 0 ) { +void KMFProtocol::addPort( const TQString& port, int protocol ) { + // kdDebug() << "void KMFProtocol::addPort( const TQString& )" << endl; + if ( protocol == UDP && udpPorts().tqcontains( port.toInt() ) == 0 ) { kdDebug() << " + + + Register UDP Port:" << port << endl; udpPorts().append( port.toInt() ); qHeapSort( udpPorts() ); changed(); return; } - if ( protocol == TCP && tcpPorts().contains( port.toInt() ) == 0 ) { + if ( protocol == TCP && tcpPorts().tqcontains( port.toInt() ) == 0 ) { kdDebug() << " + + + Register TCP Port:" << port << endl; tcpPorts().append( port.toInt() ); qHeapSort( tcpPorts() ); @@ -136,16 +136,16 @@ void KMFProtocol::addPort( const QString& port, int protocol ) { } -void KMFProtocol::delPort( const QString& port, int protocol ) { - kdDebug() << "void KMFProtocol::delPort( const QString& )" << endl; - if ( protocol == UDP && udpPorts().contains( port.toInt() ) > 0 ) { +void KMFProtocol::delPort( const TQString& port, int protocol ) { + kdDebug() << "void KMFProtocol::delPort( const TQString& )" << endl; + if ( protocol == UDP && udpPorts().tqcontains( port.toInt() ) > 0 ) { kdDebug() << "KMFProtocol: " << name() << " Unregister UDP Port:" << port << endl; - udpPorts().remove( udpPorts().find( port.toInt() ) ); + udpPorts().remove( udpPorts().tqfind( port.toInt() ) ); qHeapSort( udpPorts() ); changed(); - } else if ( protocol == TCP && tcpPorts().contains( port.toInt() ) > 0 ) { + } else if ( protocol == TCP && tcpPorts().tqcontains( port.toInt() ) > 0 ) { kdDebug() << "KMFProtocol: " << name() << " Unregister TCP Port:" << port << endl; - tcpPorts().remove( tcpPorts().find( port.toInt() ) ); + tcpPorts().remove( tcpPorts().tqfind( port.toInt() ) ); qHeapSort( tcpPorts() ); changed(); } else { @@ -169,9 +169,9 @@ bool KMFProtocol::isEquivalent( KMFProtocol *other ){ return false; } - QValueList<int>::iterator itTcp; + TQValueList<int>::iterator itTcp; for( itTcp = tcpPorts().begin(); itTcp != tcpPorts().end(); ++itTcp ) { - if ( other->tcpPorts().contains( *itTcp ) == 0 ) { + if ( other->tcpPorts().tqcontains( *itTcp ) == 0 ) { kdDebug() << "TCP port " << *itTcp << " not found in other protocol." << endl; return false; } @@ -181,9 +181,9 @@ bool KMFProtocol::isEquivalent( KMFProtocol *other ){ kdDebug() << "Have different UDP port count." << endl; return false; } - QValueList<int>::iterator itUdp; + TQValueList<int>::iterator itUdp; for( itUdp = udpPorts().begin(); itUdp != udpPorts().end(); ++itUdp ) { - if ( other->udpPorts().contains( *itUdp ) == 0 ) { + if ( other->udpPorts().tqcontains( *itUdp ) == 0 ) { kdDebug() << "UDP port " << *itUdp << " not found in other protocol." << endl; return false; } @@ -195,12 +195,12 @@ bool KMFProtocol::isEquivalent( KMFProtocol *other ){ bool KMFProtocol::replaceTCPPort( int oldPort, int newPort ){ kdDebug() << "void KMFProtocol::replaceTCPPort( int " << oldPort << ", int " << newPort << " )" << endl; - if ( tcpPorts().contains( newPort ) > 0 ) { + if ( tcpPorts().tqcontains( newPort ) > 0 ) { kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl; return false; } - int index = tcpPorts().findIndex( oldPort ); + int index = tcpPorts().tqfindIndex( oldPort ); kdDebug() << "Found Port at: " << index << endl; if ( index == -1 ) { kdDebug() << "WARNING: port entry: " << oldPort << "not found in protocol: " << name() << endl; @@ -215,12 +215,12 @@ bool KMFProtocol::replaceTCPPort( int oldPort, int newPort ){ bool KMFProtocol::replaceUDPPort( int oldPort, int newPort ){ kdDebug() << "void KMFProtocol::replaceUDPPort( int " << oldPort << ", int " << newPort << " )" << endl; - if ( m_udpPorts.contains( newPort ) > 0 ) { + if ( m_udpPorts.tqcontains( newPort ) > 0 ) { kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl; return false; } - int index = udpPorts().findIndex( oldPort ); + int index = udpPorts().tqfindIndex( oldPort ); kdDebug() << "Found Port at: " << index << endl; if ( index == -1 ) { kdDebug() << "WARNING: port entry: " << oldPort << "not found in protocol: " << name() << endl; @@ -240,62 +240,62 @@ KMFProtocolUsage *KMFProtocol::createUsage() { return use; } -const QDomDocument& KMFProtocol::getDOMTree() { -// kdDebug() << "const QDomDocument& KMFProtocol::getDOMTree()" << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::Protocol_Element ); +const TQDomDocument& KMFProtocol::getDOMTree() { +// kdDebug() << "const TQDomDocument& KMFProtocol::getDOMTree()" << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::Protocol_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Name_Attribute, name() ); root.setAttribute( XML::Description_Attribute, description() ); - QValueList<int>::iterator it; + TQValueList<int>::iterator it; kdDebug() << "Serializte ports: " << udpPortsList() << endl; for ( it = udpPorts().begin(); it != udpPorts().end(); ++it ) { - QDomElement port = doc.createElement( XML::Port_Element ); + TQDomElement port = doc.createElement( XML::Port_Element ); root.appendChild( port ); port.setAttribute( XML::Num_Attribute,*it); port.setAttribute( XML::Protocol_Attribute , XML::UDP_Value ); } kdDebug() << "Serializte ports: " << tcpPortsList() << endl; for ( it = tcpPorts().begin(); it != tcpPorts().end(); ++it ) { - QDomElement port = doc.createElement( XML::Port_Element ); + TQDomElement port = doc.createElement( XML::Port_Element ); root.appendChild( port ); port.setAttribute( XML::Num_Attribute,*it); port.setAttribute( XML::Protocol_Attribute ,XML::TCP_Value ); } doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFProtocol::loadXML( const QDomDocument& doc, QStringList& errors ) { - // kdDebug() << "void KMFProtocol::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFProtocol::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + // kdDebug() << "void KMFProtocol::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void KMFProtocol::loadXML( QDomNode root, QStringList& errors ) { -// kdDebug() << "void KMFProtocol::loadXML( QDomNode root )" << endl; +void KMFProtocol::loadXML( TQDomNode root, TQStringList& errors ) { +// kdDebug() << "void KMFProtocol::loadXML( TQDomNode root )" << endl; // Protocols use Fixed Guids NetfilterObject::loadUuid( root, errors ); - QString name = ""; - QString logging = ""; - QString desc = ""; - QString limit = ""; - QString io = ""; + TQString name = ""; + TQString logging = ""; + TQString desc = ""; + TQString limit = ""; + TQString io = ""; name = root.toElement().attribute( XML::Name_Attribute ); desc = root.toElement().attribute( XML::Description_Attribute ); - setDescription( *( new QString( desc ) ) ); - setName( *(new QString( name ) ) ); + setDescription( *( new TQString( desc ) ) ); + setName( *(new TQString( name ) ) ); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() && curr.nodeName() == XML::Port_Element ) { - QString port = curr.toElement().attribute( XML::Num_Attribute ); - QString protocol = curr.toElement().attribute( XML::Protocol_Attribute ); + TQString port = curr.toElement().attribute( XML::Num_Attribute ); + TQString protocol = curr.toElement().attribute( XML::Protocol_Attribute ); if ( protocol == XML::UDP_Value ) { addPort( port, UDP ); } diff --git a/kmyfirewall/core/kmfprotocol.h b/kmyfirewall/core/kmfprotocol.h index d47b64b..d742fbb 100644 --- a/kmyfirewall/core/kmfprotocol.h +++ b/kmyfirewall/core/kmfprotocol.h @@ -25,12 +25,12 @@ #include "netfilterobject.h" // QT includes -#include <qstringlist.h> -#include <qstring.h> -#include <qguardedptr.h> -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qmap.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqguardedptr.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqmap.h> // KDE includes #include <kdemacros.h> @@ -59,14 +59,14 @@ public: virtual int type(); virtual void clear(); - void addPort( const QString& , int ); - void delPort( const QString&, int ); + void addPort( const TQString& , int ); + void delPort( const TQString&, int ); void setCustomProtocol( bool ); void setCategory( KMFProtocolCategory* ); - virtual const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); bool customProtocol() const { return m_customProtocol; @@ -76,17 +76,17 @@ public: return m_category; } - QValueList<int>& udpPorts() { + TQValueList<int>& udpPorts() { return m_udpPorts; } - QValueList<int>& tcpPorts() { + TQValueList<int>& tcpPorts() { return m_tcpPorts; } - const QString& udpPortsList(); - const QString& tcpPortsList(); + const TQString& udpPortsList(); + const TQString& tcpPortsList(); bool replaceTCPPort( int oldPort, int newPort ); bool replaceUDPPort( int oldPort, int newPort ); @@ -98,13 +98,13 @@ public: KMFProtocolUsage *createUsage(); private: - KMFProtocol( KMFProtocolCategory* parent, const char* name ); + KMFProtocol( KMFProtocolCategory* tqparent, const char* name ); private: - QValueList<KMFProtocolUsage*> m_usages; + TQValueList<KMFProtocolUsage*> m_usages; KMFProtocolCategory* m_category; - QValueList<int> m_udpPorts; - QValueList<int> m_tcpPorts; + TQValueList<int> m_udpPorts; + TQValueList<int> m_tcpPorts; bool m_customProtocol; }; } diff --git a/kmyfirewall/core/kmfprotocolcategory.cpp b/kmyfirewall/core/kmfprotocolcategory.cpp index dadfd9a..659db47 100644 --- a/kmyfirewall/core/kmfprotocolcategory.cpp +++ b/kmyfirewall/core/kmfprotocolcategory.cpp @@ -12,7 +12,7 @@ #include "kmfprotocolcategory.h" // QT includes -#include <qdom.h> +#include <tqdom.h> // KDE includes #include <kdebug.h> @@ -27,21 +27,21 @@ namespace KMF { /* Never Ever Change This Uuids! */ -const QUuid& KMFProtocolCategory::customCategoryUuid() { - return *(new QUuid( "{9758012f-e2a0-4594-938f-c154a7078752}" ) ); +const TQUuid& KMFProtocolCategory::customCategoryUuid() { + return *(new TQUuid( "{9758012f-e2a0-4594-938f-c154a7078752}" ) ); }; -const QUuid& KMFProtocolCategory::miscCategoryUuid() { - return *(new QUuid( "{02e7113c-535d-447d-8a25-5c9e89fd3f79}" ) ); +const TQUuid& KMFProtocolCategory::miscCategoryUuid() { + return *(new TQUuid( "{02e7113c-535d-447d-8a25-5c9e89fd3f79}" ) ); }; -KMFProtocolCategory* KMFProtocolCategory::createCategory( const QString& name ) { +KMFProtocolCategory* KMFProtocolCategory::createCategory( const TQString& name ) { KMFProtocolCategory* cat = new KMFProtocolCategory( 0, name.latin1() ); cat->setName( name ); return cat; } -KMFProtocol* KMFProtocolCategory::createProtocol( const QString& name ) { +KMFProtocol* KMFProtocolCategory::createProtocol( const TQString& name ) { KMFProtocol* prot = new KMFProtocol( this, name.latin1() ); addProtocol( prot ); return prot; @@ -58,7 +58,7 @@ KMFProtocolCategory* KMFProtocolCategory::getCustomCategory() { -KMFProtocolCategory::KMFProtocolCategory ( NetfilterObject* parent, const char* name ) : NetfilterObject ( parent, name ) { +KMFProtocolCategory::KMFProtocolCategory ( NetfilterObject* tqparent, const char* name ) : NetfilterObject ( tqparent, name ) { // m_protocols; } @@ -72,16 +72,16 @@ void KMFProtocolCategory::clear() { } -QValueList<KMFProtocol*>& KMFProtocolCategory::protocols() const { - QValueList<KMFProtocol*>* ret_val = new QValueList<KMFProtocol*>; +TQValueList<KMFProtocol*>& KMFProtocolCategory::protocols() const { + TQValueList<KMFProtocol*>* ret_val = new TQValueList<KMFProtocol*>; *ret_val = m_protocols; return *ret_val; } -KMFProtocol* KMFProtocolCategory::findProtocolByName ( const QString& name ) const { - // kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByName( const QString& name ) const" << endl; - QValueList< KMFProtocol* >::const_iterator it; +KMFProtocol* KMFProtocolCategory::findProtocolByName ( const TQString& name ) const { + // kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByName( const TQString& name ) const" << endl; + TQValueList< KMFProtocol* >::const_iterator it; for ( it = m_protocols.constBegin(); it != m_protocols.constEnd(); ++it ) { KMFProtocol *p = *it; if ( p->name() == name ) { @@ -90,9 +90,9 @@ KMFProtocol* KMFProtocolCategory::findProtocolByName ( const QString& name ) con } return 0; } -KMFProtocol* KMFProtocolCategory::findProtocolByUuid ( const QUuid& uuid ) const { -// kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByUuid( const QUuid& uuid ) const" << endl; - QValueList< KMFProtocol* >::const_iterator it; +KMFProtocol* KMFProtocolCategory::findProtocolByUuid ( const TQUuid& uuid ) const { +// kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByUuid( const TQUuid& uuid ) const" << endl; + TQValueList< KMFProtocol* >::const_iterator it; for ( it = m_protocols.constBegin(); it != m_protocols.constEnd(); ++it ) { KMFProtocol *p = *it; if ( p->uuid() == uuid ) { @@ -112,7 +112,7 @@ KMFProtocol* KMFProtocolCategory::addProtocol ( KMFProtocol* proto ) { void KMFProtocolCategory::delProtocol ( KMFProtocol* prot, bool destructive = false ) { // kdDebug() << "void KMFProtocolCategory::delProtocol( KMFProtocol* prot )" << endl; - QValueList<KMFProtocol*>::iterator it; + TQValueList<KMFProtocol*>::iterator it; for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) { KMFProtocol *p = *it; if ( p->name() == prot->name() ) { @@ -130,9 +130,9 @@ void KMFProtocolCategory::delProtocol ( KMFProtocol* prot, bool destructive = fa changed(); } -void KMFProtocolCategory::slotOnProtocolDeleted( QObject* prot ) { - kdDebug() << "KMFProtocolCategory::slotOnProtocolDeleted( QObject* )" << endl; - QValueList<KMFProtocol*>::iterator it; +void KMFProtocolCategory::slotOnProtocolDeleted( TQObject* prot ) { + kdDebug() << "KMFProtocolCategory::slotOnProtocolDeleted( TQObject* )" << endl; + TQValueList<KMFProtocol*>::iterator it; for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) { KMFProtocol *p = *it; if ( p == prot ) { @@ -145,16 +145,16 @@ void KMFProtocolCategory::slotOnProtocolDeleted( QObject* prot ) { // deleteLater(); } -const QDomDocument& KMFProtocolCategory::getDOMTree() { - kdDebug() << "const QDomDocument& KMFProtocolCategory::getDOMTree() " << endl; - QDomDocument doc; - QDomElement root = doc.createElement ( XML::ProtocolCategory_Element ); +const TQDomDocument& KMFProtocolCategory::getDOMTree() { + kdDebug() << "const TQDomDocument& KMFProtocolCategory::getDOMTree() " << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement ( XML::ProtocolCategory_Element ); NetfilterObject::saveUuid ( root ); root.setAttribute ( XML::Name_Attribute, name() ); root.setAttribute ( XML::Description_Attribute, description() ); - QValueList< KMFProtocol* >::iterator it; + TQValueList< KMFProtocol* >::iterator it; for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) { KMFProtocol* p = *it; if ( p->customProtocol() ) { @@ -162,47 +162,47 @@ const QDomDocument& KMFProtocolCategory::getDOMTree() { } } doc.appendChild ( root ); - return * ( new QDomDocument ( doc ) ); + return * ( new TQDomDocument ( doc ) ); } -void KMFProtocolCategory::loadXML ( const QDomDocument& doc, QStringList& errors ) { - // kdDebug() << "void KMFProtocolCategory::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFProtocolCategory::loadXML ( const TQDomDocument& doc, TQStringList& errors ) { + // kdDebug() << "void KMFProtocolCategory::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML ( root, errors ); } -void KMFProtocolCategory::loadXML ( QDomNode root, QStringList& errors ) { -// kdDebug() << "void KMFProtocolCategory::loadXML( QDomNode root )" << endl; +void KMFProtocolCategory::loadXML ( TQDomNode root, TQStringList& errors ) { +// kdDebug() << "void KMFProtocolCategory::loadXML( TQDomNode root )" << endl; NetfilterObject::loadUuid ( root, errors ); setName( root.toElement().attribute ( XML::Name_Attribute ) ); setDescription( root.toElement().attribute ( XML::Description_Attribute ) ); - QValueList< KMFProtocol* > xmlDefinedProtocols; - QDomNode curr = root.firstChild(); + TQValueList< KMFProtocol* > xmlDefinedProtocols; + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) { - QString name = curr.toElement().attribute ( XML::Name_Attribute ); - QString uuid = curr.toElement().attribute ( XML::Uuid_Attribute ); + TQString name = curr.toElement().attribute ( XML::Name_Attribute ); + TQString uuid = curr.toElement().attribute ( XML::Uuid_Attribute ); KMFProtocol *p = findProtocolByUuid( uuid ); if ( ! p ) { p = createProtocol( name ); kdDebug() << " + + Register Protocol: " << name << " with uuid: " << uuid << endl; - QDomDocument protocol; + TQDomDocument protocol; protocol.appendChild( curr.cloneNode( true ) ); - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); p->loadXML( protocol, *errors ); } xmlDefinedProtocols.append ( p ); } // if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) { -// QString uuid = curr.toElement().attribute ( XML::ProtocolUuid_Attribute ); +// TQString uuid = curr.toElement().attribute ( XML::ProtocolUuid_Attribute ); // KMFProtocol *p = findProtocolByUuid( uuid ); // if ( ! p ) { // p = createProtocol( curr.toElement().attribute ( XML::Name_Attribute ) ); -// QDomDocument protocol; +// TQDomDocument protocol; // protocol.appendChild( curr.cloneNode( true ) ); -// QStringList *errors = new QStringList(); +// TQStringList *errors = new TQStringList(); // p->loadXML( protocol, *errors ); // } // xmlDefinedProtocols.append ( p ); @@ -211,13 +211,13 @@ void KMFProtocolCategory::loadXML ( QDomNode root, QStringList& errors ) { } // { -// QValueList< KMFProtocol* >& allprotocols = protocols(); -// QValueList< KMFProtocol* >::iterator itAllProtocols; +// TQValueList< KMFProtocol* >& allprotocols = protocols(); +// TQValueList< KMFProtocol* >::iterator itAllProtocols; // for ( itAllProtocols = allprotocols.begin(); itAllProtocols != allprotocols.end(); ++itAllProtocols ) { // KMFProtocol *oldProtocol = *itAllProtocols; // // bool found = false; -// QValueList< KMFProtocol* >::iterator itProtocols; +// TQValueList< KMFProtocol* >::iterator itProtocols; // for ( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) { // KMFProtocol* p = *itProtocols; // if ( p == oldProtocol ) { diff --git a/kmyfirewall/core/kmfprotocolcategory.h b/kmyfirewall/core/kmfprotocolcategory.h index 5358898..1a650a6 100644 --- a/kmyfirewall/core/kmfprotocolcategory.h +++ b/kmyfirewall/core/kmfprotocolcategory.h @@ -15,13 +15,13 @@ #include "netfilterobject.h" // QT includes -#include <qstringlist.h> -#include <qstring.h> -#include <qguardedptr.h> -#include <qvaluelist.h> -#include <qmap.h> -#include <quuid.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqguardedptr.h> +#include <tqvaluelist.h> +#include <tqmap.h> +#include <tquuid.h> +#include <tqobject.h> // KDE includes #include <kdemacros.h> @@ -37,48 +37,49 @@ class KMFProtocol; class KDE_EXPORT KMFProtocolCategory : public NetfilterObject { Q_OBJECT + TQ_OBJECT public: - static KMFProtocolCategory* createCategory( const QString& name ); + static KMFProtocolCategory* createCategory( const TQString& name ); static KMFProtocolCategory* getCustomCategory(); private: - static const QUuid& customCategoryUuid(); - static const QUuid& miscCategoryUuid(); + static const TQUuid& customCategoryUuid(); + static const TQUuid& miscCategoryUuid(); public: ~KMFProtocolCategory(); - KMFProtocol* createProtocol( const QString& name ); + KMFProtocol* createProtocol( const TQString& name ); - QValueList< KMFProtocol* >& protocols() const; + TQValueList< KMFProtocol* >& protocols() const; - KMFProtocol* findProtocolByUuid( const QUuid& name ) const; + KMFProtocol* findProtocolByUuid( const TQUuid& name ) const; virtual int type(); virtual void clear(); - virtual const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); void delProtocol( KMFProtocol*, bool destructive /* = false */); public slots: - void slotOnProtocolDeleted( QObject* protocol ); + void slotOnProtocolDeleted( TQObject* protocol ); private: - KMFProtocol* findProtocolByName( const QString& name ) const; + KMFProtocol* findProtocolByName( const TQString& name ) const; KMFProtocol* addProtocol( KMFProtocol* ); private: // DATA - KMFProtocolCategory( NetfilterObject* parent, const char* name ); - QString m_icon; - QValueList< KMFProtocol* > m_protocols; + KMFProtocolCategory( NetfilterObject* tqparent, const char* name ); + TQString m_icon; + TQValueList< KMFProtocol* > m_protocols; }; diff --git a/kmyfirewall/core/kmfprotocollibrary.cpp b/kmyfirewall/core/kmfprotocollibrary.cpp index fe42d54..8d589f9 100644 --- a/kmyfirewall/core/kmfprotocollibrary.cpp +++ b/kmyfirewall/core/kmfprotocollibrary.cpp @@ -12,12 +12,12 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004 #include "kmfprotocollibrary.h" // QT includes -#include <qfile.h> -#include <qdir.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> // KDE includes #include <kapplication.h> @@ -57,23 +57,23 @@ KMFProtocolLibrary* KMFProtocolLibrary::instance() { } /** End Static Stuff **/ -KMFProtocolLibrary::KMFProtocolLibrary( QObject* parent, const char* name ) : QObject( parent, name ) { +KMFProtocolLibrary::KMFProtocolLibrary( TQObject* tqparent, const char* name ) : TQObject( tqparent, name ) { m_libraryLoaded = false; forceProtocolLibraryReload(); } KMFProtocolLibrary::~KMFProtocolLibrary() {} -QValueList< KMFProtocolCategory* >& KMFProtocolLibrary::protocolCategories() { +TQValueList< KMFProtocolCategory* >& KMFProtocolLibrary::protocolCategories() { return m_protocolCategories; } -QValueList<KMFProtocol*>& KMFProtocolLibrary::allProtocols() { +TQValueList<KMFProtocol*>& KMFProtocolLibrary::allProtocols() { m_protocols.clear(); - QValueList<KMFProtocolCategory* >::iterator it; + TQValueList<KMFProtocolCategory* >::iterator it; for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) { KMFProtocolCategory* cat = *it; - QValueList<KMFProtocol*>& currProtocols = cat->protocols(); - QValueList<KMFProtocol*>::iterator itProt; + TQValueList<KMFProtocol*>& currProtocols = cat->protocols(); + TQValueList<KMFProtocol*>::iterator itProt; for( itProt = currProtocols.begin(); itProt != currProtocols.end(); ++itProt ) { m_protocols.append( *itProt ); } @@ -96,7 +96,7 @@ void KMFProtocolLibrary::forceProtocolLibraryReload() { KMFErrorHandler *errH = new KMFErrorHandler( "KMFErrorHandler" ); KStandardDirs std_dir; - QString file = std_dir.findResource( "data", "kmyfirewall/protocols/kmfprotocollibrary.xml" ); + TQString file = std_dir.findResource( "data", "kmyfirewall/protocols/kmfprotocollibrary.xml" ); KURL url; url.setPath( file ); kdDebug() << "STD lib at: " << file << endl; @@ -108,11 +108,11 @@ void KMFProtocolLibrary::forceProtocolLibraryReload() { return; } - QValueList<KMFProtocolCategory* >::iterator it; + TQValueList<KMFProtocolCategory* >::iterator it; for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) { KMFProtocolCategory* cat = *it; - QValueList<KMFProtocol*>& currProtocols = cat->protocols(); - QValueList<KMFProtocol*>::iterator itProt; + TQValueList<KMFProtocol*>& currProtocols = cat->protocols(); + TQValueList<KMFProtocol*>::iterator itProt; for( itProt = currProtocols.begin(); itProt != currProtocols.end(); ++itProt ) { KMFProtocol *p = *itProt; p->setCustomProtocol( false ); @@ -144,15 +144,15 @@ void KMFProtocolLibrary::forceProtocolLibraryReload() { void KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& url, KMFError* err ) { kdDebug() << "KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& " << url.fileName() << " )" << endl; -// QPtrList<KMFProtocol> *prots = new QPtrList<KMFProtocol>(); +// TQPtrList<KMFProtocol> *prots = new TQPtrList<KMFProtocol>(); KIO::UDSEntry f_props; if ( ! KIO::NetAccess::stat( url , f_props, KApplication::kApplication()->mainWidget() ) ) { - const QString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>" + const TQString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>" "<p>If you are working with files stored on remote computers " - "make sure that the network is up and the fileserver running.</qt>" ).arg( url.url() ); + "make sure that the network is up and the fileserver running.</qt>" ).tqarg( url.url() ); err->setErrType( KMFError::NORMAL ); err->setErrMsg( msg ); return; @@ -161,30 +161,30 @@ void KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& url, KMFEr KFileItem *props = new KFileItem( f_props, url ); kdDebug() << "Found file permissions: " << props->permissionsString() << endl; if ( !props->isReadable() ) { - const QString msg = i18n( "<qt><p>You don't have the permissions to read file: <b>%1</b></p></qt>" ).arg( url.url() ); + const TQString msg = i18n( "<qt><p>You don't have the permissions to read file: <b>%1</b></p></qt>" ).tqarg( url.url() ); err->setErrType( KMFError::NORMAL ); err->setErrMsg( msg ); return; } - QString xmlfile; + TQString xmlfile; if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) { - const QString msg = i18n( "<qt><p>Could not download file: <b>%1</b></p></qt>" ).arg( url.url() ); + const TQString msg = i18n( "<qt><p>Could not download file: <b>%1</b></p></qt>" ).tqarg( url.url() ); err->setErrType( KMFError::NORMAL ); err->setErrMsg( msg ); return; } if ( xmlfile.isEmpty() ) { - const QString msg = i18n( "<qt><p>No File found at URL: <b>%1</b></p></qt>" ).arg( url.url() ); + const TQString msg = i18n( "<qt><p>No File found at URL: <b>%1</b></p></qt>" ).tqarg( url.url() ); err->setErrType( KMFError::NORMAL ); err->setErrMsg( msg ); return; } - QFile kmfrsFile( xmlfile ); + TQFile kmfrsFile( xmlfile ); - QDomDocument domTree; + TQDomDocument domTree; if ( !kmfrsFile.open( IO_ReadOnly ) ) { kdDebug() << "Couldn't open file" << endl; return; @@ -196,25 +196,25 @@ void KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& url, KMFEr } kmfrsFile.close(); - QDomElement root = domTree.documentElement(); - QDomNode curr = root.firstChild(); + TQDomElement root = domTree.documentElement(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { // kdDebug() << "Parsing Node: " << curr.nodeName() << endl; if ( curr.isElement() && curr.nodeName() == XML::ProtocolCategory_Element ) { // kdDebug() << "Parsing XML::ProtocolCategory_Element " << endl; - QString uuid = curr.toElement().attribute( XML::Uuid_Attribute ); + TQString uuid = curr.toElement().attribute( XML::Uuid_Attribute ); KMFProtocolCategory *protCat = findCategory( uuid ); // kdDebug() << "asghasgh" << endl; if ( ! protCat ) { - QString name = curr.toElement().attribute( XML::Name_Attribute ); + TQString name = curr.toElement().attribute( XML::Name_Attribute ); kdDebug() << " + Creating KMFProtocolCategory: " << name << endl; protCat = KMFProtocolCategory::createCategory( name ); m_protocolCategories.append( protCat ); } - QDomDocument protocolCat; + TQDomDocument protocolCat; protocolCat.appendChild( curr.cloneNode( true ) ); - QStringList *errors = new QStringList(); + TQStringList *errors = new TQStringList(); protCat->loadXML( protocolCat, *errors ); // FIXME: Check Errors } @@ -230,19 +230,19 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { KMFError *err = new KMFError(); KStandardDirs std_dir; - QString saveFile = std_dir.saveLocation( "data", "kmyfirewall" ); + TQString saveFile = std_dir.saveLocation( "data", "kmyfirewall" ); KURL url; url.setPath( saveFile + "protocols/kmfcustomprotocollibrary.xml" ); - QString sDir = saveFile; - QDir d0( sDir ); + TQString sDir = saveFile; + TQDir d0( sDir ); if ( ! d0.exists() ) { d0.mkdir( sDir, true ); } sDir = saveFile + "protocols/"; - QDir d1( sDir ); + TQDir d1( sDir ); if ( ! d1.exists() ) { d1.mkdir( sDir, true ); } @@ -250,29 +250,29 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { KTempFile file; - QDomDocument doc( "kmyfirewall-protocollibrary" ); - QDomElement root = doc.createElement( "protocollibrary" ); + TQDomDocument doc( "kmyfirewall-protocollibrary" ); + TQDomElement root = doc.createElement( "protocollibrary" ); root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION ); root.setAttribute( XML::MinVersion_Attribute, "1.0.0" ); root.setAttribute( XML::MaxVersion_Attribute, "~" ); - QValueList<KMFProtocolCategory* >::iterator it; + TQValueList<KMFProtocolCategory* >::iterator it; for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) { KMFProtocolCategory* cat = *it; root.appendChild( cat->getDOMTree() ); } doc.appendChild( root ); - // return *( new QString( doc.toString() ) ); - const QString& xml = doc.toString(); + // return *( new TQString( doc.toString() ) ); + const TQString& xml = doc.toString(); kdDebug() << "XML: " << xml << endl; - if ( file.name() != QString::null ) { - QFile f( file.name() ); + if ( file.name() != TQString() ) { + TQFile f( file.name() ); f.remove(); bool isWriteable = f.open( IO_ReadWrite ); if ( isWriteable ) { - QTextStream ts( &f ); + TQTextStream ts( &f ); ts << xml << endl; f.flush(); f.close(); @@ -285,7 +285,7 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { "<p>Please make sure that you have the permissions to write to this Directory.<br>" "If you are working with remotely stored files " "make sure that the target host and the directory is reachable." - "</p></qt>" ).arg( url.url() ) ); + "</p></qt>" ).tqarg( url.url() ) ); file.unlink(); // errH->showError( err ); return err; @@ -303,8 +303,8 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { } else { // generate retrun error object err -> setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file %1 for writing failed.\n" - "Please make sure that you are logged in as root" ).arg( file.name() ); + const TQString& msg = i18n( "Opening file %1 for writing failed.\n" + "Please make sure that you are logged in as root" ).tqarg( file.name() ); err -> setErrMsg( msg ); file.unlink(); // errH->showError( err ); @@ -314,8 +314,8 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { } else { // generate retrun error object err -> setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file %1 for writing failed.\n" - "Please make sure that you are logged in as root" ).arg( file.name() ); + const TQString& msg = i18n( "Opening file %1 for writing failed.\n" + "Please make sure that you are logged in as root" ).tqarg( file.name() ); err -> setErrMsg( msg ); file.unlink(); // errH->showError( err ); @@ -325,17 +325,17 @@ KMFError* KMFProtocolLibrary::saveProtocolLibrary() { // generate retrun error object err -> setErrType( KMFError::FATAL ); - const QString& msg = i18n( "File to save = QString::null. This is a bug." ); + const TQString& msg = i18n( "File to save = TQString(). This is a bug." ); err -> setErrMsg( msg ); file.unlink(); // errH->showError( err ); return err; } -KMFProtocol* KMFProtocolLibrary::findProtocolByName( const QString& name ) { -// kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findProtocol( " << name << " )" << endl; - QValueList< KMFProtocol* >& allProtos = allProtocols(); - QValueList< KMFProtocol* >::iterator it; +KMFProtocol* KMFProtocolLibrary::findProtocolByName( const TQString& name ) { +// kdDebug() << "TQPtrList<KMFProtocol>* KMFProtocol::findProtocol( " << name << " )" << endl; + TQValueList< KMFProtocol* >& allProtos = allProtocols(); + TQValueList< KMFProtocol* >::iterator it; for( it = allProtos.begin(); it != allProtos.end(); ++it ) { KMFProtocol *p = *it; if ( p->name() == name ) { @@ -347,10 +347,10 @@ KMFProtocol* KMFProtocolLibrary::findProtocolByName( const QString& name ) { return 0; } -KMFProtocol* KMFProtocolLibrary::findProtocolByUuid( const QUuid& uuid ) { -// kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findProtocolByUuid( " << uuid.toString() << " )" << endl; - QValueList< KMFProtocol* >& allProtos = allProtocols(); - QValueList< KMFProtocol* >::iterator it; +KMFProtocol* KMFProtocolLibrary::findProtocolByUuid( const TQUuid& uuid ) { +// kdDebug() << "TQPtrList<KMFProtocol>* KMFProtocol::findProtocolByUuid( " << uuid.toString() << " )" << endl; + TQValueList< KMFProtocol* >& allProtos = allProtocols(); + TQValueList< KMFProtocol* >::iterator it; for( it = allProtos.begin(); it != allProtos.end(); ++it ) { KMFProtocol *p = *it; if ( p->uuid() == uuid ) { @@ -363,9 +363,9 @@ KMFProtocol* KMFProtocolLibrary::findProtocolByUuid( const QUuid& uuid ) { } KMFProtocol* KMFProtocolLibrary::findEquivalentProtocol( KMFProtocol* comp ) { - kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findEquivalentProtocol( " << comp->name() << " )" << endl; - QValueList< KMFProtocol* >& allProtos = allProtocols(); - QValueList< KMFProtocol* >::iterator it; + kdDebug() << "TQPtrList<KMFProtocol>* KMFProtocol::findEquivalentProtocol( " << comp->name() << " )" << endl; + TQValueList< KMFProtocol* >& allProtos = allProtocols(); + TQValueList< KMFProtocol* >::iterator it; for( it = allProtos.begin(); it != allProtos.end(); ++it ) { KMFProtocol *p = *it; if ( p->isEquivalent( comp ) ) { @@ -378,9 +378,9 @@ KMFProtocol* KMFProtocolLibrary::findEquivalentProtocol( KMFProtocol* comp ) { return 0; } -KMFProtocolCategory* KMFProtocolLibrary::findCategory( const QUuid& uuid ) { - // kdDebug() << "KMFProtocolCategory* KMFProtocolLibrary::findCategory( const QUuid& " << uuid << " )" << endl; - QValueList< KMFProtocolCategory* >::iterator it; +KMFProtocolCategory* KMFProtocolLibrary::findCategory( const TQUuid& uuid ) { + // kdDebug() << "KMFProtocolCategory* KMFProtocolLibrary::findCategory( const TQUuid& " << uuid << " )" << endl; + TQValueList< KMFProtocolCategory* >::iterator it; for( it = m_protocolCategories.begin(); it != m_protocolCategories.end(); ++it ) { // kdDebug() << "At cat: " << (*it)->name() << " " << (*it)->uuid() << endl; if ( (*it)->uuid() == uuid ) { diff --git a/kmyfirewall/core/kmfprotocollibrary.h b/kmyfirewall/core/kmfprotocollibrary.h index 4f3fad6..669102a 100644 --- a/kmyfirewall/core/kmfprotocollibrary.h +++ b/kmyfirewall/core/kmfprotocollibrary.h @@ -12,10 +12,10 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004 #ifndef KMFKMFPROTOCOLLIBRARY_H #define KMFKMFPROTOCOLLIBRARY_H -#include <qobject.h> -#include <qvaluelist.h> -#include <qstring.h> -#include <quuid.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqstring.h> +#include <tquuid.h> #include <kurl.h> namespace KMF { @@ -26,8 +26,9 @@ class KMFProtocolCategory; /** @author Christian Hubinger <chubinger@irrsinnig.org> */ -class KMFProtocolLibrary : public QObject { +class KMFProtocolLibrary : public TQObject { Q_OBJECT + TQ_OBJECT /** Static Stuff **/ public: static KMFProtocolLibrary* instance(); @@ -41,25 +42,25 @@ public: public: - // QPtrList<KMFProtocol>* protocolLibrary(); + // TQPtrList<KMFProtocol>* protocolLibrary(); KMFError* saveProtocolLibrary(); void forceProtocolLibraryReload(); void loadProtocolDefinitionsFromURL( const KURL&, KMFError* err ); - QValueList<KMFProtocolCategory*>& protocolCategories(); - QValueList<KMFProtocol*>& allProtocols(); + TQValueList<KMFProtocolCategory*>& protocolCategories(); + TQValueList<KMFProtocol*>& allProtocols(); - KMFProtocolCategory* findCategory( const QUuid& uuid ); - KMFProtocol* findProtocolByName( const QString& name ); - KMFProtocol* findProtocolByUuid( const QUuid& uuid ); + KMFProtocolCategory* findCategory( const TQUuid& uuid ); + KMFProtocol* findProtocolByName( const TQString& name ); + KMFProtocol* findProtocolByUuid( const TQUuid& uuid ); KMFProtocol* findEquivalentProtocol( KMFProtocol* compare ); private: - QValueList< KMFProtocolCategory* > m_protocolCategories; - QValueList< KMFProtocol* > m_protocols; + TQValueList< KMFProtocolCategory* > m_protocolCategories; + TQValueList< KMFProtocol* > m_protocols; private: - KMFProtocolLibrary( QObject* parent, const char* name ); + KMFProtocolLibrary( TQObject* tqparent, const char* name ); KMFProtocolLibrary(); bool m_libraryLoaded; diff --git a/kmyfirewall/core/kmfprotocolusage.cpp b/kmyfirewall/core/kmfprotocolusage.cpp index 31cc243..a62a2ed 100644 --- a/kmyfirewall/core/kmfprotocolusage.cpp +++ b/kmyfirewall/core/kmfprotocolusage.cpp @@ -12,12 +12,12 @@ #include "kmfprotocolusage.h" // QT includes -#include <qfile.h> -#include <qdir.h> -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> // KDE includes #include <kdebug.h> @@ -43,7 +43,7 @@ namespace KMF { -KMFProtocolUsage::KMFProtocolUsage( NetfilterObject* parent, const char* name ) : NetfilterObject( parent, name ) { +KMFProtocolUsage::KMFProtocolUsage( NetfilterObject* tqparent, const char* name ) : NetfilterObject( tqparent, name ) { m_protocol = 0; m_limit_interval = "minute"; m_limit = -1; @@ -55,20 +55,20 @@ KMFProtocolUsage::~KMFProtocolUsage() { } -const QString& KMFProtocolUsage::name() { +const TQString& KMFProtocolUsage::name() { // kdDebug() << "KMFProtocolUsage::name()" << endl; if ( ! m_protocol ) { kdDebug() << "ERROR: No Protocol Stored in KMFProtocolUsage instance!" << endl; - return *( new QString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") ); + return *( new TQString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") ); } return protocol()->name(); } -const QString& KMFProtocolUsage::description() { +const TQString& KMFProtocolUsage::description() { // kdDebug() << "KMFProtocolUsage::description()" << endl; if ( ! m_protocol ) { kdDebug() << "ERROR: No Protocol Stored in KMFProtocolUsage instance!" << endl; - return *( new QString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") ); + return *( new TQString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") ); } return protocol()->description(); } @@ -87,14 +87,14 @@ void KMFProtocolUsage::setProtocol( KMFProtocol* p ) { // kdDebug() << "KMFProtocolUsage::setProtocol( KMFProtocol* " << p->name() << " )" << endl; m_protocol = p; - disconnect( m_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolDeleted( QObject* ) ) ); - connect( m_protocol, SIGNAL( destroyed( QObject* ) ), - this, SLOT( slotOnProtocolDeleted( QObject* ) ) ); + disconnect( m_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolDeleted( TQObject* ) ) ); + connect( m_protocol, TQT_SIGNAL( destroyed( TQObject* ) ), + this, TQT_SLOT( slotOnProtocolDeleted( TQObject* ) ) ); } -void KMFProtocolUsage::slotOnProtocolDeleted( QObject* ) { - kdDebug() << "KMFProtocolUsage::slotOnProtocolDeleted( QObject* )" << endl; +void KMFProtocolUsage::slotOnProtocolDeleted( TQObject* ) { + kdDebug() << "KMFProtocolUsage::slotOnProtocolDeleted( TQObject* )" << endl; deleteLater(); } @@ -108,8 +108,8 @@ void KMFProtocolUsage::setIO ( int io ) { m_io = io; } -void KMFProtocolUsage::setLimitInterval( const QString& interval ) { - // kdDebug() << "void KMFProtocolUsage::setLimitInterval( const QString& )" << endl; +void KMFProtocolUsage::setLimitInterval( const TQString& interval ) { + // kdDebug() << "void KMFProtocolUsage::setLimitInterval( const TQString& )" << endl; if ( m_limit_interval == interval ) { return; } @@ -135,10 +135,10 @@ void KMFProtocolUsage::setLogging( bool onoff ) { changed(); } -const QDomDocument& KMFProtocolUsage::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFProtocolUsage::getDOMTree()" << endl; - QDomDocument doc; - QDomElement root = doc.createElement( XML::ProtocolUsage_Element ); +const TQDomDocument& KMFProtocolUsage::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFProtocolUsage::getDOMTree()" << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement( XML::ProtocolUsage_Element ); NetfilterObject::saveUuid( root ); // root.setAttribute( "protocolName", protocol()->name() ); root.setAttribute( XML::ProtocolUuid_Attribute, protocol()->uuid().toString() ); @@ -156,30 +156,30 @@ const QDomDocument& KMFProtocolUsage::getDOMTree() { root.setAttribute( XML::IO_Attribute, XML::Outgoing_Value ); } - QString lim = ""; + TQString lim = ""; lim = lim.setNum( m_limit ); lim += "/" + m_limit_interval; root.setAttribute( XML::Limit_Attribute, lim ); doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFProtocolUsage::loadXML( const QDomDocument& doc, QStringList& errors ) { - // kdDebug() << "void KMFProtocolUsage::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFProtocolUsage::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + // kdDebug() << "void KMFProtocolUsage::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void KMFProtocolUsage::loadXML( QDomNode root, QStringList& errors ) { - kdDebug() << "void KMFProtocolUsage::loadXML( QDomNode root )" << endl; +void KMFProtocolUsage::loadXML( TQDomNode root, TQStringList& errors ) { + kdDebug() << "void KMFProtocolUsage::loadXML( TQDomNode root )" << endl; NetfilterObject::loadUuid ( root, errors ); - QString protocolName = ""; - QString protocolUuid = ""; - QString logging = ""; - QString desc = ""; - QString limit = ""; + TQString protocolName = ""; + TQString protocolUuid = ""; + TQString logging = ""; + TQString desc = ""; + TQString limit = ""; - QString io = ""; + TQString io = ""; // protocolName = ""; @@ -198,9 +198,9 @@ void KMFProtocolUsage::loadXML( QDomNode root, QStringList& errors ) { if ( ! protocolUuid.isEmpty() ) { // kdDebug() << "Using Protocol Uuid!" << endl; - KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByUuid( *( new QUuid( protocolUuid ) ) ); + KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByUuid( *( new TQUuid( protocolUuid ) ) ); if ( ! prot ) { - errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).arg( protocolUuid ) ) ); + errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).tqarg( protocolUuid ) ) ); kdDebug() << "ERROR: Could not find Protocol: " << protocolUuid << " in protocol Library" << endl; return; } @@ -211,7 +211,7 @@ void KMFProtocolUsage::loadXML( QDomNode root, QStringList& errors ) { KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByName( protocolName ); if ( ! prot ) { - errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).arg( protocolName ) ) ); + errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).tqarg( protocolName ) ) ); kdDebug() << "ERROR: Could not find Protocol: " << protocolName << " in protocol Library" << endl; return; } @@ -240,9 +240,9 @@ void KMFProtocolUsage::loadXML( QDomNode root, QStringList& errors ) { if ( root.toElement().hasAttribute( XML::Limit_Attribute ) ) { limit = root.toElement().attribute( XML::Limit_Attribute ); - int pos = limit.find('/'); - QString limi = limit.left( pos ); - QString limit_interval = limit.right( limit.length() - pos -1 ); + int pos = limit.tqfind('/'); + TQString limi = limit.left( pos ); + TQString limit_interval = limit.right( limit.length() - pos -1 ); bool ok; int lim = limi.toInt( &ok ); diff --git a/kmyfirewall/core/kmfprotocolusage.h b/kmyfirewall/core/kmfprotocolusage.h index 35cb6e7..c85241d 100644 --- a/kmyfirewall/core/kmfprotocolusage.h +++ b/kmyfirewall/core/kmfprotocolusage.h @@ -15,12 +15,12 @@ #include "netfilterobject.h" // QT includes -#include <qstringlist.h> -#include <qstring.h> -#include <qguardedptr.h> -#include <qptrlist.h> -#include <qmap.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqguardedptr.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqobject.h> // KDE includes #include <kdemacros.h> #include <kurl.h> @@ -36,6 +36,7 @@ namespace KMF { class KMFProtocolUsage : public NetfilterObject { friend class KMFProtocol; Q_OBJECT + TQ_OBJECT public: ~KMFProtocolUsage(); @@ -48,19 +49,19 @@ public: virtual int type(); virtual void clear(); - virtual const QString& name(); - virtual const QString& description(); + virtual const TQString& name(); + virtual const TQString& description(); bool validUsage(); - void setLimitInterval( const QString& ); + void setLimitInterval( const TQString& ); void setLimit( int ); int limit() const { return m_limit; }; - const QString& limitInterval() const { + const TQString& limitInterval() const { return m_limit_interval; }; @@ -75,17 +76,17 @@ public: return m_io; }; - const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); public slots: - void slotOnProtocolDeleted( QObject* protocol ); + void slotOnProtocolDeleted( TQObject* protocol ); private: - KMFProtocolUsage( NetfilterObject* parent, const char* name ); - QGuardedPtr<KMFProtocol> m_protocol; - QString m_limit_interval; + KMFProtocolUsage( NetfilterObject* tqparent, const char* name ); + TQGuardedPtr<KMFProtocol> m_protocol; + TQString m_limit_interval; int m_limit; int m_protocolType, m_io; bool m_log; diff --git a/kmyfirewall/core/kmfruleeditinterface.h b/kmyfirewall/core/kmfruleeditinterface.h index 5dd2e18..0b4e092 100644 --- a/kmyfirewall/core/kmfruleeditinterface.h +++ b/kmyfirewall/core/kmfruleeditinterface.h @@ -12,13 +12,13 @@ #ifndef KMFRULEEDITINTERFACE_H #define KMFRULEEDITINTERFACE_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <kdemacros.h> /** @author Christian Hubinger */ -class QString; +class TQString; namespace KMF { @@ -27,8 +27,8 @@ class KDE_EXPORT KMFRuleEditInterface{ public: KMFRuleEditInterface(); virtual ~KMFRuleEditInterface(); - virtual void addRuleOption(QString*, QPtrList< QString >* ) = 0; - virtual void addRuleTargetOption(QString*, QPtrList< QString >* ) = 0; + virtual void addRuleOption(TQString*, TQPtrList< TQString >* ) = 0; + virtual void addRuleTargetOption(TQString*, TQPtrList< TQString >* ) = 0; virtual void showOverview() = 0; }; } diff --git a/kmyfirewall/core/kmfruleoptioneditinterface.cpp b/kmyfirewall/core/kmfruleoptioneditinterface.cpp index 3f8c798..e07262d 100644 --- a/kmyfirewall/core/kmfruleoptioneditinterface.cpp +++ b/kmyfirewall/core/kmfruleoptioneditinterface.cpp @@ -18,7 +18,7 @@ namespace KMF { -KMFRuleOptionEditInterface::KMFRuleOptionEditInterface(QObject *parent, const char* name ) : KMFPlugin( parent, name ) { +KMFRuleOptionEditInterface::KMFRuleOptionEditInterface(TQObject *tqparent, const char* name ) : KMFPlugin( tqparent, name ) { kdDebug() << "KMFRuleOptionEditInterface::KMFRuleOptionEditInterface()" << endl; } diff --git a/kmyfirewall/core/kmfruleoptioneditinterface.h b/kmyfirewall/core/kmfruleoptioneditinterface.h index f6c7f24..08ba33c 100644 --- a/kmyfirewall/core/kmfruleoptioneditinterface.h +++ b/kmyfirewall/core/kmfruleoptioneditinterface.h @@ -1,9 +1,9 @@ #ifndef __KMFRULOPTIONEEDITINTERFACE_H #define __KMFRULOPTIONEEDITINTERFACE_H -#include <qobject.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqptrlist.h> #include "kmfplugin.h" @@ -13,12 +13,12 @@ class IPTRule; class KDE_EXPORT KMFRuleOptionEditInterface : public KMFPlugin { public: - KMFRuleOptionEditInterface(QObject *parent = 0, const char* name = 0); + KMFRuleOptionEditInterface(TQObject *tqparent = 0, const char* name = 0); virtual ~KMFRuleOptionEditInterface(); virtual void loadRule( IPTRule* ) = 0; - virtual QWidget* editWidget() = 0; - virtual const QString& optionEditName() const = 0; - virtual const QString& description() const = 0; + virtual TQWidget* editWidget() = 0; + virtual const TQString& optionEditName() const = 0; + virtual const TQString& description() const = 0; }; } diff --git a/kmyfirewall/core/kmfrulesetdoc.cpp b/kmyfirewall/core/kmfrulesetdoc.cpp index 3006d88..e0cec49 100644 --- a/kmyfirewall/core/kmfrulesetdoc.cpp +++ b/kmyfirewall/core/kmfrulesetdoc.cpp @@ -13,8 +13,8 @@ // QT includes -#include <qfile.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqdom.h> // KDE includes @@ -63,40 +63,40 @@ KMFNetwork* KMFRulesetDoc::network(){ return n; } -KMFError* KMFRulesetDoc::createFirewallScript( const QString& fi ) { +KMFError* KMFRulesetDoc::createFirewallScript( const TQString& fi ) { KMFError* m_err = new KMFError(); - QString file; + TQString file; file = fi; if ( file.isEmpty() ) { kdDebug() << "Cant open output file" << endl; m_err->setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file for writing failed.\n" + const TQString& msg = i18n( "Opening file for writing failed.\n" "Please make sure that you are logged in as root." ); m_err->setErrMsg( msg ); return m_err; } - QFile f( file ); + TQFile f( file ); f.remove(); bool gotit = f.open( IO_ReadWrite ); if ( ! gotit ) { m_err->setErrType( KMFError::NORMAL ); - const QString& msg = i18n( "Opening file for writing failed.\n" + const TQString& msg = i18n( "Opening file for writing failed.\n" "Please make sure that you are logged in as root." ); m_err->setErrMsg( msg ); return m_err; } - QTextStream ts( &f ); - QString s; + TQTextStream ts( &f ); + TQString s; kdDebug() << "########### start compiling ###########" << endl; ts << compile() << endl; kdDebug() << "########### Finished compiling ###########" << endl; f.flush(); f.close(); m_err->setErrType( KMFError::OK ); - const QString& msg = ""; + const TQString& msg = ""; m_err->setErrMsg( msg ); return m_err; } diff --git a/kmyfirewall/core/kmfrulesetdoc.h b/kmyfirewall/core/kmfrulesetdoc.h index 66296de..9f0febc 100644 --- a/kmyfirewall/core/kmfrulesetdoc.h +++ b/kmyfirewall/core/kmfrulesetdoc.h @@ -17,7 +17,7 @@ */ //QT Includes -#include <qguardedptr.h> +#include <tqguardedptr.h> // KDE includes #include <kdemacros.h> @@ -36,14 +36,14 @@ public: KMFNetwork* network(); void setTarget( KMFTarget* ); - /** return a QString containing the documents script to + /** return a TQString containing the documents script to setup the firewall configuration */ - virtual const QString& compile() = 0; + virtual const TQString& compile() = 0; /** Writes the shellscrip that contains the iptables commands to settup the firewall to file. - If file = QString::null a SaveAs dialog will popup. */ - KMFError* createFirewallScript( const QString& fi ); + If file = TQString() a SaveAs dialog will popup. */ + KMFError* createFirewallScript( const TQString& fi ); protected: @@ -54,7 +54,7 @@ private: private: // DATA - QGuardedPtr<KMFTarget> m_target; + TQGuardedPtr<KMFTarget> m_target; }; } diff --git a/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp b/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp index 2ea2bc9..667a8f2 100644 --- a/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp +++ b/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp @@ -13,18 +13,18 @@ namespace KMF { -KMFRuleTargetOptionEditInterface::KMFRuleTargetOptionEditInterface(QObject *parent, const char *name) - : KMFRuleOptionEditInterface(parent, name) { +KMFRuleTargetOptionEditInterface::KMFRuleTargetOptionEditInterface(TQObject *tqparent, const char *name) + : KMFRuleOptionEditInterface(tqparent, name) { // m_managedTargets << "DNAT" << "SNAT"; } KMFRuleTargetOptionEditInterface::~KMFRuleTargetOptionEditInterface() {} -bool KMFRuleTargetOptionEditInterface::manageTarget( const QString& target ) const { +bool KMFRuleTargetOptionEditInterface::manageTarget( const TQString& target ) const { bool found = false; for ( uint i = 0; i < m_managedTargets.count(); i++ ) { - QString currTarget = *m_managedTargets.at( i ); + TQString currTarget = *m_managedTargets.at( i ); if ( currTarget == target ) found = true; } diff --git a/kmyfirewall/core/kmfruletargetoptioneditinterface.h b/kmyfirewall/core/kmfruletargetoptioneditinterface.h index 4e7faaa..d05cfc4 100644 --- a/kmyfirewall/core/kmfruletargetoptioneditinterface.h +++ b/kmyfirewall/core/kmfruletargetoptioneditinterface.h @@ -14,8 +14,8 @@ #include "kmfruleoptioneditinterface.h" -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kdemacros.h> @@ -25,15 +25,15 @@ namespace KMF { class KDE_EXPORT KMFRuleTargetOptionEditInterface : public KMFRuleOptionEditInterface { public: - KMFRuleTargetOptionEditInterface(QObject *parent = 0, const char *name = 0); + KMFRuleTargetOptionEditInterface(TQObject *tqparent = 0, const char *name = 0); virtual ~KMFRuleTargetOptionEditInterface(); - virtual bool manageTarget( const QString& ) const; - virtual bool setTarget( const QString& ) = 0; + virtual bool manageTarget( const TQString& ) const; + virtual bool setTarget( const TQString& ) = 0; protected: - QStringList m_managedTargets; + TQStringList m_managedTargets; }; diff --git a/kmyfirewall/core/kmftarget.cpp b/kmyfirewall/core/kmftarget.cpp index b49fc12..4e363f6 100644 --- a/kmyfirewall/core/kmftarget.cpp +++ b/kmyfirewall/core/kmftarget.cpp @@ -14,7 +14,7 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 // QT includes -#include <qwidget.h> +#include <tqwidget.h> // KDE includes #include <kapplication.h> @@ -44,8 +44,8 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 namespace KMF { -KMFTarget::KMFTarget( NetfilterObject *parent, const char* name, const QString&, KMFNetwork* net ) : NetfilterObject( parent, name ) { - kdDebug() << "KMFTarget::KMFTarget( NetfilterObject *parent, const QString& name )" << endl; +KMFTarget::KMFTarget( NetfilterObject *tqparent, const char* name, const TQString&, KMFNetwork* net ) : NetfilterObject( tqparent, name ) { + kdDebug() << "KMFTarget::KMFTarget( NetfilterObject *tqparent, const TQString& name )" << endl; m_network = net; m_address = new IPAddress( 0,0,0,0 ); m_ssh_port = 22; @@ -93,8 +93,8 @@ KMFNetwork* KMFTarget::network() { return m_network; } -QString KMFTarget::toString() { - QString ret = QString( +TQString KMFTarget::toString() { + TQString ret = TQString( "Host: " + address()->toString() + " name: " + NetfilterObject::name() + " GUIName: " + guiName() ); @@ -109,8 +109,8 @@ bool KMFTarget::isLocalExecuteTarget() { return ( NetfilterObject::name() == Constants::Localhost_Name && ! KMFConfig::useSSHForLocalhost() ); } -QString KMFTarget::toFriendlyString() { - QString ret = QString( guiName() + " [" + address()->toString() +"]" ); +TQString KMFTarget::toFriendlyString() { + TQString ret = TQString( guiName() + " [" + address()->toString() +"]" ); return ret; } @@ -145,14 +145,14 @@ void KMFTarget::setReadOnly( bool onOff ) { } -void KMFTarget::setGuiName( const QString& name){ +void KMFTarget::setGuiName( const TQString& name){ if ( !name.isNull() && !name.isEmpty() && m_guiName != name ) { m_guiName = name; changed(); } } -void KMFTarget::setAddress( const QString& addr ) { +void KMFTarget::setAddress( const TQString& addr ) { m_address->setAddress( addr ); changed(); } @@ -177,8 +177,8 @@ bool KMFTarget::isCurrentTarget() { return ( zone()->network()->currentTarget()->uuid() == this->uuid() ); } -const QString& KMFTarget::name() { - // kdDebug() << "QString& KMFTarget::name()" << endl; +const TQString& KMFTarget::name() { + // kdDebug() << "TQString& KMFTarget::name()" << endl; if ( ! zone() || readOnly() ) { return NetfilterObject::name(); } @@ -186,7 +186,7 @@ const QString& KMFTarget::name() { int index = 0; bool found = false; KMFNetZone *z = zone(); - QPtrListIterator<KMFTarget> it( z->hosts() ); + TQPtrListIterator<KMFTarget> it( z->hosts() ); while ( it.current() && ! found ) { if ( it.current() == this ) { found = true; @@ -194,13 +194,13 @@ const QString& KMFTarget::name() { index++; ++it; } - const QString& s = zone()->name() + "_target_"+ QString::number( index ); - return *( new QString(s) ); + const TQString& s = zone()->name() + "_target_"+ TQString::number( index ); + return *( new TQString(s) ); } -const QString& KMFTarget::getFishUrl() { - QString addr = isLocalhost() ? "localhost" : m_address->toString(); - return *( new QString("fish://root@" + addr + ":" + QString::number( m_ssh_port ) ) ); +const TQString& KMFTarget::getFishUrl() { + TQString addr = isLocalhost() ? "localhost" : m_address->toString(); + return *( new TQString("fish://root@" + addr + ":" + TQString::number( m_ssh_port ) ) ); } KMFError* KMFTarget::tryAutoConfiguration() { @@ -218,22 +218,22 @@ KMFError* KMFTarget::tryAutoConfiguration() { err->setErrMsg( KProcessWrapper::instance()->stdErr() ); return err; } - QString retValUname = KProcessWrapper::instance()->stdCombined(); + TQString retValUname = KProcessWrapper::instance()->stdCombined(); kdDebug() << "Found OS: " << retValUname << endl; config()->setOS( retValUname.lower().remove( "\n" ).remove( " " ) ); - QString path = "kmyfirewall/scripts/installer/"; + TQString path = "kmyfirewall/scripts/installer/"; path.append( config()->oS().lower() ); path.append( "/autoconfighelper.sh" ); kdDebug() << "Search Path: " << path << endl; - QString localFile = KGlobal::dirs() ->findResource( "data", path ); + TQString localFile = KGlobal::dirs() ->findResource( "data", path ); if ( ! KIO::NetAccess::exists( localFile, false, KApplication::kApplication()->mainWidget() ) ) { kdDebug() << "No autoconfigure script found for os: " << config()->oS() << endl; emit sigTargetChanged( this ); err->setErrType( KMFError::NORMAL ); - err->setErrMsg( i18n("No autoconfigure script found for os: %1").arg( config()->oS() ) ); + err->setErrMsg( i18n("No autoconfigure script found for os: %1").tqarg( config()->oS() ) ); return err; } @@ -250,11 +250,11 @@ KMFError* KMFTarget::tryAutoConfiguration() { err->setErrMsg( KProcessWrapper::instance()->stdErr() ); return err; } - QString retVal = KProcessWrapper::instance()->stdCombined(); + TQString retVal = KProcessWrapper::instance()->stdCombined(); kdDebug() << "AutoConf XML: \n"<< retVal << endl; - QDomDocument doc; + TQDomDocument doc; doc.setContent( retVal ); - QStringList errors; + TQStringList errors; config()->setDistribution( "" ); config()->setIPTPath( "" ); @@ -271,34 +271,34 @@ KMFError* KMFTarget::tryAutoConfiguration() { return err; } -// void KMFTarget::slotProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut ) { -// kdDebug() << "KMFTarget::slotProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut )" << endl; +// void KMFTarget::slotProcessFinished( const TQString& jobName, int status, bool exitedNormal, const TQString& stdOut, const TQString& stdErr, const TQString& completeOut ) { +// kdDebug() << "KMFTarget::slotProcessFinished( const TQString& jobName, int status, bool exitedNormal, const TQString& stdOut, const TQString& stdErr, const TQString& completeOut )" << endl; // // disconnect( // KProcessWrapper::instance(), -// SIGNAL( sigProcessFinished( -// const QString&, +// TQT_SIGNAL( sigProcessFinished( +// const TQString&, // int, // bool, -// const QString&, -// const QString& , -// const QString& ) ), +// const TQString&, +// const TQString& , +// const TQString& ) ), // this, -// SLOT( slotProcessFinished( -// const QString&, +// TQT_SLOT( slotProcessFinished( +// const TQString&, // int, // bool, -// const QString&, -// const QString&, -// const QString& ) ) ); +// const TQString&, +// const TQString&, +// const TQString& ) ) ); // // -// const QString& ret = completeOut; +// const TQString& ret = completeOut; // kdDebug() << "Got Output: " << ret << endl; // -// QDomDocument doc; +// TQDomDocument doc; // doc.setContent( ret ); -// QStringList errors; +// TQStringList errors; // // config()->setDistribution( "" ); // config()->setIPTPath( "" ); @@ -312,11 +312,11 @@ KMFError* KMFTarget::tryAutoConfiguration() { // emit sigTargetChanged( this ); // } -const QDomDocument& KMFTarget::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFTarget::getDOMTree() " << endl; - QDomDocument doc; +const TQDomDocument& KMFTarget::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFTarget::getDOMTree() " << endl; + TQDomDocument doc; - QDomElement root = doc.createElement( XML::Target_Element ); + TQDomElement root = doc.createElement( XML::Target_Element ); NetfilterObject::saveUuid( root ); root.setAttribute( XML::Name_Attribute, name() ); root.setAttribute( XML::GUIName_Attribute, m_guiName ); @@ -328,27 +328,27 @@ const QDomDocument& KMFTarget::getDOMTree() { root.appendChild( config()->getDOMTree( ) ); - // QDomElement root = getDOM(); + // TQDomElement root = getDOM(); ensureDoc(); root.appendChild( m_doc->getDOMTree().documentElement() ); doc.appendChild( root ); - return *( new QDomDocument( doc ) ); + return *( new TQDomDocument( doc ) ); } -void KMFTarget::loadXML( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void KMFTarget::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFTarget::loadXML( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void KMFTarget::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML( root, errors ); } -void KMFTarget::loadXML( QDomNode root, QStringList& errors ) { - kdDebug() << "void KMFTarget::loadXML( const QDomDocument& )" << endl; +void KMFTarget::loadXML( TQDomNode root, TQStringList& errors ) { + kdDebug() << "void KMFTarget::loadXML( const TQDomDocument& )" << endl; NetfilterObject::loadUuid ( root, errors ); - QString name = ""; - QString guiName = ""; - QString desc = ""; - QString address = ""; - QString readonly = ""; - QString sshPort = ""; + TQString name = ""; + TQString guiName = ""; + TQString desc = ""; + TQString address = ""; + TQString readonly = ""; + TQString sshPort = ""; name = root.toElement().attribute( XML::Name_Attribute ); @@ -364,7 +364,7 @@ void KMFTarget::loadXML( QDomNode root, QStringList& errors ) { setReadOnly( false ); } - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() && ( curr.nodeName() == XML::TargetConfig_Element ) ) { kdDebug() << "void KMFTarget::loadXML( ) - parse targetconfig " << endl; diff --git a/kmyfirewall/core/kmftarget.h b/kmyfirewall/core/kmftarget.h index 50819c6..35e9ae2 100644 --- a/kmyfirewall/core/kmftarget.h +++ b/kmyfirewall/core/kmftarget.h @@ -16,9 +16,9 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 // QT includes -#include <qptrlist.h> -#include <qstring.h> -#include <qdom.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqdom.h> // KDE includes #include <kdemacros.h> @@ -28,7 +28,7 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 #include "kmfnetzone.h" #include "xmlnames.h" -class QWidget; +class TQWidget; namespace KMF { class IPAddress; @@ -46,17 +46,18 @@ class KMFCompilerInterface; class KDE_EXPORT KMFTarget : public NetfilterObject { Q_OBJECT + TQ_OBJECT public: - KMFTarget( NetfilterObject *parent, const char* name, const QString& targetName, KMFNetwork* net ); + KMFTarget( NetfilterObject *tqparent, const char* name, const TQString& targetName, KMFNetwork* net ); ~KMFTarget(); virtual int type(); virtual void clear(); - virtual const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); KMFNetZone* zone() const { return m_zone; @@ -65,18 +66,18 @@ public: bool isLocalhost(); bool isLocalExecuteTarget(); - const QString& guiName() const { + const TQString& guiName() const { return m_guiName; }; - void setGuiName( const QString& ); + void setGuiName( const TQString& ); - const QString& name(); + const TQString& name(); IPAddress* address() { return m_address; }; - void setAddress( const QString& ); + void setAddress( const TQString& ); int sshPort() const { return m_ssh_port; @@ -97,9 +98,9 @@ public: KMFTargetConfig* config(); - QString toString(); - QString toFriendlyString(); - const QString& getFishUrl(); + TQString toString(); + TQString toFriendlyString(); + const TQString& getFishUrl(); KMFDoc* doc(); @@ -109,10 +110,10 @@ public: KMFCompilerInterface* compiler(); protected: - QGuardedPtr<KMFNetZone> m_zone; + TQGuardedPtr<KMFNetZone> m_zone; IPAddress *m_address; int m_ssh_port; - QString m_guiName; + TQString m_guiName; private: void ensureDoc(); @@ -120,7 +121,7 @@ public: KMFDoc *m_doc; KMFNetwork *m_network; bool m_readOnly; - QString m_allOut; + TQString m_allOut; signals: void sigTargetChanged( KMFTarget* ); }; diff --git a/kmyfirewall/core/kmftargetconfig.cpp b/kmyfirewall/core/kmftargetconfig.cpp index 990028d..c72e0c0 100644 --- a/kmyfirewall/core/kmftargetconfig.cpp +++ b/kmyfirewall/core/kmftargetconfig.cpp @@ -12,8 +12,8 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 #include "kmftargetconfig.h" // QT includes -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> // KDE includes #include <kdebug.h> @@ -59,7 +59,7 @@ bool KMFTargetConfig::isValid() const { } } -void KMFTargetConfig::setBackend ( const QString & v ) { +void KMFTargetConfig::setBackend ( const TQString & v ) { if ( m_Backend == v ) { return; } @@ -67,7 +67,7 @@ void KMFTargetConfig::setBackend ( const QString & v ) { changed(); } -void KMFTargetConfig::setInterfaces ( const QStringList & v ) { +void KMFTargetConfig::setInterfaces ( const TQStringList & v ) { if ( m_Interfaces == v ) { return; } @@ -75,7 +75,7 @@ void KMFTargetConfig::setInterfaces ( const QStringList & v ) { changed(); } -void KMFTargetConfig::setModprobePath ( const QString & v ) { +void KMFTargetConfig::setModprobePath ( const TQString & v ) { if ( m_ModprobePath == v ) { return; } @@ -83,7 +83,7 @@ void KMFTargetConfig::setModprobePath ( const QString & v ) { changed(); } -void KMFTargetConfig::setIPTPath ( const QString & v ) { +void KMFTargetConfig::setIPTPath ( const TQString & v ) { if ( m_IPTPath == v ) { return; } @@ -91,7 +91,7 @@ void KMFTargetConfig::setIPTPath ( const QString & v ) { changed(); } -void KMFTargetConfig::setRcDefaultPath ( const QString & v ) { +void KMFTargetConfig::setRcDefaultPath ( const TQString & v ) { if ( m_RcDefaultPath == v ) { return; } @@ -99,7 +99,7 @@ void KMFTargetConfig::setRcDefaultPath ( const QString & v ) { changed(); } -void KMFTargetConfig::setInitPath ( const QString & v ) { +void KMFTargetConfig::setInitPath ( const TQString & v ) { if ( m_InitPath == v ) { return; } @@ -107,7 +107,7 @@ void KMFTargetConfig::setInitPath ( const QString & v ) { changed(); } -void KMFTargetConfig::setDistribution ( const QString & v ) { +void KMFTargetConfig::setDistribution ( const TQString & v ) { if ( m_Distribution == v ) { return; } @@ -115,7 +115,7 @@ void KMFTargetConfig::setDistribution ( const QString & v ) { changed(); } -void KMFTargetConfig::setOS ( const QString & v ) { +void KMFTargetConfig::setOS ( const TQString & v ) { if ( m_OS == v ) { return; } @@ -123,75 +123,75 @@ void KMFTargetConfig::setOS ( const QString & v ) { changed(); } -const QDomDocument& KMFTargetConfig::getDOMTree() { - // kdDebug() << "const QDomDocument& KMFTargetConfig::getDOMTree() " << endl; - QDomDocument doc; - QDomElement root = doc.createElement ( XML::TargetConfig_Element ); +const TQDomDocument& KMFTargetConfig::getDOMTree() { + // kdDebug() << "const TQDomDocument& KMFTargetConfig::getDOMTree() " << endl; + TQDomDocument doc; + TQDomElement root = doc.createElement ( XML::TargetConfig_Element ); NetfilterObject::saveUuid( root ); root.setAttribute ( XML::Name_Attribute, name() ); root.setAttribute ( XML::Description_Attribute, description() ); - QStringList ints = interfaces(); - for ( QStringList::Iterator it = ints.begin(); it != ints.end(); ++it ) { - QDomElement interface = doc.createElement ( XML::Interface_Element ); + TQStringList ints = interfaces(); + for ( TQStringList::Iterator it = ints.begin(); it != ints.end(); ++it ) { + TQDomElement interface = doc.createElement ( XML::Interface_Element ); interface.setAttribute ( XML::Name_Attribute, *it ); root.appendChild ( interface ); } - QDomElement os = doc.createElement ( XML::OS_Element ); + TQDomElement os = doc.createElement ( XML::OS_Element ); os.setAttribute ( XML::Name_Attribute, oS().lower() ); root.appendChild ( os ); - QDomElement el_backend = doc.createElement ( XML::BackEnd_Element ); + TQDomElement el_backend = doc.createElement ( XML::BackEnd_Element ); el_backend.setAttribute ( XML::Name_Attribute, backend().lower() ); root.appendChild ( el_backend ); - QDomElement el_distribution = doc.createElement ( XML::Distribution_Element ); + TQDomElement el_distribution = doc.createElement ( XML::Distribution_Element ); el_distribution.setAttribute ( XML::Name_Attribute, distribution() ); root.appendChild ( el_distribution ); - QDomElement el_initPath = doc.createElement ( XML::InitPath_Element ); + TQDomElement el_initPath = doc.createElement ( XML::InitPath_Element ); el_initPath.setAttribute ( XML::Name_Attribute, initPath() ); root.appendChild ( el_initPath ); - QDomElement el_IPTPath = doc.createElement ( XML::IPTPath_Element ); + TQDomElement el_IPTPath = doc.createElement ( XML::IPTPath_Element ); el_IPTPath.setAttribute ( XML::Name_Attribute, IPTPath() ); root.appendChild ( el_IPTPath ); - QDomElement el_modprobePath = doc.createElement ( XML::ModprobePath_Element ); + TQDomElement el_modprobePath = doc.createElement ( XML::ModprobePath_Element ); el_modprobePath.setAttribute ( XML::Name_Attribute, modprobePath() ); root.appendChild ( el_modprobePath ); - QDomElement el_rcDefaultPath = doc.createElement ( XML::RcDefaultPath_Element ); + TQDomElement el_rcDefaultPath = doc.createElement ( XML::RcDefaultPath_Element ); el_rcDefaultPath.setAttribute ( XML::Name_Attribute, rcDefaultPath() ); root.appendChild ( el_rcDefaultPath ); doc.appendChild ( root ); - return * ( new QDomDocument ( doc ) ); + return * ( new TQDomDocument ( doc ) ); } -void KMFTargetConfig::loadXML ( const QDomDocument& doc, QStringList& errors ) { - kdDebug() << "void KMFTargetConfig::loadXML( const QDomDocument& )" << endl; - QDomElement root = doc.documentElement(); +void KMFTargetConfig::loadXML ( const TQDomDocument& doc, TQStringList& errors ) { + kdDebug() << "void KMFTargetConfig::loadXML( const TQDomDocument& )" << endl; + TQDomElement root = doc.documentElement(); loadXML ( root, errors ); } -void KMFTargetConfig::loadXML ( QDomNode root, QStringList& errors ) { - kdDebug() << "void KMFTargetConfig::loadXML( QDomNode root )" << endl; +void KMFTargetConfig::loadXML ( TQDomNode root, TQStringList& errors ) { + kdDebug() << "void KMFTargetConfig::loadXML( TQDomNode root )" << endl; NetfilterObject::loadUuid ( root, errors ); - QDomDocument protocol_doc; + TQDomDocument protocol_doc; protocol_doc.appendChild ( root.cloneNode ( true ) ); kdDebug() << "XML: " << protocol_doc.toString() << endl; - QString name = ""; - QString desc = ""; + TQString name = ""; + TQString desc = ""; setDescription ( root.toElement().attribute ( XML::Description_Attribute ) ); setName ( root.toElement().attribute ( XML::Name_Attribute ) ); m_Interfaces.clear(); - QDomNode curr = root.firstChild(); + TQDomNode curr = root.firstChild(); while ( !curr.isNull() ) { if ( curr.isElement() ) { kdDebug() << "Parsing Node: " << curr.nodeName() << endl; @@ -222,8 +222,8 @@ void KMFTargetConfig::loadXML ( QDomNode root, QStringList& errors ) { changed(); } -QString KMFTargetConfig::toString() { - QString s = QString ( +TQString KMFTargetConfig::toString() { + TQString s = TQString ( "Interfaces: " + m_Interfaces.join ( "," ) + "\n" + "OS: " + oS() + "\n" + "backend: " + backend() + "\n" + diff --git a/kmyfirewall/core/kmftargetconfig.h b/kmyfirewall/core/kmftargetconfig.h index fb2ec8e..b3db3ab 100644 --- a/kmyfirewall/core/kmftargetconfig.h +++ b/kmyfirewall/core/kmftargetconfig.h @@ -14,13 +14,13 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 // QT includes -#include <qptrlist.h> -#include <qstring.h> -#include <qdom.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqdom.h> +#include <tqobject.h> -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <kdemacros.h> @@ -45,9 +45,9 @@ class KDE_EXPORT KMFTargetConfig : public NetfilterObject { virtual int type(); virtual void clear(); - virtual const QDomDocument& getDOMTree(); - virtual void loadXML(const QDomDocument&, QStringList& errors ); - virtual void loadXML( QDomNode, QStringList& errors ); + virtual const TQDomDocument& getDOMTree(); + virtual void loadXML(const TQDomDocument&, TQStringList& errors ); + virtual void loadXML( TQDomNode, TQStringList& errors ); /** Get the target object for this configuration @@ -59,24 +59,24 @@ class KDE_EXPORT KMFTargetConfig : public NetfilterObject { /** Set Which OS are we using. */ - void setOS( const QString & v ); + void setOS( const TQString & v ); /** Get Which OS are we using. */ - const QString& oS() const { + const TQString& oS() const { return m_OS; } /** Set Firewalling backend name. */ - void setBackend( const QString & ); + void setBackend( const TQString & ); /** Get Firewalling backend name. */ - const QString& backend() const { + const TQString& backend() const { return m_Backend; } @@ -84,60 +84,60 @@ class KDE_EXPORT KMFTargetConfig : public NetfilterObject { /** Set What kind of ditribution are we using. */ - void setDistribution( const QString & v ); + void setDistribution( const TQString & v ); /** Get What kind of ditribution are we using. */ - const QString& distribution() const { + const TQString& distribution() const { return m_Distribution; } /** Set Path to the init scripts */ - void setInitPath( const QString & v ); + void setInitPath( const TQString & v ); /** Get Path to the init scripts */ - const QString& initPath() const { + const TQString& initPath() const { return m_InitPath; } /** Set Path to the default runlevel directory. */ - void setRcDefaultPath( const QString & v ); + void setRcDefaultPath( const TQString & v ); /** Get Path to the default runlevel directory. */ - const QString& rcDefaultPath() const { + const TQString& rcDefaultPath() const { return m_RcDefaultPath; } /** Set Path to iptables binary. */ - void setIPTPath( const QString & v ); + void setIPTPath( const TQString & v ); /** Get Path to iptables binary. */ - const QString& IPTPath() const { + const TQString& IPTPath() const { return m_IPTPath; } /** Set Path to the modprobe binary. */ - void setModprobePath( const QString & v ); + void setModprobePath( const TQString & v ); /** Get Path to the modprobe binary. */ - const QString& modprobePath() const { + const TQString& modprobePath() const { return m_ModprobePath; } @@ -146,12 +146,12 @@ class KDE_EXPORT KMFTargetConfig : public NetfilterObject { /** Set Network interfaces */ - void setInterfaces( const QStringList & v ); + void setInterfaces( const TQStringList & v ); /** Get Network interfaces */ - QStringList& interfaces() { + TQStringList& interfaces() { return m_Interfaces; } @@ -160,29 +160,29 @@ class KDE_EXPORT KMFTargetConfig : public NetfilterObject { */ bool isValid() const; - QString toString(); + TQString toString(); private: KMFTarget* m_target; - QString m_targetName; + TQString m_targetName; KURL m_configFile; // GENERAL - QString m_OS; - QString m_Backend; + TQString m_OS; + TQString m_Backend; // PATHS - QString m_Distribution; - QString m_InitPath; - QString m_RcDefaultPath; - QString m_IPTPath; - QString m_ModprobePath; - QString m_CurrentGenericConfiguration; - QString m_CurrentIPTConfiguration; + TQString m_Distribution; + TQString m_InitPath; + TQString m_RcDefaultPath; + TQString m_IPTPath; + TQString m_ModprobePath; + TQString m_CurrentGenericConfiguration; + TQString m_CurrentIPTConfiguration; // INTERFACES - QStringList m_Interfaces; + TQStringList m_Interfaces; }; } #endif diff --git a/kmyfirewall/core/kmftransaction.cpp b/kmyfirewall/core/kmftransaction.cpp index 1ac2900..f4005f5 100644 --- a/kmyfirewall/core/kmftransaction.cpp +++ b/kmyfirewall/core/kmftransaction.cpp @@ -21,9 +21,9 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 namespace KMF { -KMFTransaction::KMFTransaction( const QString& transactionName, NetfilterObject* highestAffectedObject ) { +KMFTransaction::KMFTransaction( const TQString& transactionName, NetfilterObject* highestAffectedObject ) { m_transactionName = transactionName; - m_uuID = QUuid::createUuid(); + m_uuID = TQUuid::createUuid(); m_objectUuid = highestAffectedObject->uuid(); m_undoXML = highestAffectedObject->getXMLSniplet(); kdDebug() << "Created " << toString() << endl; @@ -42,15 +42,15 @@ void KMFTransaction::commit() { NetfilterObject* KMFTransaction::undo() { NetfilterObject* obj = NetfilterObject::findObject( m_objectUuid ); if ( ! obj ) { - KMFUndoEngine::instance()->log( i18n("KMFTransaction::undo() No object found with uuid: %1").arg( m_objectUuid ), KMFError::WARNING, 0 ); + KMFUndoEngine::instance()->log( i18n("KMFTransaction::undo() No object found with uuid: %1").tqarg( m_objectUuid ), KMFError::WARNING, 0 ); return 0; } if( m_undoXML.isNull() ) { return 0; } - QDomDocument doc; + TQDomDocument doc; doc.setContent( m_undoXML ); - QStringList * errors = new QStringList(); + TQStringList * errors = new TQStringList(); obj->loadXML( doc, *errors ); return obj; } @@ -58,24 +58,24 @@ NetfilterObject* KMFTransaction::undo() { NetfilterObject* KMFTransaction::redo() { NetfilterObject* obj = NetfilterObject::findObject( m_objectUuid ); if ( ! obj ) { - KMFUndoEngine::instance()->log( i18n("KMFTransaction::redo() No object found with uuid: %1").arg( m_objectUuid ), KMFError::WARNING, 0 ); + KMFUndoEngine::instance()->log( i18n("KMFTransaction::redo() No object found with uuid: %1").tqarg( m_objectUuid ), KMFError::WARNING, 0 ); return 0; } if ( m_redoXML.isNull() ) { return 0; } - QDomDocument doc; + TQDomDocument doc; doc.setContent( m_redoXML ); - QStringList * errors = new QStringList(); + TQStringList * errors = new TQStringList(); obj->loadXML( doc, *errors ); return obj; } -const QString& KMFTransaction::toString() { - QString s = ""; - s.append( i18n("Transaction: %1 uuid: %2\n" ).arg( name() ).arg( uuid().toString() ) ); - s.append( i18n("-- Changed ObjectUuid: %1").arg( m_objectUuid.toString() ) ); - return *( new QString( s ) ); +const TQString& KMFTransaction::toString() { + TQString s = ""; + s.append( i18n("Transaction: %1 uuid: %2\n" ).tqarg( name() ).tqarg( uuid().toString() ) ); + s.append( i18n("-- Changed ObjectUuid: %1").tqarg( m_objectUuid.toString() ) ); + return *( new TQString( s ) ); } } diff --git a/kmyfirewall/core/kmftransaction.h b/kmyfirewall/core/kmftransaction.h index b88f088..34dbfbc 100644 --- a/kmyfirewall/core/kmftransaction.h +++ b/kmyfirewall/core/kmftransaction.h @@ -12,13 +12,13 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 #ifndef KMFTRANSACTION_H #define KMFTRANSACTION_H -#include "qdict.h" -#include "qvaluelist.h" -#include "qptrlist.h" -#include "qstring.h" -#include "qobject.h" -#include "quuid.h" -#include "qguardedptr.h" +#include "tqdict.h" +#include "tqvaluelist.h" +#include "tqptrlist.h" +#include "tqstring.h" +#include "tqobject.h" +#include "tquuid.h" +#include "tqguardedptr.h" namespace KMF { @@ -30,26 +30,26 @@ class NetfilterObject; class KMFTransaction{ friend class KMFUndoEngine; public: - KMFTransaction( const QString& transactionName, NetfilterObject* ); + KMFTransaction( const TQString& transactionName, NetfilterObject* ); ~KMFTransaction(); - const QString& name() const { + const TQString& name() const { return m_transactionName; }; - const QUuid& objectUuid() const { + const TQUuid& objectUuid() const { return m_objectUuid; }; - const QUuid& uuid() const { + const TQUuid& uuid() const { return m_uuID; }; - const QString& toString(); + const TQString& toString(); - const QString& undoXML() const { + const TQString& undoXML() const { return m_undoXML; }; - const QString& redoXML() const { + const TQString& redoXML() const { return m_redoXML; }; @@ -60,13 +60,13 @@ class KMFTransaction{ NetfilterObject* redo(); private: - QString m_transactionName; + TQString m_transactionName; // int m_objectID; - QUuid m_objectUuid; + TQUuid m_objectUuid; - QUuid m_uuID; - QString m_undoXML; - QString m_redoXML; + TQUuid m_uuID; + TQString m_undoXML; + TQString m_redoXML; }; } #endif diff --git a/kmyfirewall/core/kmfundoengine.cpp b/kmyfirewall/core/kmfundoengine.cpp index 696e5f6..bf7511f 100644 --- a/kmyfirewall/core/kmfundoengine.cpp +++ b/kmyfirewall/core/kmfundoengine.cpp @@ -37,7 +37,7 @@ KMFUndoEngine* KMFUndoEngine::instance() { } //##### end static stuff -KMFUndoEngine::KMFUndoEngine( QObject* parent, const char* name ) : QObject( parent, name ) { +KMFUndoEngine::KMFUndoEngine( TQObject* tqparent, const char* name ) : TQObject( tqparent, name ) { MAX_UNDO = 10; m_in_transaction = false; is_saved = true; @@ -63,16 +63,16 @@ void KMFUndoEngine::setKMFInterface( KMyFirewallInterface *app ) { m_app = app; } -QValueList< KMFTransaction* >& KMFUndoEngine::undoTransactions() { +TQValueList< KMFTransaction* >& KMFUndoEngine::undoTransactions() { return m_undo_transactionObjects; } -QValueList< KMFTransaction* >& KMFUndoEngine::redoTransactions() { +TQValueList< KMFTransaction* >& KMFUndoEngine::redoTransactions() { return m_redo_transactionObjects; } -KMFTransaction * KMFUndoEngine::findTransction( const QUuid& uuid ) { - QValueList< KMFTransaction* >::iterator it; +KMFTransaction * KMFUndoEngine::findTransction( const TQUuid& uuid ) { + TQValueList< KMFTransaction* >::iterator it; for ( it = m_undo_transactionObjects.begin(); it != m_undo_transactionObjects.end(); ++it ) { if ( (*it)->uuid() == uuid ) { return *it; @@ -97,20 +97,20 @@ bool KMFUndoEngine::isSaved() { return is_saved; } -void KMFUndoEngine::log( const QString& msg, int kmfErrorType = KMFError::NORMAL, NetfilterObject* obj = 0 ) { - QString m = msg; - QString s = ""; +void KMFUndoEngine::log( const TQString& msg, int kmfErrorType = KMFError::NORMAL, NetfilterObject* obj = 0 ) { + TQString m = msg; + TQString s = ""; if ( obj ) { - m.prepend( i18n("<i>%1:</i> ").arg( obj->name() ) ); + m.prepend( i18n("<i>%1:</i> ").tqarg( obj->name() ) ); } s.append( KMFError::getAsString( kmfErrorType, m ) ); - emit sigLog( *( new QString(s) ) ); + emit sigLog( *( new TQString(s) ) ); } -void KMFUndoEngine::changed ( const QUuid& id ) { +void KMFUndoEngine::changed ( const TQUuid& id ) { NetfilterObject* obj = NetfilterObject::findObject ( id ); if ( ! obj ) { - log( i18n("Change non exiting object id: %1.").arg( id ), KMFError::FATAL ); + log( i18n("Change non exiting object id: %1.").tqarg( id ), KMFError::FATAL ); return; } is_saved = false; @@ -118,13 +118,13 @@ void KMFUndoEngine::changed ( const QUuid& id ) { m_app->updateCaption(); } if ( ! m_in_transaction ) { - // log( i18n("Change object: %1 without transaction.").arg( obj->name() ), KMFError::WARNING ); + // log( i18n("Change object: %1 without transaction.").tqarg( obj->name() ), KMFError::WARNING ); return; } NetfilterObject *highestAffected = NetfilterObject::findObject( m_currentTransaction->objectUuid() ); if ( ! highestAffected || obj != highestAffected && ! obj->isChildOf( highestAffected->uuid() ) ) { - log( i18n("Change object: %1 outside of declared highestAffectedObject: %2 in transaction: %3.").arg( obj->name() ).arg( highestAffected->name() ).arg( m_currentTransaction->name() ), KMFError::WARNING ); + log( i18n("Change object: %1 outside of declared highestAffectedObject: %2 in transaction: %3.").tqarg( obj->name() ).tqarg( highestAffected->name() ).tqarg( m_currentTransaction->name() ), KMFError::WARNING ); } } @@ -138,8 +138,8 @@ void KMFUndoEngine::clearStacks() { emit sigStackChanged(); } -void KMFUndoEngine::startTransaction ( NetfilterObject* highestAffectedObject, const QString& name ) { - kdDebug() << "void KMFUndoEngine::startTransaction( const QString& " << name << " )" << endl; +void KMFUndoEngine::startTransaction ( NetfilterObject* highestAffectedObject, const TQString& name ) { + kdDebug() << "void KMFUndoEngine::startTransaction( const TQString& " << name << " )" << endl; m_in_transaction = true; m_currentTransaction = new KMFTransaction( name, highestAffectedObject ); } @@ -182,8 +182,8 @@ void KMFUndoEngine::endTransaction() { } -QValueList< NetfilterObject* >& KMFUndoEngine::undo() { - QValueList< NetfilterObject* > *affected = new QValueList< NetfilterObject* >; +TQValueList< NetfilterObject* >& KMFUndoEngine::undo() { + TQValueList< NetfilterObject* > *affected = new TQValueList< NetfilterObject* >; kdDebug() << "void KMFUndoEngine::undo()" << endl; if ( m_undo_transactionObjects.empty() ) { @@ -216,9 +216,9 @@ QValueList< NetfilterObject* >& KMFUndoEngine::undo() { -QValueList< NetfilterObject* >& KMFUndoEngine::redo() { +TQValueList< NetfilterObject* >& KMFUndoEngine::redo() { kdDebug() << "void KMFIPTDoc::redo()" << endl; - QValueList< NetfilterObject* > *affected = new QValueList< NetfilterObject* >; + TQValueList< NetfilterObject* > *affected = new TQValueList< NetfilterObject* >; if ( m_redo_transactionObjects.empty() ) { kdDebug() << "No undo transactions available" << endl; m_app->enableRedo ( false ); diff --git a/kmyfirewall/core/kmfundoengine.h b/kmyfirewall/core/kmfundoengine.h index 2872ebb..29f6351 100644 --- a/kmyfirewall/core/kmfundoengine.h +++ b/kmyfirewall/core/kmfundoengine.h @@ -14,11 +14,11 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 // qt includes -#include "qdict.h" -#include "qvaluelist.h" -#include "qptrlist.h" -#include "qstring.h" -#include "qobject.h" +#include "tqdict.h" +#include "tqvaluelist.h" +#include "tqptrlist.h" +#include "tqstring.h" +#include "tqobject.h" // project includes #include "kmftransaction.h" @@ -34,8 +34,9 @@ class KMFNetwork; @author Christian Hubinger <chubinger@irrsinnig.org> */ -class KMFUndoEngine : public QObject { +class KMFUndoEngine : public TQObject { Q_OBJECT + TQ_OBJECT friend class KMFTransaction; friend class KMFNetwork; @@ -65,19 +66,19 @@ public: /** Start a transaction e.g. collection of changes that will be tracked to allow undo/redo */ - void startTransaction( NetfilterObject* /* highestAffectedObject */, const QString& name ); + void startTransaction( NetfilterObject* /* highestAffectedObject */, const TQString& name ); /** Abort a started transaction */ void abortTransaction(); /** Hold list of available undo transaction objects */ - QValueList< KMFTransaction* >& undoTransactions(); + TQValueList< KMFTransaction* >& undoTransactions(); /** Hold list of available redo transaction objects */ - QValueList< KMFTransaction* >& redoTransactions(); + TQValueList< KMFTransaction* >& redoTransactions(); /** find the transaction with id in undo/redo lists */ - KMFTransaction * findTransction( const QUuid& id ); + KMFTransaction * findTransction( const TQUuid& id ); /** End a transaction e.g. collection of changes that will be tracked to allow undo/redo */ @@ -87,7 +88,7 @@ public: bool inTransaction(); /** store the provided id in the changes list. */ - void changed( const QUuid& id ); + void changed( const TQUuid& id ); /** Remove all stored transacation */ void clearStacks(); @@ -97,16 +98,16 @@ public: void saved(); /** Undo last transaction, return list of affected objects */ - QValueList< NetfilterObject* >& undo(); + TQValueList< NetfilterObject* >& undo(); /** Redo last undo-transaction, return list of affected objects */ - QValueList< NetfilterObject* >& redo(); + TQValueList< NetfilterObject* >& redo(); /** Set the ap instance */ void setKMFInterface( KMyFirewallInterface *app ); /** log message entry */ - void log( const QString&, int kmfErrorType /* = KMFError::NORMAL */, NetfilterObject* /* obj = 0 */ ); + void log( const TQString&, int kmfErrorType /* = KMFError::NORMAL */, NetfilterObject* /* obj = 0 */ ); // bool preserveObjectUuid() const { // // return m_preserveObjectUuid; @@ -117,21 +118,21 @@ protected: KMyFirewallInterface *m_app; private: -// QString m_transactionName; +// TQString m_transactionName; bool m_in_transaction; bool is_saved; // bool m_preserveObjectUuid; - QValueList< KMFTransaction* > m_undo_transactionObjects; - QValueList< KMFTransaction* > m_redo_transactionObjects; + TQValueList< KMFTransaction* > m_undo_transactionObjects; + TQValueList< KMFTransaction* > m_redo_transactionObjects; -// QValueList<int> m_changed_objects; +// TQValueList<int> m_changed_objects; // NetfilterObject *m_highestAffectedObject; KMFTransaction *m_currentTransaction; private: KMFUndoEngine(); - KMFUndoEngine( QObject*, const char* ); + KMFUndoEngine( TQObject*, const char* ); /** Make the loadXML in NEtfilterObject load the uuid from xml */ // void setPreserveObjectUuid( bool onOff ); @@ -141,7 +142,7 @@ private: signals: void sigStackChanged(); - void sigLog( const QString& ); + void sigLog( const TQString& ); }; } #endif diff --git a/kmyfirewall/core/kmyfirewallinterface.h b/kmyfirewall/core/kmyfirewallinterface.h index afaec4b..1aa2773 100644 --- a/kmyfirewall/core/kmyfirewallinterface.h +++ b/kmyfirewall/core/kmyfirewallinterface.h @@ -26,10 +26,10 @@ @author Christian Hubinger */ -#include <qobject.h> +#include <tqobject.h> #include <kdemacros.h> -class QWidget; +class TQWidget; namespace KMF { class KMFProcOut; @@ -46,8 +46,8 @@ public: virtual KMFNetwork* network() = 0; virtual void showEditor() = 0; virtual void showOutput() = 0; - virtual void setOutputWidget( QWidget* wid ) = 0; - virtual void checkStatus() = 0; + virtual void setOutputWidget( TQWidget* wid ) = 0; + virtual void checktqStatus() = 0; virtual void updateCaption() = 0; virtual void enableUndo( bool ) = 0; virtual void enableRedo( bool ) = 0; diff --git a/kmyfirewall/core/kprocesswrapper.cpp b/kmyfirewall/core/kprocesswrapper.cpp index 782b70a..49bb77e 100644 --- a/kmyfirewall/core/kprocesswrapper.cpp +++ b/kmyfirewall/core/kprocesswrapper.cpp @@ -12,10 +12,10 @@ #include "kprocesswrapper.h" // QT Includes -#include <qwidget.h> -#include <quuid.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqwidget.h> +#include <tquuid.h> +#include <tqfile.h> +#include <tqtextstream.h> // KDE includes #include <kapplication.h> @@ -36,7 +36,7 @@ namespace KMF { KProcessWrapper* KProcessWrapper::m_instance = 0; KProcessWrapper* KProcessWrapper::instance() { if ( ! m_instance ) { - m_instance = new KProcessWrapper( KApplication::kApplication()->mainWidget() , "KProcessWrapper" ); + m_instance = new KProcessWrapper( TQT_TQOBJECT(KApplication::kApplication()->mainWidget()) , "KProcessWrapper" ); } return m_instance; } @@ -44,23 +44,23 @@ KProcessWrapper* KProcessWrapper::instance() { -KProcessWrapper::KProcessWrapper( QObject* parent, const char* name ) : QObject( parent, name ) { - m_stderrbuf = new QString( "" ); - m_stdoutbuf = new QString( "" ); +KProcessWrapper::KProcessWrapper( TQObject* tqparent, const char* name ) : TQObject( tqparent, name ) { + m_stderrbuf = new TQString( "" ); + m_stdoutbuf = new TQString( "" ); m_childproc = new KProcess(); m_status = -1; m_exitedNormal = false; - connect( m_childproc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, SLOT( slotReceivedOutput( KProcess*, char*, int ) ) ); - connect( m_childproc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, SLOT( slotReceivedError( KProcess*, char*, int ) ) ); - connect( m_childproc, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ) ; + connect( m_childproc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, TQT_SLOT( slotReceivedOutput( KProcess*, char*, int ) ) ); + connect( m_childproc, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, TQT_SLOT( slotReceivedError( KProcess*, char*, int ) ) ); + connect( m_childproc, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( slotProcessExited( KProcess* ) ) ) ; } KProcessWrapper::~KProcessWrapper() { } -void KProcessWrapper::slotStartLocalJob( const QString& jobName, const QString& command, bool useKdeSu , bool synchronous = false ) { +void KProcessWrapper::slotStartLocalJob( const TQString& jobName, const TQString& command, bool useKdeSu , bool synchronous = false ) { kdDebug() << "Start Local Job: " << jobName << " " << command << endl; kdDebug() << "synchronous: " << synchronous << endl; m_jobName = jobName; @@ -69,11 +69,11 @@ void KProcessWrapper::slotStartLocalJob( const QString& jobName, const QString& m_allOut = ""; m_stdOut = ""; m_stdErr = ""; - QString localScriptFile = command; + TQString localScriptFile = command; KTempFile *f = new KTempFile(); if ( ! KIO::NetAccess::exists( localScriptFile, false, KApplication::kApplication()->mainWidget() ) ) { kdDebug() << "KProcessWrapper::slotStartLocalJob(...) - creating temporary script file." << endl; - QTextStream *ts = f->textStream(); + TQTextStream *ts = f->textStream(); *ts << command << endl; f->sync(); f->close(); @@ -96,8 +96,8 @@ void KProcessWrapper::slotStartLocalJob( const QString& jobName, const QString& delete f; } -void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& scriptFile, KMFTarget* execHost ) { - QString localScriptFile = scriptFile; +void KProcessWrapper::slotStartRemoteJob( const TQString& jobName, const TQString& scriptFile, KMFTarget* execHost ) { + TQString localScriptFile = scriptFile; m_jobName = jobName; *m_stdoutbuf = ""; *m_stderrbuf = ""; @@ -107,7 +107,7 @@ void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& KTempFile *f = new KTempFile(); if ( ! KIO::NetAccess::exists( scriptFile, false, KApplication::kApplication()->mainWidget() ) ) { kdDebug() << "KProcessWrapper::slotStartRemoteJob(...) - creating temporary script file." << endl; - QTextStream *ts = f->textStream(); + TQTextStream *ts = f->textStream(); *ts << scriptFile << endl; f->sync(); f->close(); @@ -115,7 +115,7 @@ void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& } - QUuid uuid = QUuid::createUuid(); + TQUuid uuid = TQUuid::createUuid(); KURL remFileUrl( execHost->getFishUrl() + "/tmp/" + uuid.toString() ); kdDebug() << "UPLOADING: Temporary script file: " << localScriptFile << " to: " << remFileUrl.url() << endl; @@ -134,9 +134,9 @@ void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& f->unlink(); delete f; - QString cmd = "bash /tmp/" + uuid.toString(); + TQString cmd = "bash /tmp/" + uuid.toString(); kdDebug() << "Execute: " << cmd << " at: " << execHost->getFishUrl() << endl; - const QString& ret = KIO::NetAccess::fish_execute( execHost->getFishUrl(), cmd, KApplication::kApplication()->mainWidget() ); + const TQString& ret = KIO::NetAccess::fish_execute( execHost->getFishUrl(), cmd, KApplication::kApplication()->mainWidget() ); if ( ! KIO::NetAccess::del( remFileUrl, KApplication::kApplication()->mainWidget() ) ) { m_exitedNormal = false; m_status = 1; @@ -149,15 +149,15 @@ void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& kdDebug() << "Got Output:" << ret << endl; - const QString& resultVal = ret.right( ret.find( "\n###RESULT:" ) + 10 ); + const TQString& resultVal = ret.right( ret.tqfind( "\n###RESULT:" ) + 10 ); kdDebug() << "resultVal: " << resultVal << endl; m_status = 0; - if ( ret.contains( "###RESULT: 0" ) == 0 ) { + if ( ret.tqcontains( "###RESULT: 0" ) == 0 ) { m_status = 1; } - const QString& retNew = ret.left( ret.find( "\n###RESULT:" ) ); + const TQString& retNew = ret.left( ret.tqfind( "\n###RESULT:" ) ); kdDebug() << "Real Output: " << retNew << endl; @@ -187,7 +187,7 @@ void KProcessWrapper::slotReceivedOutput( KProcess *, char *buffer, int buflen ) *m_stderrbuf = ""; } - *m_stdoutbuf += QString::fromLatin1( buffer, buflen ); + *m_stdoutbuf += TQString::tqfromLatin1( buffer, buflen ); m_allOut.append( *m_stdoutbuf ); m_stdOut.append( *m_stdoutbuf ); @@ -196,8 +196,8 @@ void KProcessWrapper::slotReceivedOutput( KProcess *, char *buffer, int buflen ) // int pos; -// while ( ( pos = m_stdoutbuf->find( '\n' ) ) != -1 ) { -// QString line = m_stdoutbuf->left( pos ); +// while ( ( pos = m_stdoutbuf->tqfind( '\n' ) ) != -1 ) { +// TQString line = m_stdoutbuf->left( pos ); // m_allOut.append( *m_stdoutbuf ); // m_stdOut.append( *m_stdoutbuf ); // m_stdoutbuf->remove( 0, pos + 1 ); @@ -214,14 +214,14 @@ void KProcessWrapper::slotReceivedError( KProcess *, char *buffer, int buflen ) *m_stdoutbuf = ""; } - *m_stderrbuf += QString::fromLatin1( buffer, buflen ); + *m_stderrbuf += TQString::tqfromLatin1( buffer, buflen ); m_allOut.append( *m_stderrbuf ); m_stdErr.append( *m_stderrbuf ); *m_stderrbuf = ""; /* int pos; - while ( ( pos = m_stderrbuf->find( '\n' ) ) != -1 ) { - QString line = m_stderrbuf->left( pos ); + while ( ( pos = m_stderrbuf->tqfind( '\n' ) ) != -1 ) { + TQString line = m_stderrbuf->left( pos ); m_allOut.append( line ); m_stdErr.append( line ); m_stderrbuf->remove( 0, pos + 1 ); diff --git a/kmyfirewall/core/kprocesswrapper.h b/kmyfirewall/core/kprocesswrapper.h index b64e74f..1edc4a5 100644 --- a/kmyfirewall/core/kprocesswrapper.h +++ b/kmyfirewall/core/kprocesswrapper.h @@ -14,8 +14,8 @@ // QT Includes -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> // KDE includes @@ -29,8 +29,9 @@ class KMFTarget; /** @author Christian Hubinger <chubinger@irrsinnig.org> */ -class KProcessWrapper : public QObject { +class KProcessWrapper : public TQObject { Q_OBJECT + TQ_OBJECT //############# Beginn static stuff ############## public: @@ -42,22 +43,22 @@ private: //############# End static stuff ############## public: - KProcessWrapper( QObject*, const char* ); + KProcessWrapper( TQObject*, const char* ); ~KProcessWrapper(); bool isRunning(); - const QString& jobName() const { + const TQString& jobName() const { return m_jobName; } - const QString& stdOut() const { + const TQString& stdOut() const { return m_stdOut; } - const QString& stdErr() const { + const TQString& stdErr() const { return m_stdErr; } - const QString& stdCombined() const { + const TQString& stdCombined() const { return m_allOut; } const int exitStatus() const { @@ -70,8 +71,8 @@ public: public slots: void slotKillJob(); - void slotStartLocalJob( const QString& jobName, const QString& command, bool useKdeSu /* = false */, bool synchronous /* = false */); - void slotStartRemoteJob( const QString& jobName, const QString& scriptFile, KMFTarget* execHost ); + void slotStartLocalJob( const TQString& jobName, const TQString& command, bool useKdeSu /* = false */, bool synchronous /* = false */); + void slotStartRemoteJob( const TQString& jobName, const TQString& scriptFile, KMFTarget* execHost ); protected slots: void slotReceivedOutput( KProcess*, char*, int ); @@ -80,23 +81,23 @@ protected slots: private: - QString* m_stderrbuf; - QString* m_stdoutbuf; + TQString* m_stderrbuf; + TQString* m_stdoutbuf; - QString m_jobName; - QString m_allOut; + TQString m_jobName; + TQString m_allOut; int m_status; bool m_exitedNormal; - QString m_stdOut; - QString m_stdErr; + TQString m_stdOut; + TQString m_stdErr; KProcess* m_childproc; signals: - void sigProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut ); + void sigProcessFinished( const TQString& jobName, int status, bool exitedNormal, const TQString& stdOut, const TQString& stdErr, const TQString& completeOut ); - void sigReceivedStdOut( const QString& jobName, const QString& stdOut ); - void sigReceivedStdErr( const QString& jobName, const QString& stdOut ); + void sigReceivedStdOut( const TQString& jobName, const TQString& stdOut ); + void sigReceivedStdErr( const TQString& jobName, const TQString& stdOut ); }; } diff --git a/kmyfirewall/core/netfilterobject.cpp b/kmyfirewall/core/netfilterobject.cpp index 28f532a..62f31c4 100644 --- a/kmyfirewall/core/netfilterobject.cpp +++ b/kmyfirewall/core/netfilterobject.cpp @@ -35,10 +35,10 @@ namespace KMF { //########### static stuff -QMap<QUuid, NetfilterObject*>* NetfilterObject::m_uuid_dict = new QMap<QUuid, NetfilterObject*>; +TQMap<TQUuid, NetfilterObject*>* NetfilterObject::m_uuid_dict = new TQMap<TQUuid, NetfilterObject*>; -NetfilterObject* NetfilterObject::findObject( const QUuid& uuid ) { - QMap<QUuid, NetfilterObject*>::iterator it = getUuidObjectDict()->find( uuid ); +NetfilterObject* NetfilterObject::findObject( const TQUuid& uuid ) { + TQMap<TQUuid, NetfilterObject*>::iterator it = getUuidObjectDict()->tqfind( uuid ); if ( it != getUuidObjectDict()->end() ) { return (*it); } @@ -51,7 +51,7 @@ int NetfilterObject::objectCount( int type ) { } int count = 0; - QMap<QUuid, NetfilterObject*>::Iterator it; + TQMap<TQUuid, NetfilterObject*>::Iterator it; for ( it = m_uuid_dict->begin(); it != m_uuid_dict->end(); ++it ) { if ( it.data() && it.data()->type() == type ) { count++; @@ -63,10 +63,10 @@ int NetfilterObject::objectCount( int type ) { //########### end static stuff -NetfilterObject::NetfilterObject( NetfilterObject *parent, const char* name ) : QObject( parent, name ) { - // kdDebug() << "NetfilterObject::( NetfilterObject *parent " << name << " )" << endl; - m_uuid = QUuid::createUuid(); - m_parent = parent; +NetfilterObject::NetfilterObject( NetfilterObject *tqparent, const char* name ) : TQObject( tqparent, name ) { + // kdDebug() << "NetfilterObject::( NetfilterObject *tqparent " << name << " )" << endl; + m_uuid = TQUuid::createUuid(); + m_parent = tqparent; m_name = i18n( "Untitled" ); m_desc = i18n( "No Description Available" ); m_uuid_dict->insert( uuid(), this, true ); @@ -75,26 +75,26 @@ NetfilterObject::NetfilterObject( NetfilterObject *parent, const char* name ) : NetfilterObject::~NetfilterObject() { m_uuid_dict->remove( m_uuid ); - if ( m_uuid_dict->contains( m_uuid ) ) { + if ( m_uuid_dict->tqcontains( m_uuid ) ) { kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl; } } -void NetfilterObject::setUuid( const QUuid& newUuid ) { +void NetfilterObject::setUuid( const TQUuid& newUuid ) { if ( newUuid.isNull() ) { return; } - QUuid toSetUuid = newUuid; + TQUuid toSetUuid = newUuid; - while ( m_uuid != toSetUuid && m_uuid_dict->contains( toSetUuid ) ) { + while ( m_uuid != toSetUuid && m_uuid_dict->tqcontains( toSetUuid ) ) { kdDebug() << "NetfilterObject::setUuid( " << toSetUuid << ") new uuid allready in use! Generating new!" << endl; - toSetUuid = QUuid::createUuid(); + toSetUuid = TQUuid::createUuid(); } m_uuid_dict->remove( m_uuid ); - if ( m_uuid_dict->contains( m_uuid ) ) { + if ( m_uuid_dict->tqcontains( m_uuid ) ) { kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl; } @@ -104,15 +104,15 @@ void NetfilterObject::setUuid( const QUuid& newUuid ) { m_uuid_dict->insert( m_uuid, this, true ); } -void NetfilterObject::setParent( NetfilterObject *parent ) { - if ( ! parent || parent == m_parent ) { +void NetfilterObject::setParent( NetfilterObject *tqparent ) { + if ( ! tqparent || tqparent == m_parent ) { return; } - m_parent = parent; + m_parent = tqparent; changed(); } -bool NetfilterObject::isChildOf( const QUuid& id ) { +bool NetfilterObject::isChildOf( const TQUuid& id ) { if ( ! m_parent ) { // kdDebug() << "NetfilterObject: " << name() << ":" << uuid() << " ->isChildOf( " << id << " ) - No More Parent return: false" << endl; return false; @@ -139,14 +139,14 @@ void NetfilterObject::getLevel( int& currlevel ) { } } -const QString& NetfilterObject::name() { - // kdDebug() << "const QString& NetfilterObject::name()" << endl; +const TQString& NetfilterObject::name() { + // kdDebug() << "const TQString& NetfilterObject::name()" << endl; return m_name; } -void NetfilterObject::setName( const QString& name ) { - //kdDebug() << "const QString& NetfilterObject::setName( const QString& " << name << " )" << endl; +void NetfilterObject::setName( const TQString& name ) { + //kdDebug() << "const TQString& NetfilterObject::setName( const TQString& " << name << " )" << endl; if ( name.isNull() || name == m_name ) { return; } @@ -154,11 +154,11 @@ void NetfilterObject::setName( const QString& name ) { changed(); } -const QString& NetfilterObject::description() { +const TQString& NetfilterObject::description() { return m_desc; } -void NetfilterObject::setDescription( const QString& desc ) { +void NetfilterObject::setDescription( const TQString& desc ) { if ( desc.isNull() ) { return; } @@ -169,31 +169,31 @@ void NetfilterObject::setDescription( const QString& desc ) { changed(); } -const QString& NetfilterObject::getXMLSniplet() { -// kdDebug() << "const QString& NetfilterObject::getXMLsniplet()" << endl; - QDomDocument tmp_doc = getDOMTree(); - const QString& xml = tmp_doc.toString(); +const TQString& NetfilterObject::getXMLSniplet() { +// kdDebug() << "const TQString& NetfilterObject::getXMLsniplet()" << endl; + TQDomDocument tmp_doc = getDOMTree(); + const TQString& xml = tmp_doc.toString(); // kdDebug() << "Creted XML:\n" << xml << "\n" << endl; - return *( new QString( xml ) ); + return *( new TQString( xml ) ); } -void NetfilterObject::loadUuid( QDomNode& node, QStringList& errors ) { +void NetfilterObject::loadUuid( TQDomNode& node, TQStringList& errors ) { if ( ! node.toElement().hasAttribute( XML::Uuid_Attribute ) ) { - errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).arg( node.nodeName () ) ) ); + errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).tqarg( node.nodeName () ) ) ); return; } // if ( KMFUndoEngine::instance()->preserveObjectUuid() ) { - const QString& newUuid = node.toElement().attribute( XML::Uuid_Attribute ); + const TQString& newUuid = node.toElement().attribute( XML::Uuid_Attribute ); if ( newUuid.isEmpty() ) { - errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).arg( node.nodeName () ) ) ); + errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).tqarg( node.nodeName () ) ) ); return; } - // KMFUndoEngine::instance()->log( i18n( "Overwrite my uuid: %1 with %2" ).arg( uuid().toString() ).arg( newUuid ), KMFError::OK, this ); + // KMFUndoEngine::instance()->log( i18n( "Overwrite my uuid: %1 with %2" ).tqarg( uuid().toString() ).tqarg( newUuid ), KMFError::OK, this ); setUuid( newUuid ); // } } -void NetfilterObject::saveUuid( QDomNode& node ) { +void NetfilterObject::saveUuid( TQDomNode& node ) { node.toElement().setAttribute( XML::Uuid_Attribute, uuid().toString() ); } diff --git a/kmyfirewall/core/netfilterobject.h b/kmyfirewall/core/netfilterobject.h index 5734c76..9d08f69 100644 --- a/kmyfirewall/core/netfilterobject.h +++ b/kmyfirewall/core/netfilterobject.h @@ -17,15 +17,15 @@ #define NETFILTEROBJECT_H // QT includes -#include <qobject.h> -#include <qstring.h> -#include <qdom.h> -#include <qptrlist.h> -#include <qintdict.h> -#include <qmap.h> -#include <quuid.h> -#include <qstringlist.h> -#include <qguardedptr.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqintdict.h> +#include <tqmap.h> +#include <tquuid.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> #include <kdemacros.h> // KDE includes @@ -40,7 +40,7 @@ class KMFUndoEngine; used within KMF. It defines the needed prperties and methods to allow things undo/redo, unique object id's etc. */ -class KDE_EXPORT NetfilterObject : public QObject { +class KDE_EXPORT NetfilterObject : public TQObject { // friend class KMFNetwork; friend class KMFUndoEngine; @@ -50,16 +50,16 @@ friend class KMFProtocolCategory; //############# Beginn static stuff ############## public: - static NetfilterObject* findObject( const QUuid& uuid ); + static NetfilterObject* findObject( const TQUuid& uuid ); static int objectCount( int type ); private: - static QMap<QUuid, NetfilterObject*>* getUuidObjectDict() { + static TQMap<TQUuid, NetfilterObject*>* getUuidObjectDict() { return m_uuid_dict; }; // DATA private: - static QMap<QUuid, NetfilterObject*>* m_uuid_dict; + static TQMap<TQUuid, NetfilterObject*>* m_uuid_dict; //############# End static stuff ############## @@ -69,7 +69,7 @@ public: private: NetfilterObject(); - NetfilterObject( QObject* ); + NetfilterObject( TQObject* ); public: /** Known object types */ @@ -91,18 +91,18 @@ public: }; /** Get All living objects of the given Type */ - // const QValueList<NetfilterObject*>& getAllOfType( int type ); + // const TQValueList<NetfilterObject*>& getAllOfType( int type ); /** Sets the Neame of the Object */ - virtual void setName( const QString& ); + virtual void setName( const TQString& ); /** return the object uuid */ - const QUuid& uuid() const { + const TQUuid& uuid() const { return m_uuid; }; /** Retrun the Object's name */ - virtual const QString& name(); + virtual const TQString& name(); /** reset type */ @@ -115,59 +115,59 @@ public: int getLevel(); /** Return the Object's Description */ - virtual const QString& description(); + virtual const TQString& description(); /** Set Description for this Object */ - virtual void setDescription( const QString& ); + virtual void setDescription( const TQString& ); /** Return DomDocument of this Object */ - virtual const QDomDocument& getDOMTree() = 0; + virtual const TQDomDocument& getDOMTree() = 0; /** Return String representation of the DomDocument generated - by const QDomDocument& getDOMTree() */ - virtual const QString& getXMLSniplet(); + by const TQDomDocument& getDOMTree() */ + virtual const TQString& getXMLSniplet(); - /** Load configuration from the given QDdomDocument */ - virtual void loadXML( const QDomDocument&, QStringList& errors ) = 0; + /** Load configuration from the given TQDdomDocument */ + virtual void loadXML( const TQDomDocument&, TQStringList& errors ) = 0; - /** Load configuration from the given QDdomDocument */ - virtual void loadXML( QDomNode, QStringList& errors ) = 0; + /** Load configuration from the given TQDdomDocument */ + virtual void loadXML( TQDomNode, TQStringList& errors ) = 0; - /** Set the parent object */ + /** Set the tqparent object */ void setParent( NetfilterObject* ); /** check if the object is a (indirect) child of the object with the given id */ - bool isChildOf( const QUuid& uuid ); + bool isChildOf( const TQUuid& uuid ); - /** set the changed flag, and calling changed( int id ) in the parent + /** set the changed flag, and calling changed( int id ) in the tqparent object with it's own id */ void changed(); /** Get the Parent object */ - NetfilterObject* parentObj() const { + NetfilterObject* tqparentObj() const { return m_parent; } protected: /** read the uuid from the dom node if needed */ - void loadUuid( QDomNode&, QStringList& errors ); + void loadUuid( TQDomNode&, TQStringList& errors ); /** write the uuid to the dom node */ - void saveUuid( QDomNode& ); + void saveUuid( TQDomNode& ); private: /** Return the Object's nesting level within the NetfilterObject Tree walking the tree up */ void getLevel( int& currlevel ); /** Sets the UUID of the Object */ - void setUuid( const QUuid& ); + void setUuid( const TQUuid& ); private: - QGuardedPtr<NetfilterObject> m_parent; - QString m_name; - QString m_desc; - QUuid m_uuid; + TQGuardedPtr<NetfilterObject> m_parent; + TQString m_name; + TQString m_desc; + TQUuid m_uuid; }; } #endif diff --git a/kmyfirewall/core/xmlnames.cpp b/kmyfirewall/core/xmlnames.cpp index bd1b2a1..048f7c8 100644 --- a/kmyfirewall/core/xmlnames.cpp +++ b/kmyfirewall/core/xmlnames.cpp @@ -15,137 +15,137 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004 namespace KMF { // Document Elements -const QString& XML::GenericDoc_DocumentElement = "kmfgrs"; -const QString& XML::IPTDoc_DocumentElement = "kmfrs"; -const QString& XML::KMFNetwork_DocumentElement = "kmfnet"; +const TQString& XML::GenericDoc_DocumentElement = "kmfgrs"; +const TQString& XML::IPTDoc_DocumentElement = "kmfrs"; +const TQString& XML::KMFNetwork_DocumentElement = "kmfnet"; // Elements -const QString& XML::Protocol_Element = "protocol"; -const QString& XML::Table_Element = "table"; -const QString& XML::Chain_Element = "chain"; -const QString& XML::Rule_Element = "rule"; -const QString& XML::RuleOption_Element = "ruleoption"; -const QString& XML::RuleOptionValue_Element = "ruleoptionvalue"; -const QString& XML::Logging_Element = "logging"; -const QString& XML::Target_Element = "target"; -const QString& XML::ProtocolUsage_Element = "protocolusage"; -const QString& XML::Port_Element = "port"; -const QString& XML::Abstract_Element = "abstract"; -const QString& XML::ICMP_Element = "icmp"; -const QString& XML::NAT_Element = "nat"; -const QString& XML::NetHost_Element = "nethost"; -const QString& XML::NetZone_Element = "netzone"; -const QString& XML::FromIP_Element = "fromIP"; -const QString& XML::NetMask_Element = "netMask"; -const QString& XML::ProtocolCategory_Element = "protocolCategory"; -const QString& XML::Interface_Element = "interface"; -const QString& XML::OS_Element = "os"; -const QString& XML::BackEnd_Element = "backend"; -const QString& XML::Distribution_Element = "distribution"; -const QString& XML::InitPath_Element = "initPath"; -const QString& XML::IPTPath_Element = "IPTPath"; -const QString& XML::ModprobePath_Element = "modprobePath"; -const QString& XML::RcDefaultPath_Element = "rcDefaultPath"; -const QString& XML::TargetConfig_Element = "targetconfig"; +const TQString& XML::Protocol_Element = "protocol"; +const TQString& XML::Table_Element = "table"; +const TQString& XML::Chain_Element = "chain"; +const TQString& XML::Rule_Element = "rule"; +const TQString& XML::RuleOption_Element = "ruleoption"; +const TQString& XML::RuleOptionValue_Element = "ruleoptionvalue"; +const TQString& XML::Logging_Element = "logging"; +const TQString& XML::Target_Element = "target"; +const TQString& XML::ProtocolUsage_Element = "protocolusage"; +const TQString& XML::Port_Element = "port"; +const TQString& XML::Abstract_Element = "abstract"; +const TQString& XML::ICMP_Element = "icmp"; +const TQString& XML::NAT_Element = "nat"; +const TQString& XML::NetHost_Element = "nethost"; +const TQString& XML::NetZone_Element = "netzone"; +const TQString& XML::FromIP_Element = "fromIP"; +const TQString& XML::NetMask_Element = "netMask"; +const TQString& XML::ProtocolCategory_Element = "protocolCategory"; +const TQString& XML::Interface_Element = "interface"; +const TQString& XML::OS_Element = "os"; +const TQString& XML::BackEnd_Element = "backend"; +const TQString& XML::Distribution_Element = "distribution"; +const TQString& XML::InitPath_Element = "initPath"; +const TQString& XML::IPTPath_Element = "IPTPath"; +const TQString& XML::ModprobePath_Element = "modprobePath"; +const TQString& XML::RcDefaultPath_Element = "rcDefaultPath"; +const TQString& XML::TargetConfig_Element = "targetconfig"; // Attributes -const QString& XML::Protocol_Attribute = "protocol"; -const QString& XML::Uuid_Attribute = "uuid"; -const QString& XML::Name_Attribute = "name"; -const QString& XML::Description_Attribute = "description"; -const QString& XML::GUIName_Attribute = "guiName"; -const QString& XML::Address_Attribute = "address"; -const QString& XML::ReadOnly_Attribute = "readonly"; -const QString& XML::Type_Attribute = "type"; -const QString& XML::TargetOption_Attribute = "targetoption"; -const QString& XML::BuiltIn_Attribute = "builtin"; -const QString& XML::DefaultTarget_Attribute = "default_target"; -const QString& XML::Logging_Attribute = "logging"; -const QString& XML::Target_Attribute = "target"; -const QString& XML::Prefix_Attribute = "prefix"; -const QString& XML::Limit_Attribute = "limit"; -const QString& XML::Burst_Attribute = "burst"; -const QString& XML::IO_Attribute = "io"; -const QString& XML::ProtocolUuid_Attribute = "protocolUuid"; -const QString& XML::Enabled_Attribute = "enabled"; -const QString& XML::CustomRule_Attribute = "custom_rule"; -const QString& XML::Num_Attribute = "num"; -const QString& XML::Version_Attribute = "version"; -const QString& XML::MinVersion_Attribute = "minVersion"; -const QString& XML::MaxVersion_Attribute = "maxVersion"; -const QString& XML::RestrictOutgoingConnections_Attribute = "restrictOutgoingConnections"; -const QString& XML::AllowIncomingConnections_Attribute = "allowIncomingConnections"; -const QString& XML::LogIncoming_Attribute = "logIncoming"; -const QString& XML::LogOutgoing_Attribute = "logOutgoing"; -const QString& XML::LimitRate_Attribute = "limitRate"; -const QString& XML::LimitScale_Attribute = "limitScale"; -const QString& XML::SSHPort_Attribute = "sshPort"; +const TQString& XML::Protocol_Attribute = "protocol"; +const TQString& XML::Uuid_Attribute = "uuid"; +const TQString& XML::Name_Attribute = "name"; +const TQString& XML::Description_Attribute = "description"; +const TQString& XML::GUIName_Attribute = "guiName"; +const TQString& XML::Address_Attribute = "address"; +const TQString& XML::ReadOnly_Attribute = "readonly"; +const TQString& XML::Type_Attribute = "type"; +const TQString& XML::TargetOption_Attribute = "targetoption"; +const TQString& XML::BuiltIn_Attribute = "builtin"; +const TQString& XML::DefaultTarget_Attribute = "default_target"; +const TQString& XML::Logging_Attribute = "logging"; +const TQString& XML::Target_Attribute = "target"; +const TQString& XML::Prefix_Attribute = "prefix"; +const TQString& XML::Limit_Attribute = "limit"; +const TQString& XML::Burst_Attribute = "burst"; +const TQString& XML::IO_Attribute = "io"; +const TQString& XML::ProtocolUuid_Attribute = "protocolUuid"; +const TQString& XML::Enabled_Attribute = "enabled"; +const TQString& XML::CustomRule_Attribute = "custom_rule"; +const TQString& XML::Num_Attribute = "num"; +const TQString& XML::Version_Attribute = "version"; +const TQString& XML::MinVersion_Attribute = "minVersion"; +const TQString& XML::MaxVersion_Attribute = "maxVersion"; +const TQString& XML::RestrictOutgoingConnections_Attribute = "restrictOutgoingConnections"; +const TQString& XML::AllowIncomingConnections_Attribute = "allowIncomingConnections"; +const TQString& XML::LogIncoming_Attribute = "logIncoming"; +const TQString& XML::LogOutgoing_Attribute = "logOutgoing"; +const TQString& XML::LimitRate_Attribute = "limitRate"; +const TQString& XML::LimitScale_Attribute = "limitScale"; +const TQString& XML::SSHPort_Attribute = "sshPort"; // Network -const QString& XML::Interface_Attribute = "interface"; +const TQString& XML::Interface_Attribute = "interface"; // GENERIC DOC -const QString& XML::LogDropped_Attribute = "logDropped"; -const QString& XML::LimitLog_Attribute = "limitLog"; -const QString& XML::LogPrefix_Attribute = "logPrefix"; -const QString& XML::AllowPingReply_Attribute = "allowPingReply"; -const QString& XML::LimitPingReply_Attribute = "limitPingReply"; -const QString& XML::UseNat_Attribute = "useNat"; -const QString& XML::UseMasquerade_Attribute = "useMasquerade"; -const QString& XML::NatAddress_Attribute = "natAddress"; -const QString& XML::OutgoingInterface_Attribute = "outgoingInterface"; +const TQString& XML::LogDropped_Attribute = "logDropped"; +const TQString& XML::LimitLog_Attribute = "limitLog"; +const TQString& XML::LogPrefix_Attribute = "logPrefix"; +const TQString& XML::AllowPingReply_Attribute = "allowPingReply"; +const TQString& XML::LimitPingReply_Attribute = "limitPingReply"; +const TQString& XML::UseNat_Attribute = "useNat"; +const TQString& XML::UseMasquerade_Attribute = "useMasquerade"; +const TQString& XML::NatAddress_Attribute = "natAddress"; +const TQString& XML::OutgoingInterface_Attribute = "outgoingInterface"; // IPTDOC -const QString& XML::UseFilter_Attribute = "use_filter"; -const QString& XML::Use_Nat_Attribute = "use_nat"; -const QString& XML::UseMangle_Attribute = "use_mangle"; -const QString& XML::UseModules_Attribute = "use_modules"; -const QString& XML::UseRpFilter_Attribute = "use_rp_filter"; -const QString& XML::UseIPFwd_Attribute = "use_ipfwd"; -const QString& XML::UseSynCookies_Attribute = "use_syn_cookies"; -const QString& XML::UseMartians_Attribute = "use_martians"; +const TQString& XML::UseFilter_Attribute = "use_filter"; +const TQString& XML::Use_Nat_Attribute = "use_nat"; +const TQString& XML::UseMangle_Attribute = "use_mangle"; +const TQString& XML::UseModules_Attribute = "use_modules"; +const TQString& XML::UseRpFilter_Attribute = "use_rp_filter"; +const TQString& XML::UseIPFwd_Attribute = "use_ipfwd"; +const TQString& XML::UseSynCookies_Attribute = "use_syn_cookies"; +const TQString& XML::UseMartians_Attribute = "use_martians"; // Values -const QString& XML::Yes_Value = "yes"; -const QString& XML::No_Value = "no"; -const QString& XML::BoolOn_Value = "bool:on"; -const QString& XML::BoolOff_Value = "bool:off"; -const QString& XML::Undefined_Value = "UNDEFINED"; -const QString& XML::Incoming_Value = "INCOMING"; -const QString& XML::Outgoing_Value = "OUTGOING"; -const QString& XML::UDP_Value = "UDP"; -const QString& XML::TCP_Value = "TCP"; -const QString& XML::IPTablesGUIInterface_Value = "iptables"; -const QString& XML::GenericGUIInterface_Value = "generic"; +const TQString& XML::Yes_Value = "yes"; +const TQString& XML::No_Value = "no"; +const TQString& XML::BoolOn_Value = "bool:on"; +const TQString& XML::BoolOff_Value = "bool:off"; +const TQString& XML::Undefined_Value = "UNDEFINED"; +const TQString& XML::Incoming_Value = "INCOMING"; +const TQString& XML::Outgoing_Value = "OUTGOING"; +const TQString& XML::UDP_Value = "UDP"; +const TQString& XML::TCP_Value = "TCP"; +const TQString& XML::IPTablesGUIInterface_Value = "iptables"; +const TQString& XML::GenericGUIInterface_Value = "generic"; // Constants -const QString& Constants::Localhost_Name = "localhost"; -const QString& Constants::Localhost_IP = "127.0.0.1"; -const QString& Constants::MyNetwork_Name = "mynetwork"; -const QString& Constants::FilterTable_Name = "filter"; -const QString& Constants::NatTable_Name = "nat"; -const QString& Constants::MangleTable_Name = "mangle"; - -const QString& Constants::InputChain_Name = "INPUT"; -const QString& Constants::OutputChain_Name = "OUTPUT"; -const QString& Constants::ForwardChain_Name = "FORWARD"; -const QString& Constants::PreRoutingChain_Name = "PREROUTING"; -const QString& Constants::PostRoutingChain_Name = "POSTROUTING"; - -const QString& Constants::StartFirewallJob_Name = "start_firewall_job"; -const QString& Constants::StopFirewallJob_Name = "stop_firewall_job"; -const QString& Constants::InstallFirewallJob_Name = "install_firewall_job"; -const QString& Constants::UninstallFirewallJob_Name = "uninstall_firewall_job"; -const QString& Constants::ShowConfigJob_Name = "show_config_job"; -// const QString& Constants::KdeSu_Cmd = "kdesu -t -i kmyfirewall -d -c "; +const TQString& Constants::Localhost_Name = "localhost"; +const TQString& Constants::Localhost_IP = "127.0.0.1"; +const TQString& Constants::MyNetwork_Name = "mynetwork"; +const TQString& Constants::FilterTable_Name = "filter"; +const TQString& Constants::NatTable_Name = "nat"; +const TQString& Constants::MangleTable_Name = "mangle"; + +const TQString& Constants::InputChain_Name = "INPUT"; +const TQString& Constants::OutputChain_Name = "OUTPUT"; +const TQString& Constants::ForwardChain_Name = "FORWARD"; +const TQString& Constants::PreRoutingChain_Name = "PREROUTING"; +const TQString& Constants::PostRoutingChain_Name = "POSTROUTING"; + +const TQString& Constants::StartFirewallJob_Name = "start_firewall_job"; +const TQString& Constants::StopFirewallJob_Name = "stop_firewall_job"; +const TQString& Constants::InstallFirewallJob_Name = "install_firewall_job"; +const TQString& Constants::UninstallFirewallJob_Name = "uninstall_firewall_job"; +const TQString& Constants::ShowConfigJob_Name = "show_config_job"; +// const TQString& Constants::KdeSu_Cmd = "kdesu -t -i kmyfirewall -d -c "; } diff --git a/kmyfirewall/core/xmlnames.h b/kmyfirewall/core/xmlnames.h index 4cbfb61..2f74374 100644 --- a/kmyfirewall/core/xmlnames.h +++ b/kmyfirewall/core/xmlnames.h @@ -12,7 +12,7 @@ Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008 #ifndef XMLNAMES_H #define XMLNAMES_H -#include <qstring.h> +#include <tqstring.h> /** @author Christian Hubinger <chubinger@irrsinnig.org> @@ -26,104 +26,104 @@ class XML { public: ~XML(); // Document Elements - static const QString& GenericDoc_DocumentElement; - static const QString& IPTDoc_DocumentElement; - static const QString& KMFNetwork_DocumentElement; + static const TQString& GenericDoc_DocumentElement; + static const TQString& IPTDoc_DocumentElement; + static const TQString& KMFNetwork_DocumentElement; // Elements - static const QString& Table_Element; - static const QString& Chain_Element; - static const QString& Rule_Element; - static const QString& RuleOption_Element; - static const QString& RuleOptionValue_Element; - static const QString& Protocol_Element; - static const QString& ProtocolUsage_Element; - static const QString& ProtocolCategory_Element; - static const QString& Logging_Element; - static const QString& Target_Element; - static const QString& TargetConfig_Element; - static const QString& Port_Element; - static const QString& Abstract_Element; - static const QString& ICMP_Element; - static const QString& NAT_Element; - static const QString& NetHost_Element; - static const QString& NetZone_Element; - static const QString& FromIP_Element; - static const QString& NetMask_Element; - static const QString& Interface_Element; - static const QString& OS_Element; - static const QString& BackEnd_Element; - static const QString& Distribution_Element; - static const QString& InitPath_Element; - static const QString& IPTPath_Element; - static const QString& ModprobePath_Element; - static const QString& RcDefaultPath_Element; + static const TQString& Table_Element; + static const TQString& Chain_Element; + static const TQString& Rule_Element; + static const TQString& RuleOption_Element; + static const TQString& RuleOptionValue_Element; + static const TQString& Protocol_Element; + static const TQString& ProtocolUsage_Element; + static const TQString& ProtocolCategory_Element; + static const TQString& Logging_Element; + static const TQString& Target_Element; + static const TQString& TargetConfig_Element; + static const TQString& Port_Element; + static const TQString& Abstract_Element; + static const TQString& ICMP_Element; + static const TQString& NAT_Element; + static const TQString& NetHost_Element; + static const TQString& NetZone_Element; + static const TQString& FromIP_Element; + static const TQString& NetMask_Element; + static const TQString& Interface_Element; + static const TQString& OS_Element; + static const TQString& BackEnd_Element; + static const TQString& Distribution_Element; + static const TQString& InitPath_Element; + static const TQString& IPTPath_Element; + static const TQString& ModprobePath_Element; + static const TQString& RcDefaultPath_Element; // Attributes - static const QString& Uuid_Attribute; - static const QString& Name_Attribute; - static const QString& Description_Attribute; - static const QString& GUIName_Attribute; - static const QString& Protocol_Attribute; - static const QString& Address_Attribute; - static const QString& ReadOnly_Attribute; - static const QString& Type_Attribute; - static const QString& TargetOption_Attribute; - static const QString& BuiltIn_Attribute; - static const QString& DefaultTarget_Attribute; - static const QString& Logging_Attribute; - static const QString& Target_Attribute; - static const QString& Prefix_Attribute; - static const QString& Limit_Attribute; - static const QString& Burst_Attribute; - static const QString& IO_Attribute; - static const QString& ProtocolUuid_Attribute; - static const QString& Enabled_Attribute; - static const QString& CustomRule_Attribute; - static const QString& Num_Attribute; - static const QString& Version_Attribute; - static const QString& MinVersion_Attribute; - static const QString& MaxVersion_Attribute; - static const QString& RestrictOutgoingConnections_Attribute; - static const QString& AllowIncomingConnections_Attribute; - static const QString& LogDropped_Attribute; - static const QString& LimitLog_Attribute; - static const QString& LogPrefix_Attribute; - static const QString& AllowPingReply_Attribute; - static const QString& LimitPingReply_Attribute; - static const QString& UseNat_Attribute; - static const QString& UseMasquerade_Attribute; - static const QString& NatAddress_Attribute; - static const QString& OutgoingInterface_Attribute; - static const QString& UseFilter_Attribute; - static const QString& Use_Nat_Attribute; - static const QString& UseMangle_Attribute; - static const QString& UseModules_Attribute; - static const QString& UseRpFilter_Attribute; - static const QString& UseIPFwd_Attribute; - static const QString& UseSynCookies_Attribute; - static const QString& UseMartians_Attribute; - static const QString& LogIncoming_Attribute; - static const QString& LogOutgoing_Attribute; - static const QString& LimitRate_Attribute; - static const QString& LimitScale_Attribute; - static const QString& Interface_Attribute; - static const QString& SSHPort_Attribute; + static const TQString& Uuid_Attribute; + static const TQString& Name_Attribute; + static const TQString& Description_Attribute; + static const TQString& GUIName_Attribute; + static const TQString& Protocol_Attribute; + static const TQString& Address_Attribute; + static const TQString& ReadOnly_Attribute; + static const TQString& Type_Attribute; + static const TQString& TargetOption_Attribute; + static const TQString& BuiltIn_Attribute; + static const TQString& DefaultTarget_Attribute; + static const TQString& Logging_Attribute; + static const TQString& Target_Attribute; + static const TQString& Prefix_Attribute; + static const TQString& Limit_Attribute; + static const TQString& Burst_Attribute; + static const TQString& IO_Attribute; + static const TQString& ProtocolUuid_Attribute; + static const TQString& Enabled_Attribute; + static const TQString& CustomRule_Attribute; + static const TQString& Num_Attribute; + static const TQString& Version_Attribute; + static const TQString& MinVersion_Attribute; + static const TQString& MaxVersion_Attribute; + static const TQString& RestrictOutgoingConnections_Attribute; + static const TQString& AllowIncomingConnections_Attribute; + static const TQString& LogDropped_Attribute; + static const TQString& LimitLog_Attribute; + static const TQString& LogPrefix_Attribute; + static const TQString& AllowPingReply_Attribute; + static const TQString& LimitPingReply_Attribute; + static const TQString& UseNat_Attribute; + static const TQString& UseMasquerade_Attribute; + static const TQString& NatAddress_Attribute; + static const TQString& OutgoingInterface_Attribute; + static const TQString& UseFilter_Attribute; + static const TQString& Use_Nat_Attribute; + static const TQString& UseMangle_Attribute; + static const TQString& UseModules_Attribute; + static const TQString& UseRpFilter_Attribute; + static const TQString& UseIPFwd_Attribute; + static const TQString& UseSynCookies_Attribute; + static const TQString& UseMartians_Attribute; + static const TQString& LogIncoming_Attribute; + static const TQString& LogOutgoing_Attribute; + static const TQString& LimitRate_Attribute; + static const TQString& LimitScale_Attribute; + static const TQString& Interface_Attribute; + static const TQString& SSHPort_Attribute; //Values - static const QString& Yes_Value; - static const QString& No_Value; - static const QString& BoolOn_Value; - static const QString& BoolOff_Value; - static const QString& Undefined_Value; - static const QString& Incoming_Value; - static const QString& Outgoing_Value; - static const QString& UDP_Value; - static const QString& TCP_Value; + static const TQString& Yes_Value; + static const TQString& No_Value; + static const TQString& BoolOn_Value; + static const TQString& BoolOff_Value; + static const TQString& Undefined_Value; + static const TQString& Incoming_Value; + static const TQString& Outgoing_Value; + static const TQString& UDP_Value; + static const TQString& TCP_Value; - static const QString& IPTablesGUIInterface_Value; - static const QString& GenericGUIInterface_Value; + static const TQString& IPTablesGUIInterface_Value; + static const TQString& GenericGUIInterface_Value; }; @@ -134,24 +134,24 @@ class Constants { Constants(); public: ~Constants(); - static const QString& Localhost_Name; - static const QString& Localhost_IP; - static const QString& MyNetwork_Name; - static const QString& FilterTable_Name; - static const QString& NatTable_Name; - static const QString& MangleTable_Name; + static const TQString& Localhost_Name; + static const TQString& Localhost_IP; + static const TQString& MyNetwork_Name; + static const TQString& FilterTable_Name; + static const TQString& NatTable_Name; + static const TQString& MangleTable_Name; - static const QString& InputChain_Name; - static const QString& OutputChain_Name; - static const QString& ForwardChain_Name; - static const QString& PreRoutingChain_Name; - static const QString& PostRoutingChain_Name; + static const TQString& InputChain_Name; + static const TQString& OutputChain_Name; + static const TQString& ForwardChain_Name; + static const TQString& PreRoutingChain_Name; + static const TQString& PostRoutingChain_Name; - static const QString& StartFirewallJob_Name; - static const QString& StopFirewallJob_Name; - static const QString& InstallFirewallJob_Name; - static const QString& UninstallFirewallJob_Name; - static const QString& ShowConfigJob_Name; + static const TQString& StartFirewallJob_Name; + static const TQString& StopFirewallJob_Name; + static const TQString& InstallFirewallJob_Name; + static const TQString& UninstallFirewallJob_Name; + static const TQString& ShowConfigJob_Name; }; |