rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmyfirewall@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 764544601a
commit 299d556caf

@ -60,7 +60,7 @@ void KMFIPTInterface::add(TQString arg)
bool KMFIPTInterface::remove(TQString arg)
{
TQStringList::Iterator it = m_List.tqfind(arg);
TQStringList::Iterator it = m_List.find(arg);
if (it != m_List.end())
{
m_List.remove(it);

@ -298,7 +298,7 @@ void KMFIPTablesDocumentConverter::createZoneProtocol( IPTChain* chain, KMFProto
IPTRule* rule;
rule = chain->addRule( prot->protocol()->name()+ "_" + option , m_err );
if ( ports.tqcontains( "," ) > 0 ) {
if ( ports.contains( "," ) > 0 ) {
s = option + "_multiport_opt";
} else {
s = option + "_opt";
@ -362,7 +362,7 @@ void KMFIPTablesDocumentConverter::createHostProtocol( IPTChain* chain, KMFNetHo
i++;
hn = "H" + hn;
rule = chain->addRule( hn + "_" + prot->protocol()->name() + "_" + option , m_err );
if ( ports.tqcontains( "," ) > 0 ) {
if ( ports.contains( "," ) > 0 ) {
s = option + "_multiport_opt";
} else {
s = option + "_opt";

@ -107,7 +107,7 @@ bool IPAddress::setAddress( const TQString& input ) {
bool valid = true;
int counter = 0;
while ( !inp.isEmpty() ) {
pos = inp.tqfind( "." );
pos = inp.find( "." );
if ( pos > -1 ) {
str_num = inp.left( pos );
// kdDebug() << "IP Num Part: " << str_num << endl;

@ -217,7 +217,7 @@ KMFError* IPTable::delChain( IPTChain *chain ) {
m_err->setErrType( KMFError::NORMAL );
return m_err;
}
int index = m_chains.tqfind( chain );
int index = m_chains.find( chain );
// kdDebug() << "fount chain nr: " << index << endl;
if ( index < 0 ) {
chain->deleteLater();

@ -126,7 +126,7 @@ void IPTChain::setUsed( bool valid ) {
int IPTChain::indexOf( const IPTRule& rule ) {
// kdDebug() << "int IPTChain::indexOf( IPTRule* " << rule.name() << " ) " << endl;
return m_ruleset.tqfind( &rule );
return m_ruleset.find( &rule );
}
IPTRule* IPTChain::addRule( const TQString& rule_name, KMFError *err, int index ) {
@ -176,7 +176,7 @@ KMFError* IPTChain::delRule( IPTRule* rule ) {
return false;
TQString name = rule->name();
if ( m_ruleset.tqfind( rule ) != -1 ) {
if ( m_ruleset.find( rule ) != -1 ) {
m_err->setErrType(KMFError::OK );
if ( ! m_ruleset.remove( rule ) ) {
rule->deleteLater();
@ -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.tqfind( rule );
int num = m_ruleset.find( 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;

@ -201,7 +201,7 @@ TQStringList IPTRule::availableTargets() const {
IPTRuleOption* IPTRule::getOptionForName( const TQString& type ) {
IPTRuleOption * option_obj;
option_obj = m_options.tqfind( type );
option_obj = m_options.find( type );
if ( option_obj == 0 && !type.stripWhiteSpace().isEmpty() ) {
// kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
option_obj = new IPTRuleOption( this, type.latin1() );
@ -230,7 +230,7 @@ bool IPTRule::addRuleOption( TQString& par_name, TQPtrList<TQString>& cmds ) {
return false;
}
IPTRuleOption * option_obj;
option_obj = m_options.tqfind( new_par_name );
option_obj = m_options.find( new_par_name );
if ( option_obj == 0 ) {
// kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
option_obj = new IPTRuleOption( this, new_par_name.latin1() );
@ -263,7 +263,7 @@ bool IPTRule::addTargetOption( TQString& par_name, TQPtrList<TQString>& cmds ) {
}
IPTRuleOption * option_obj;
option_obj = m_options.tqfind( new_par_name );
option_obj = m_options.find( new_par_name );
if ( option_obj == 0 ) {
// kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
option_obj = new IPTRuleOption( this, par_name.latin1() );
@ -317,7 +317,7 @@ const TQString& IPTRule::toString() {
} else {
// kdDebug() << "Searching for Option: " << *option_name << endl;
IPTRuleOption* opt = 0;
opt = m_options.tqfind( *option_name );
opt = m_options.find( *option_name );
if ( opt && ! opt->isEmpty() && ! opt->isTargetOption() ) {
TQString option = opt->toString();
// kdDebug() << "Add Option: " << opt->toString() << endl;
@ -357,7 +357,7 @@ const TQString& IPTRule::toString() {
} else {
// kdDebug() << "Searching for Option: " << *option_name << endl;
IPTRuleOption* opt = 0;
opt = m_options.tqfind( *option_name );
opt = m_options.find( *option_name );
if ( opt && opt->isTargetOption() && ! opt->isEmpty() ) {
// kdDebug() << "Add Option: " << opt->toString() << endl;
TQString option = "";
@ -416,7 +416,7 @@ const TQDomDocument& IPTRule::getDOMTree( ) {
++it;
if ( type ) {
IPTRuleOption * opt = 0;
opt = m_options.tqfind( *type );
opt = m_options.find( *type );
if ( opt ) {
root.appendChild( opt->getDOMTree( ) );
// kdDebug() << "Got XML for Rule Option Type: " << *type << endl;
@ -499,12 +499,12 @@ void IPTRule::loadXML( TQDomNode root, TQStringList& errors ) {
TQDomDocument opt_xml;
opt_xml.appendChild( curr.cloneNode( true ) );
IPTRuleOption* opt = 0;
opt = m_options.tqfind( *( new TQString( type ) ) );
opt = m_options.find( *( new TQString( type ) ) );
if ( opt == 0 ) {
TQPtrList<TQString> list;
list.append( new TQString( "" ) );
addRuleOption( type, list );
opt = m_options.tqfind( *( new TQString( type ) ) );
opt = m_options.find( *( new TQString( type ) ) );
if ( ! opt ) {
kdDebug() << "ERROR: Couldn't create Option: " << type << endl;
return ;

@ -80,7 +80,7 @@ void IPTRuleOption::setOptionType( const TQString& type ) {
}
const TQString& IPTRuleOption::guiName() const {
return *m_dict_option_names->tqfind( m_option_type );
return *m_dict_option_names->find( m_option_type );
}
void IPTRuleOption::setTargetOption( bool is_tg_opt ) {
@ -214,7 +214,7 @@ const TQString& IPTRuleOption::toString() {
// kdDebug() << "const TQString& IPTRuleOption::toString()" << endl;
TQStringList * commandStrings;
commandStrings = m_dict_option_strings->tqfind( m_option_type );
commandStrings = m_dict_option_strings->find( m_option_type );
TQString s = "";
TQTextStream str( &s, IO_WriteOnly );
TQString ws = " ";
@ -226,7 +226,7 @@ const TQString& IPTRuleOption::toString() {
for ( uint i = 0; i < commandStrings->count(); i++ ) {
TQString command = *commandStrings->at( i );
TQString val = m_values[ i ];
TQStringList* guiStrings = m_dict_gui_strings->tqfind( m_option_type );
TQStringList* guiStrings = m_dict_gui_strings->find( m_option_type );
TQString guiName = *guiStrings->at( i );
if (! val.isNull() &&
@ -289,7 +289,7 @@ void IPTRuleOption::readRuleOptionDefinition( const TQDomDocument& doc ) {
kdDebug() << "+ Testing Key: " << name << endl;
TQStringList* list;
list = m_dict_option_strings->tqfind( name );
list = m_dict_option_strings->find( name );
if ( list ) {
for ( uint i = 0; i < list->count(); i ++ ) {
TQString s = *list->at( i );

@ -49,7 +49,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
// bool isFTQHN = checkFTQHN( str_input );
bool isNETWORK = checkNetWork( str_input );
if ( !isIP && !isNETWORK ) {
const TQString msg = *m_msg_dict.tqfind( "IP/NETWORK/FTQHN" );
const TQString msg = *m_msg_dict.find( "IP/NETWORK/FTQHN" );
err->setErrMsg( msg );
err->setErrType( KMFError::HINT );
return;
@ -64,7 +64,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "PORT" ) {
bool isPORT = checkPORT( str_input );
if ( !isPORT ) {
const TQString msg = *m_msg_dict.tqfind( "PORT" );
const TQString msg = *m_msg_dict.find( "PORT" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -79,7 +79,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "MULTIPORT" ) {
bool isMULTIPORT = checkMULTIPORT( str_input );
if ( !isMULTIPORT ) {
const TQString msg = *m_msg_dict.tqfind( "MULTIPORT" );
const TQString msg = *m_msg_dict.find( "MULTIPORT" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -95,7 +95,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
bool isPORT = checkPORT( str_input );
bool isPORTRANGE = checkPORTRANGE( str_input );
if ( !isPORT && !isPORTRANGE ) {
const TQString msg = *m_msg_dict.tqfind( "PORT" );
const TQString msg = *m_msg_dict.find( "PORT" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -110,7 +110,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "FTQHN" ) {
bool isFTQHN = checkFTQHN( str_input );
if ( !isFTQHN ) {
const TQString msg = *m_msg_dict.tqfind( "FTQHN" );
const TQString msg = *m_msg_dict.find( "FTQHN" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -125,7 +125,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "IP" ) {
bool isIP = checkIP( str_input );
if ( !isIP ) {
const TQString msg = *m_msg_dict.tqfind( "IP" );
const TQString msg = *m_msg_dict.find( "IP" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -141,7 +141,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "CHAINNAME" ) {
bool isValid = checkChainName( str_input );
if ( !isValid ) {
const TQString msg = *m_msg_dict.tqfind( "CHAINNAME" );
const TQString msg = *m_msg_dict.find( "CHAINNAME" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -156,7 +156,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "RULENAME" ) {
bool isValid = checkRuleName( str_input );
if ( !isValid ) {
const TQString msg = *m_msg_dict.tqfind( "RULENAME" );
const TQString msg = *m_msg_dict.find( "RULENAME" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -171,7 +171,7 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
if ( inp_type == "MAC" ) {
bool isValid = checkMAC( str_input );
if ( !isValid ) {
const TQString msg = *m_msg_dict.tqfind( "MAC" );
const TQString msg = *m_msg_dict.find( "MAC" );
err->setErrMsg( msg );
err->setErrType( KMFError::NORMAL );
return;
@ -192,12 +192,12 @@ void KMFCheckInput::checkInput( const TQString& inp, const TQString& inp_type, K
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.tqcontains( exp ) ) {
if ( inp.contains( exp ) ) {
int pos;
TQString str_num;
bool valid = true;
while ( !inp.isEmpty() ) {
pos = inp.tqfind( "." );
pos = inp.find( "." );
if ( pos > -1 ) {
str_num = inp.left( pos );
// kdDebug() << "IP Num Part: " << str_num << endl;
@ -229,7 +229,7 @@ bool KMFCheckInput::checkIP( TQString inp ) {
bool KMFCheckInput::checkNetMask ( TQString inp ) {
TQRegExp exp( "^[0-9]{1,2}$" );
// kdDebug() << "RegEx isValid: " << exp.isValid() << endl;
if ( inp.tqcontains( exp ) ) {
if ( inp.contains( exp ) ) {
int val = inp.toInt();
if ( val < 0 || val > 24 ) {
kdDebug() << "Mask must not be > 24" << endl;
@ -245,7 +245,7 @@ bool KMFCheckInput::checkNetMask ( TQString inp ) {
bool KMFCheckInput::checkPORT ( TQString inp ) {
TQRegExp exp( "^[0-9]{1,5}$" );
// kdDebug() << "RegEx isValid: " << exp.isValid() << endl;
if ( inp.tqcontains( exp ) ) {
if ( inp.contains( exp ) ) {
int val = inp.toInt();
if ( val < 0 || val > 65535 ) {
kdDebug() << "Port must not be > 65535" << endl;
@ -262,7 +262,7 @@ bool KMFCheckInput::checkMULTIPORT ( TQString inp ) {
TQString tmp = inp;
while ( !tmp.isEmpty() ) {
TQString port = "";
int pos = tmp.tqfind( "," );
int pos = tmp.find( "," );
if ( pos == -1 ) {
port = tmp;
port = port.stripWhiteSpace();
@ -288,7 +288,7 @@ bool KMFCheckInput::checkPORTRANGE ( TQString inp ) {
bool valid_1 = false;
bool valid_2 = false;
kdDebug() << "Checking for PORTRANGE: " << endl;
int delimiter = inp.tqfind( ":" );
int delimiter = inp.find( ":" );
if ( delimiter == -1 ) {
kdDebug() << "This is no port range" << endl;
return false;
@ -310,7 +310,7 @@ bool KMFCheckInput::checkNetWork ( TQString inp ) {
bool valid_address = false;
bool valid_tqmask = false;
kdDebug() << "Checking for NETWORK: " << endl;
int delimiter = inp.tqfind( "/" );
int delimiter = inp.find( "/" );
if ( delimiter == -1 ) {
kdDebug() << "This is no network" << endl;
return false;
@ -345,7 +345,7 @@ bool KMFCheckInput::checkFTQHN( TQString inp ) {
bool valid = TRUE;
// TQRegExp exp( "^(\\w{1,256})\\.([a-z]{2,6})$", false );
TQRegExp exp( "^[0-9a-zA-Z_-\\.]{3,256}$", false );
if ( !inp.tqcontains( exp ) )
if ( !inp.contains( exp ) )
valid = false;
return valid;
}
@ -353,7 +353,7 @@ bool KMFCheckInput::checkFTQHN( TQString inp ) {
bool KMFCheckInput::checkMAC( TQString inp ) {
bool valid = TRUE;
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 ) )
if ( !inp.contains( exp ) )
valid = false;
return valid;
}
@ -361,7 +361,7 @@ bool KMFCheckInput::checkMAC( TQString inp ) {
bool KMFCheckInput::checkChainName( TQString inp ) {
bool valid = TRUE;
TQRegExp exp( "^[a-zA-Z0-9_]{1,29}$", false );
if ( !inp.tqcontains( exp ) )
if ( !inp.contains( exp ) )
valid = false;
return valid;
}
@ -369,7 +369,7 @@ bool KMFCheckInput::checkChainName( TQString inp ) {
bool KMFCheckInput::checkRuleName( TQString inp ) {
bool valid = TRUE;
TQRegExp exp( "^[a-zA-Z0-9_-]{1,20}$", false );
if ( !inp.tqcontains( exp ) )
if ( !inp.contains( exp ) )
valid = false;
return valid;
}

@ -36,9 +36,9 @@ KMFError* KMFError::parseErrors( TQStringList& errors ) {
TQString s = *it;
kdDebug() << "Parsing Error: " << s << endl;
msg += s;
if ( s.tqcontains( i18n("WARNING: ") ) != 0 && err->errType() == KMFError::OK ) {
if ( s.contains( i18n("WARNING: ") ) != 0 && err->errType() == KMFError::OK ) {
err->setErrType( KMFError::HINT );
} else if ( s.tqcontains( i18n("ERROR: ") ) != 0 ) {
} else if ( s.contains( i18n("ERROR: ") ) != 0 ) {
err->setErrType( KMFError::FATAL );
}
++it;

@ -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 tqcontains\n"
m_zone_incoming->setDescription( i18n( "This is the global zone that contains\n"
"all valid IP addresses." ) );
m_zone_outgoing->setDescription( i18n( "This is the global zone that tqcontains\n"
m_zone_outgoing->setDescription( i18n( "This is the global zone that contains\n"
"all valid IP addresses." ) );
m_zone_trusted->setDescription( i18n( "Traffic coming from and going to hosts\n"
"will be accepted always.\n"

@ -192,7 +192,7 @@ const TQString& KMFNetZone::generateName( const TQString& nam ) {
// kdDebug() << "TQString& KMFNetZone::generateName(" << nam << ")" << endl;
if ( ! isRootZone() ) {
TQString s = "";
s.setNum( zone()->zones().tqfind( this ) );
s.setNum( zone()->zones().find( this ) );
return *(new TQString( zone()->generateName( "_zone_" + s + "_" + nam )));
} else {
TQString s = "";

@ -66,7 +66,7 @@ KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* tqpare
return 0;
} else {
err->setErrType( KMFError::FATAL );
err->setErrMsg( i18n( "Could not tqfind %1 in the library search path." ).tqarg( libName ) );
err->setErrMsg( i18n( "Could not find %1 in the library search path." ).tqarg( libName ) );
return 0;
}
err->setErrType( KMFError::FATAL );

@ -118,14 +118,14 @@ const TQString& KMFProtocol::udpPortsList() {
void KMFProtocol::addPort( const TQString& port, int protocol ) {
// kdDebug() << "void KMFProtocol::addPort( const TQString& )" << endl;
if ( protocol == UDP && udpPorts().tqcontains( port.toInt() ) == 0 ) {
if ( protocol == UDP && udpPorts().contains( port.toInt() ) == 0 ) {
kdDebug() << " + + + Register UDP Port:" << port << endl;
udpPorts().append( port.toInt() );
qHeapSort( udpPorts() );
changed();
return;
}
if ( protocol == TCP && tcpPorts().tqcontains( port.toInt() ) == 0 ) {
if ( protocol == TCP && tcpPorts().contains( port.toInt() ) == 0 ) {
kdDebug() << " + + + Register TCP Port:" << port << endl;
tcpPorts().append( port.toInt() );
qHeapSort( tcpPorts() );
@ -138,14 +138,14 @@ void KMFProtocol::addPort( const TQString& port, int protocol ) {
void KMFProtocol::delPort( const TQString& port, int protocol ) {
kdDebug() << "void KMFProtocol::delPort( const TQString& )" << endl;
if ( protocol == UDP && udpPorts().tqcontains( port.toInt() ) > 0 ) {
if ( protocol == UDP && udpPorts().contains( port.toInt() ) > 0 ) {
kdDebug() << "KMFProtocol: " << name() << " Unregister UDP Port:" << port << endl;
udpPorts().remove( udpPorts().tqfind( port.toInt() ) );
udpPorts().remove( udpPorts().find( port.toInt() ) );
qHeapSort( udpPorts() );
changed();
} else if ( protocol == TCP && tcpPorts().tqcontains( port.toInt() ) > 0 ) {
} else if ( protocol == TCP && tcpPorts().contains( port.toInt() ) > 0 ) {
kdDebug() << "KMFProtocol: " << name() << " Unregister TCP Port:" << port << endl;
tcpPorts().remove( tcpPorts().tqfind( port.toInt() ) );
tcpPorts().remove( tcpPorts().find( port.toInt() ) );
qHeapSort( tcpPorts() );
changed();
} else {
@ -171,7 +171,7 @@ bool KMFProtocol::isEquivalent( KMFProtocol *other ){
TQValueList<int>::iterator itTcp;
for( itTcp = tcpPorts().begin(); itTcp != tcpPorts().end(); ++itTcp ) {
if ( other->tcpPorts().tqcontains( *itTcp ) == 0 ) {
if ( other->tcpPorts().contains( *itTcp ) == 0 ) {
kdDebug() << "TCP port " << *itTcp << " not found in other protocol." << endl;
return false;
}
@ -183,7 +183,7 @@ bool KMFProtocol::isEquivalent( KMFProtocol *other ){
}
TQValueList<int>::iterator itUdp;
for( itUdp = udpPorts().begin(); itUdp != udpPorts().end(); ++itUdp ) {
if ( other->udpPorts().tqcontains( *itUdp ) == 0 ) {
if ( other->udpPorts().contains( *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().tqcontains( newPort ) > 0 ) {
if ( tcpPorts().contains( newPort ) > 0 ) {
kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl;
return false;
}
int index = tcpPorts().tqfindIndex( oldPort );
int index = tcpPorts().findIndex( 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.tqcontains( newPort ) > 0 ) {
if ( m_udpPorts.contains( newPort ) > 0 ) {
kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl;
return false;
}
int index = udpPorts().tqfindIndex( oldPort );
int index = udpPorts().findIndex( oldPort );
kdDebug() << "Found Port at: " << index << endl;
if ( index == -1 ) {
kdDebug() << "WARNING: port entry: " << oldPort << "not found in protocol: " << name() << endl;

@ -240,7 +240,7 @@ void KMFProtocolUsage::loadXML( TQDomNode root, TQStringList& errors ) {
if ( root.toElement().hasAttribute( XML::Limit_Attribute ) ) {
limit = root.toElement().attribute( XML::Limit_Attribute );
int pos = limit.tqfind('/');
int pos = limit.find('/');
TQString limi = limit.left( pos );
TQString limit_interval = limit.right( limit.length() - pos -1 );

@ -149,15 +149,15 @@ void KProcessWrapper::slotStartRemoteJob( const TQString& jobName, const TQStrin
kdDebug() << "Got Output:" << ret << endl;
const TQString& resultVal = ret.right( ret.tqfind( "\n###RESULT:" ) + 10 );
const TQString& resultVal = ret.right( ret.find( "\n###RESULT:" ) + 10 );
kdDebug() << "resultVal: " << resultVal << endl;
m_status = 0;
if ( ret.tqcontains( "###RESULT: 0" ) == 0 ) {
if ( ret.contains( "###RESULT: 0" ) == 0 ) {
m_status = 1;
}
const TQString& retNew = ret.left( ret.tqfind( "\n###RESULT:" ) );
const TQString& retNew = ret.left( ret.find( "\n###RESULT:" ) );
kdDebug() << "Real Output: " << retNew << endl;
@ -196,7 +196,7 @@ void KProcessWrapper::slotReceivedOutput( KProcess *, char *buffer, int buflen )
// int pos;
// while ( ( pos = m_stdoutbuf->tqfind( '\n' ) ) != -1 ) {
// while ( ( pos = m_stdoutbuf->find( '\n' ) ) != -1 ) {
// TQString line = m_stdoutbuf->left( pos );
// m_allOut.append( *m_stdoutbuf );
// m_stdOut.append( *m_stdoutbuf );
@ -220,7 +220,7 @@ void KProcessWrapper::slotReceivedError( KProcess *, char *buffer, int buflen )
*m_stderrbuf = "";
/* int pos;
while ( ( pos = m_stderrbuf->tqfind( '\n' ) ) != -1 ) {
while ( ( pos = m_stderrbuf->find( '\n' ) ) != -1 ) {
TQString line = m_stderrbuf->left( pos );
m_allOut.append( line );
m_stdErr.append( line );

@ -38,7 +38,7 @@ namespace KMF {
TQMap<TQUuid, NetfilterObject*>* NetfilterObject::m_uuid_dict = new TQMap<TQUuid, NetfilterObject*>;
NetfilterObject* NetfilterObject::findObject( const TQUuid& uuid ) {
TQMap<TQUuid, NetfilterObject*>::iterator it = getUuidObjectDict()->tqfind( uuid );
TQMap<TQUuid, NetfilterObject*>::iterator it = getUuidObjectDict()->find( uuid );
if ( it != getUuidObjectDict()->end() ) {
return (*it);
}
@ -75,7 +75,7 @@ NetfilterObject::NetfilterObject( NetfilterObject *tqparent, const char* name )
NetfilterObject::~NetfilterObject() {
m_uuid_dict->remove( m_uuid );
if ( m_uuid_dict->tqcontains( m_uuid ) ) {
if ( m_uuid_dict->contains( m_uuid ) ) {
kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl;
}
@ -88,13 +88,13 @@ void NetfilterObject::setUuid( const TQUuid& newUuid ) {
TQUuid toSetUuid = newUuid;
while ( m_uuid != toSetUuid && m_uuid_dict->tqcontains( toSetUuid ) ) {
while ( m_uuid != toSetUuid && m_uuid_dict->contains( toSetUuid ) ) {
kdDebug() << "NetfilterObject::setUuid( " << toSetUuid << ") new uuid allready in use! Generating new!" << endl;
toSetUuid = TQUuid::createUuid();
}
m_uuid_dict->remove( m_uuid );
if ( m_uuid_dict->tqcontains( m_uuid ) ) {
if ( m_uuid_dict->contains( m_uuid ) ) {
kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl;
}

@ -778,7 +778,7 @@ TQStringList lines;
TQString corrData = data;
for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
(*it).tqreplace( "%data%", corrData );
(*it).replace( "%data%", corrData );
}
TQFile target_file( target_file_path );
@ -828,10 +828,10 @@ void KMFIPTInstaller::parseFileHeaders( const TQString& source_file_path, const
}
for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
(*it).tqreplace( "%coypright%", copyright_string );
(*it).tqreplace( "%version%", version );
(*it).tqreplace( "%maintainer%", maintainer );
(*it).tqreplace( "%license%", license );
(*it).replace( "%coypright%", copyright_string );
(*it).replace( "%version%", version );
(*it).replace( "%maintainer%", maintainer );
(*it).replace( "%license%", license );
}
TQFile target_file( target_file_path );
@ -1067,7 +1067,7 @@ void KMFIPTInstaller::generateInstallerPackage( KMFTarget* target, const KURL& p
if ( fPackage.open( IO_ReadOnly ) ) {
TQByteArray b = fPackage.readAll();
TQString rawData = KCodecs::base64Encode( b, false );
rawData = rawData.tqreplace( '\n', ' ' );
rawData = rawData.replace( '\n', ' ' );
TQString data;
int len = rawData.length();
int currPos = 0;

@ -733,7 +733,7 @@ void KMFPFInstaller::cmdUninstallFW() {
//
// TQString corrData = data;
// for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
// (*it).tqreplace( "%data%", corrData );
// (*it).replace( "%data%", corrData );
// }
//
// TQFile target_file( target_file_path );
@ -783,10 +783,10 @@ void KMFPFInstaller::cmdUninstallFW() {
// }
//
// for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
// (*it).tqreplace( "%coypright%", copyright_string );
// (*it).tqreplace( "%version%", version );
// (*it).tqreplace( "%maintainer%", maintainer );
// (*it).tqreplace( "%license%", license );
// (*it).replace( "%coypright%", copyright_string );
// (*it).replace( "%version%", version );
// (*it).replace( "%maintainer%", maintainer );
// (*it).replace( "%license%", license );
// }
//
// TQFile target_file( target_file_path );
@ -1026,7 +1026,7 @@ void KMFPFInstaller::generateInstallerPackage( KMFTarget* target, const KURL& pa
// if ( fPackage.open( IO_ReadOnly ) ) {
// TQByteArray b = fPackage.readAll();
// TQString rawData = KCodecs::base64Encode( b, false );
// rawData = rawData.tqreplace( '\n', ' ' );
// rawData = rawData.replace( '\n', ' ' );
// TQString data;
// int len = rawData.length();
// int currPos = 0;

@ -144,7 +144,7 @@ void KMFChainEdit::loadChain( IPTChain* chain ) {
}
if ( !log_limit.isEmpty() && log_limit != XML::Undefined_Value ) {
c_log_limit->setChecked( true );
int i = log_limit.tqfind( "/" );
int i = log_limit.find( "/" );
TQString str_num = log_limit.left( i );
TQString interval = log_limit.remove( 0, i + 1 );
if ( interval == "second" ) {

@ -242,10 +242,10 @@ void KMFListView::setupTableView( IPTable* table ) {
TQString str_obj_id = "";
str_obj_id = chain->uuid().toString();
if ( m_existed_chains.tqfindIndex ( chain->name() + "|" + str_obj_id ) == -1 )
if ( m_existed_chains.findIndex ( chain->name() + "|" + str_obj_id ) == -1 )
m_existed_chains.append ( chain->name() + "|" + str_obj_id );
if ( ! m_dict_existed_rules.tqfind( chain->uuid() ) ) {
if ( ! m_dict_existed_rules.find( chain->uuid() ) ) {
m_dict_existed_rules.insert( chain->uuid().toString(), new TQStringList );
}
setupChainView( chain, item );
@ -254,7 +254,7 @@ void KMFListView::setupTableView( IPTable* table ) {
if ( ! m_existed_chains.isEmpty() ) {
for ( TQStringList::Iterator it = m_existed_chains.begin(); it != m_existed_chains.end(); ++it ) {
TQString existed_chain_name_id = *it;
int delimiter = existed_chain_name_id.tqfind( "|" );
int delimiter = existed_chain_name_id.find( "|" );
TQString existed_chain_name = existed_chain_name_id.left( delimiter );
TQString existed_chain_id_str = existed_chain_name_id.right( existed_chain_name_id.length() - delimiter - 1 );
/* TQUuid existed_obj_id = -1;
@ -555,7 +555,7 @@ void KMFListView::setupChainView( IPTChain* chain, KMFListViewItem* tqparent ) {
i_chain_allrules->setText( 2, num_rules );
TQPtrList<IPTRule> used_rules;
TQStringList *existed_rules = m_dict_existed_rules.tqfind( chain->uuid() );
TQStringList *existed_rules = m_dict_existed_rules.find( chain->uuid() );
if ( existed_rules ) {
if ( !tmp_ruleset.isEmpty() ) {
@ -563,7 +563,7 @@ void KMFListView::setupChainView( IPTChain* chain, KMFListViewItem* tqparent ) {
for ( curr_rule = tmp_ruleset.last(); curr_rule; curr_rule = tmp_ruleset.prev() ) {
// kdDebug() << "Entering: for ( curr_rule = tmp_ruleset.last(); curr_rule; curr_rule = tmp_ruleset.prev() )" << endl;
used_rules.append( curr_rule );
if ( existed_rules->tqfindIndex ( curr_rule->name() + "|" + curr_rule->uuid().toString() ) == -1 ) {
if ( existed_rules->findIndex ( curr_rule->name() + "|" + curr_rule->uuid().toString() ) == -1 ) {
existed_rules->append( curr_rule->name() + "|" + curr_rule->uuid().toString() );
}
setupRuleView( curr_rule , i_chain_allrules );
@ -572,7 +572,7 @@ void KMFListView::setupChainView( IPTChain* chain, KMFListViewItem* tqparent ) {
if ( ! existed_rules->isEmpty() )
for ( TQStringList::Iterator it = existed_rules->begin(); it != existed_rules->end(); ++it ) {
TQString existed_rule_name_id = *it;
int delimiter = existed_rule_name_id.tqfind( "|" );
int delimiter = existed_rule_name_id.find( "|" );
TQString existed_rule_name = existed_rule_name_id.left( delimiter );
TQString existed_rule_id_str = existed_rule_name_id.right( existed_rule_name_id.length() - delimiter - 1 );
TQUuid existed_obj_id( existed_rule_id_str );
@ -889,7 +889,7 @@ void KMFListView::setupRuleOptionView( IPTRuleOption* option, KMFListViewItem* t
TQString type = option->getOptionType();
TQStringList values = option->getValues();
TQDict<TQStringList>* gui_string_dict = option->getGUIStringDict();
TQStringList* gui_strings = gui_string_dict->tqfind( type );
TQStringList* gui_strings = gui_string_dict->find( type );
TQString name = "";
KMFListViewItem * item = 0;
@ -997,7 +997,7 @@ KMFListViewItem* KMFListView::findKMFItem( const TQString & text, int column, co
if ( item->text( column ) == text && item->uuid() == obj_id )
return item;
} else {
if ( item->text( column ).tqcontains( text ) && item->uuid() == obj_id )
if ( item->text( column ).contains( text ) && item->uuid() == obj_id )
return item;
}
}
@ -1024,7 +1024,7 @@ KMFListViewItem* KMFListView::findKMFItem( const TQString & text, int column, co
if ( item->text( column ) == text && item->uuid() == obj_id )
return item;
} else {
if ( item->text( column ).tqcontains( text ) && item->uuid() == obj_id )
if ( item->text( column ).contains( text ) && item->uuid() == obj_id )
return item;
}
}

@ -368,8 +368,8 @@ TQString KMFListViewItem::key( int column, bool ascending ) const {
return "4444";
} else if ( text(0) == i18n("Cmd:") ) {
return "9999";
} else if (text(0).tqcontains( i18n("Chain (User-Defined):") ) ) {
int index = m_chain->table()->chains().tqfind( m_chain );
} else if (text(0).contains( i18n("Chain (User-Defined):") ) ) {
int index = m_chain->table()->chains().find( m_chain );
TQString ret = "";
return ret.setNum( 5555 + index );
}

@ -96,12 +96,12 @@ void KMFMultiPortWidget::loadPortString( TQString& str ) {
return ;
lb_ports->clear();
int pos = -1;
pos = str.tqfind( "," );
pos = str.find( "," );
while ( pos > -1 ) {
TQString port = str.left( pos );
lb_ports->insertItem( port );
str = str.right( str.length() - pos - 1 );
pos = str.tqfind( "," );
pos = str.find( "," );
}
if ( !str.isEmpty() ) {
lb_ports->insertItem( str );

@ -236,7 +236,7 @@ void KMFPortWidget::loadPortString( TQString& port ) {
}
int pos = -1;
pos = port.tqfind( ":" );
pos = port.find( ":" );
if ( pos > -1 ) {
c_port_name->setChecked( false );
c_portrange->setChecked( true );

@ -128,7 +128,7 @@ void KMFProcOut::slotReceivedOutput( KProcess *, char *buffer, int buflen ) {
*stdoutbuf += TQString::tqfromLatin1( buffer, buflen );
int pos;
while ( ( pos = stdoutbuf->tqfind( '\n' ) ) != -1 ) {
while ( ( pos = stdoutbuf->find( '\n' ) ) != -1 ) {
TQString line = stdoutbuf->left( pos );
insertStdoutLine( line );
stdoutbuf->remove
@ -145,7 +145,7 @@ void KMFProcOut::slotReceivedError( KProcess *, char *buffer, int buflen ) {
*stderrbuf += TQString::tqfromLatin1( buffer, buflen );
int pos;
while ( ( pos = stderrbuf->tqfind( '\n' ) ) != -1 ) {
while ( ( pos = stderrbuf->find( '\n' ) ) != -1 ) {
TQString line = stderrbuf->left( pos );
insertStderrLine( line );
stderrbuf->remove
@ -196,7 +196,7 @@ void KMFProcOut::setText( const TQString& str, const TQString& commandName ) {
/*
TQString *text = new TQString( str );
int pos;
while ( ( pos = text->tqfind( '\n' ) ) != -1 && !text->isEmpty() ) {
while ( ( pos = text->find( '\n' ) ) != -1 && !text->isEmpty() ) {
TQString line = text->left( pos );
insertStdoutLine( line );
text->remove( 0, pos + 1 );

@ -67,7 +67,7 @@ void KMFProtocolListView::setHost( KMFNetHost* host ) {
/* TQPtrListIterator<KMFProtocol> it( *KMFProtocol::protocolLibrary() );
while ( it.current() ) {*/
KMFProtocol * prot = *it;
TQListViewItem *qitem = m_lv_protocols->tqfindItem( prot->name(), 0 );
TQListViewItem *qitem = m_lv_protocols->findItem( prot->name(), 0 );
if ( ! qitem ) {
kdDebug() << "No item found for protocol: " << prot->name() << endl;
}
@ -97,7 +97,7 @@ void KMFProtocolListView::setZone( KMFNetZone* zone ) {
TQValueList<KMFProtocol*>::iterator it;
for( it = allProts.begin(); it != allProts.end(); ++it ) {
KMFProtocol * prot = *it;
TQListViewItem *qitem = m_lv_protocols->tqfindItem( prot->name(), 0 );
TQListViewItem *qitem = m_lv_protocols->findItem( prot->name(), 0 );
if ( ! qitem ) {
kdDebug() << "No item found for protocol: " << prot->name() << endl;
}
@ -158,7 +158,7 @@ void KMFProtocolListView::loadProtocols() {
TQString cat = prot->category()->name();
TQListViewItem *parentItem = m_lv_protocols->tqfindItem( cat, 0 );
TQListViewItem *parentItem = m_lv_protocols->findItem( cat, 0 );
if ( ! parentItem ) {
KMFListViewItem *newParentItem = new KMFListViewItem( m_lv_protocols, 0, prot->category() );

@ -242,7 +242,7 @@ KListViewItem* KMFTransactionLog::setupListItem( KMFTransaction* trans, KListVie
// kdDebug() << "Search transaction: " << trans->uuid().toString() << endl;
TQListViewItem* found = 0;
found = list->tqfindItem ( trans->uuid().toString(), 1 );
found = list->findItem ( trans->uuid().toString(), 1 );
if ( found ) {
return (KListViewItem*) found;
}

@ -65,7 +65,7 @@ void KMFRuleEditorLimit::readRuleConfig() {
if ( limit != XML::Undefined_Value ) {
c_use_limit->setChecked( true );
c_limit->setChecked( true );
int i = limit.tqfind( "/" );
int i = limit.find( "/" );
TQString str_rate = limit.left( i );
kdDebug() << "Found Rate: " << str_rate << endl;
int rate = str_rate.toInt();

@ -120,7 +120,7 @@ void KMFRuleEditMac::loadRule( IPTRule * rule ) {
c_src_mac->setChecked( true );
while ( !line.isEmpty() ) {
int pos = -1;
pos = line.tqfind( ":" );
pos = line.find( ":" );
if ( pos < 0 ) {
part = line;
kdDebug() << "Found last digit: " << part << endl;

@ -104,16 +104,16 @@ void KMFRuleEditorTargetNat::loadRule( IPTRule *rule ) {
TQString ip2 = "";
TQString port1 = "";
TQString port2 = "";
if ( arg.tqcontains( ":" ) && has_port ) {
if ( arg.contains( ":" ) && has_port ) {
c_use_ports->setChecked( true );
int del = arg.tqfind( ':' );
int del = arg.find( ':' );
ips = arg.left( del );
kdDebug() << "IP arg: " << ips << endl;
ports = arg.right( arg.length() - del - 1 );
kdDebug() << "Port arg: " << ports << endl;
if ( ips.tqcontains( "-" ) ) {
if ( ips.contains( "-" ) ) {
c_ip_range->setChecked( true );
int delim = ips.tqfind( '-' );
int delim = ips.find( '-' );
ip1 = ips.left( delim );
kdDebug() << "IP arg1: " << ip1 << endl;
@ -126,10 +126,10 @@ void KMFRuleEditorTargetNat::loadRule( IPTRule *rule ) {
c_ip_range->setChecked( false );
t_ip1 ->setText( ips );
}
if ( ports.tqcontains( "-" ) ) {
if ( ports.contains( "-" ) ) {
c_use_port_range->setChecked( true );
int delim = ports.tqfind( '-' );
int delim = ports.find( '-' );
port1 = ports.left( delim );
kdDebug() << "Port arg1: " << port1 << endl;
;
@ -149,10 +149,10 @@ void KMFRuleEditorTargetNat::loadRule( IPTRule *rule ) {
int int_port1 = ports.toInt();
sb_port1 ->setValue( int_port1 );
}
} else if ( arg.tqcontains( "-" ) ) {
} else if ( arg.contains( "-" ) ) {
c_use_ports->setChecked( false );
c_ip_range->setChecked( true );
int delim = arg.tqfind( '-' );
int delim = arg.find( '-' );
ip1 = arg.left( delim );
kdDebug() << "IP arg1: " << ip1 << endl;
t_ip1 ->setText( ip1 );

@ -323,50 +323,50 @@ void KMFRuleEditorProtocol::loadRule( IPTRule* rule ) {
gb_tqmask->setEnabled( true );
gb_comp->setEnabled( true );
c_tcp_flags->setChecked( true );
int delim = flags.tqfind( " " );
int delim = flags.find( " " );
if ( flags.startsWith( "! " ) ) {
c_inv_flags->setChecked( true );
flags = flags.right( flags.length() - 2 );
}
delim = flags.tqfind( " " );
delim = flags.find( " " );
kdDebug() << "found Whitespace at " << delim << endl;
TQString mask_lst = flags.left( delim );
kdDebug() << "Flags for Mask: " << mask_lst << endl;
TQString comp_lst = flags.right( flags.length() - delim );
kdDebug() << "Flags for Comp: " << comp_lst << endl;
if ( mask_lst.tqcontains( "SYN" ) > 0 )
if ( mask_lst.contains( "SYN" ) > 0 )
c_syn_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "ACK" ) > 0 )
if ( mask_lst.contains( "ACK" ) > 0 )
c_ack_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "FIN" ) > 0 )
if ( mask_lst.contains( "FIN" ) > 0 )
c_fin_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "RST" ) > 0 )
if ( mask_lst.contains( "RST" ) > 0 )
c_rst_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "URG" ) > 0 )
if ( mask_lst.contains( "URG" ) > 0 )
c_urg_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "PSH" ) > 0 )
if ( mask_lst.contains( "PSH" ) > 0 )
c_psh_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "NONE" ) > 0 )
if ( mask_lst.contains( "NONE" ) > 0 )
c_none_tqmask->setChecked( true );
if ( mask_lst.tqcontains( "ALL" ) > 0 )
if ( mask_lst.contains( "ALL" ) > 0 )
c_all_tqmask->setChecked( true );
if ( comp_lst.tqcontains( "SYN" ) > 0 )
if ( comp_lst.contains( "SYN" ) > 0 )
c_syn_comp->setChecked( true );
if ( comp_lst.tqcontains( "ACK" ) > 0 )
if ( comp_lst.contains( "ACK" ) > 0 )
c_ack_comp->setChecked( true );
if ( comp_lst.tqcontains( "FIN" ) > 0 )
if ( comp_lst.contains( "FIN" ) > 0 )
c_fin_comp->setChecked( true );
if ( comp_lst.tqcontains( "RST" ) > 0 )
if ( comp_lst.contains( "RST" ) > 0 )
c_rst_comp->setChecked( true );
if ( comp_lst.tqcontains( "URG" ) > 0 )
if ( comp_lst.contains( "URG" ) > 0 )
c_urg_comp->setChecked( true );
if ( comp_lst.tqcontains( "PSH" ) > 0 )
if ( comp_lst.contains( "PSH" ) > 0 )
c_psh_comp->setChecked( true );
if ( comp_lst.tqcontains( "NONE" ) > 0 )
if ( comp_lst.contains( "NONE" ) > 0 )
c_none_comp->setChecked( true );
if ( comp_lst.tqcontains( "ALL" ) > 0 )
if ( comp_lst.contains( "ALL" ) > 0 )
c_all_comp->setChecked( true );
}
if ( !tcp_option.isEmpty() && tcp_option != XML::Undefined_Value && tcp_option != XML::BoolOff_Value ) {

@ -103,13 +103,13 @@ void KMFRuleEditorState::readRuleConfig() {
val = *vals.at(1);
if ( val != XML::Undefined_Value ) {
c_use_conntrack->setChecked( true );
if ( val.tqcontains( "NEW" ) )
if ( val.contains( "NEW" ) )
c_new->setChecked( true );
if ( val.tqcontains( "RELATED" ) )
if ( val.contains( "RELATED" ) )
c_related->setChecked( true );
if ( val.tqcontains( "ESTABLISHED" ) )
if ( val.contains( "ESTABLISHED" ) )
c_established->setChecked( true );
if ( val.tqcontains( "INVALID" ) )
if ( val.contains( "INVALID" ) )
c_invalid->setChecked( true );
}
}

Loading…
Cancel
Save