diff options
Diffstat (limited to 'kppp/ruleset.cpp')
-rw-r--r-- | kppp/ruleset.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/kppp/ruleset.cpp b/kppp/ruleset.cpp index 6c2131a6..ef9d9517 100644 --- a/kppp/ruleset.cpp +++ b/kppp/ruleset.cpp @@ -127,7 +127,7 @@ int RuleSet::load(const TQString &filename) { } while(!f.atEnd() && backslashed); // strip whitespace - line = line.tqreplace(TQRegExp("[ \t\r]"), ""); + line = line.replace(TQRegExp("[ \t\r]"), ""); // skip comment lines if((line.left(1) == "#") || line.isEmpty()) continue; @@ -183,7 +183,7 @@ void RuleSet::addRule(RULE r) { } bool RuleSet::parseEntry(RULE &ret, TQString s, int year) { - if(s.tqcontains(TQRegExp("^[0-9]+/[0-9]+$"))) { + if(s.contains(TQRegExp("^[0-9]+/[0-9]+$"))) { int d, m; sscanf(s.ascii(), "%d/%d", &m, &d); ret.type = 1; @@ -192,7 +192,7 @@ bool RuleSet::parseEntry(RULE &ret, TQString s, int year) { return TRUE; } - if(s.tqcontains(TQRegExp("^[0-9]+\\.[0-9]+$"))) { + if(s.contains(TQRegExp("^[0-9]+\\.[0-9]+$"))) { int d, m; sscanf(s.ascii(), "%d.%d", &d, &m); ret.type = 1; @@ -245,7 +245,7 @@ bool RuleSet::parseEntries(TQString s, int year, s = "monday..sunday"; while(s.length()) { - int pos = s.tqfind(','); + int pos = s.find(','); TQString token; if(pos == -1) { token = s; @@ -258,9 +258,9 @@ bool RuleSet::parseEntries(TQString s, int year, // we've a token, now check if it defines a // range RULE r; - if(token.tqcontains("..")) { + if(token.contains("..")) { TQString left, right; - left = token.left(token.tqfind("..")); + left = token.left(token.find("..")); right = token.right(token.length()-2-left.length()); RULE lr, rr; if(parseEntry(lr, left, year) && parseEntry(rr, right, year)) { @@ -317,13 +317,13 @@ bool RuleSet::parseRate(double &costs, double &len, double &after, TQString s) { bool RuleSet::parseLine(const TQString &s) { - // ### use TQRegExp::cap() instead of mid() and tqfind() + // ### use TQRegExp::cap() instead of mid() and find() // for our french friends -- Bernd - if(s.tqcontains(TQRegExp("flat_init_costs=\\(.*"))) { + if(s.contains(TQRegExp("flat_init_costs=\\(.*"))) { // parse the time fields - TQString token = s.mid(s.tqfind("flat_init_costs=(") + 17, - s.tqfind(")")-s.tqfind("flat_init_costs=(") - 17); + TQString token = s.mid(s.find("flat_init_costs=(") + 17, + s.find(")")-s.find("flat_init_costs=(") - 17); // printf("TOKEN=%s\n",token.ascii()); double after; @@ -342,17 +342,17 @@ bool RuleSet::parseLine(const TQString &s) { } - if(s.tqcontains(TQRegExp("on\\(.*\\)between\\(.*\\)use\\(.*\\)"))) { + if(s.contains(TQRegExp("on\\(.*\\)between\\(.*\\)use\\(.*\\)"))) { // parse the time fields - TQString token = s.mid(s.tqfind("between(") + 8, - s.tqfind(")use")-s.tqfind("between(") - 8); + TQString token = s.mid(s.find("between(") + 8, + s.find(")use")-s.find("between(") - 8); TQTime t1, t2; if(!parseTime(t1, t2, token)) return FALSE; // parse the rate fields - token = s.mid(s.tqfind("use(") + 4, - s.tqfindRev(")")-s.tqfind("use(") - 4); + token = s.mid(s.find("use(") + 4, + s.findRev(")")-s.find("use(") - 4); double costs; double len; double after; @@ -360,8 +360,8 @@ bool RuleSet::parseLine(const TQString &s) { return FALSE; // parse the days - token = s.mid(s.tqfind("on(") + 3, - s.tqfind(")betw")-s.tqfind("on(") - 3); + token = s.mid(s.find("on(") + 3, + s.find(")betw")-s.find("on(") - 3); if(!parseEntries(token, TQDate::tqcurrentDate().year(), t1, t2, costs, len, after)) return FALSE; @@ -370,14 +370,14 @@ bool RuleSet::parseLine(const TQString &s) { } // check for the name - if(s.tqcontains(TQRegExp("name=.*"))) { + if(s.contains(TQRegExp("name=.*"))) { _name = s.right(s.length()-5); return !_name.isEmpty(); } // check default entry - if(s.tqcontains(TQRegExp("default=\\(.*\\)"))) { + if(s.contains(TQRegExp("default=\\(.*\\)"))) { TQString token = s.mid(9, s.length() - 10); double after; if(parseRate(default_costs, default_len, after, token)) @@ -385,7 +385,7 @@ bool RuleSet::parseLine(const TQString &s) { } // check for "minimum costs" - if(s.tqcontains(TQRegExp("minimum_costs=.*"))) { + if(s.contains(TQRegExp("minimum_costs=.*"))) { TQString token = s.right(s.length() - strlen("minimum_costs=")); bool ok; _minimum_costs = token.toDouble(&ok); @@ -398,7 +398,7 @@ bool RuleSet::parseLine(const TQString &s) { return TRUE; } - if(s.tqcontains(TQRegExp("currency_digits=.*"))) { + if(s.contains(TQRegExp("currency_digits=.*"))) { TQString token = s.mid(16, s.length() - 16); bool ok; _currency_digits = token.toInt(&ok); @@ -406,11 +406,11 @@ bool RuleSet::parseLine(const TQString &s) { } // "currency_position" is deprecated so we'll simply ignore it - if(s.tqcontains(TQRegExp("currency_position=.*"))) + if(s.contains(TQRegExp("currency_position=.*"))) return TRUE; // check per connection fee - if(s.tqcontains(TQRegExp("per_connection="))) { + if(s.contains(TQRegExp("per_connection="))) { TQString token = s.mid(15, s.length()-15); bool ok; pcf = token.toDouble(&ok); |