summaryrefslogtreecommitdiffstats
path: root/kppp/ruleset.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kppp/ruleset.cpp
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kppp/ruleset.cpp')
-rw-r--r--kppp/ruleset.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kppp/ruleset.cpp b/kppp/ruleset.cpp
index 723d5f2b..6c2131a6 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.replace(TQRegExp("[ \t\r]"), "");
+ line = line.tqreplace(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.contains(TQRegExp("^[0-9]+/[0-9]+$"))) {
+ if(s.tqcontains(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.contains(TQRegExp("^[0-9]+\\.[0-9]+$"))) {
+ if(s.tqcontains(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.find(',');
+ int pos = s.tqfind(',');
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.contains("..")) {
+ if(token.tqcontains("..")) {
TQString left, right;
- left = token.left(token.find(".."));
+ left = token.left(token.tqfind(".."));
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 find()
+ // ### use TQRegExp::cap() instead of mid() and tqfind()
// for our french friends -- Bernd
- if(s.contains(TQRegExp("flat_init_costs=\\(.*"))) {
+ if(s.tqcontains(TQRegExp("flat_init_costs=\\(.*"))) {
// parse the time fields
- TQString token = s.mid(s.find("flat_init_costs=(") + 17,
- s.find(")")-s.find("flat_init_costs=(") - 17);
+ TQString token = s.mid(s.tqfind("flat_init_costs=(") + 17,
+ s.tqfind(")")-s.tqfind("flat_init_costs=(") - 17);
// printf("TOKEN=%s\n",token.ascii());
double after;
@@ -342,17 +342,17 @@ bool RuleSet::parseLine(const TQString &s) {
}
- if(s.contains(TQRegExp("on\\(.*\\)between\\(.*\\)use\\(.*\\)"))) {
+ if(s.tqcontains(TQRegExp("on\\(.*\\)between\\(.*\\)use\\(.*\\)"))) {
// parse the time fields
- TQString token = s.mid(s.find("between(") + 8,
- s.find(")use")-s.find("between(") - 8);
+ TQString token = s.mid(s.tqfind("between(") + 8,
+ s.tqfind(")use")-s.tqfind("between(") - 8);
TQTime t1, t2;
if(!parseTime(t1, t2, token))
return FALSE;
// parse the rate fields
- token = s.mid(s.find("use(") + 4,
- s.findRev(")")-s.find("use(") - 4);
+ token = s.mid(s.tqfind("use(") + 4,
+ s.tqfindRev(")")-s.tqfind("use(") - 4);
double costs;
double len;
double after;
@@ -360,9 +360,9 @@ bool RuleSet::parseLine(const TQString &s) {
return FALSE;
// parse the days
- token = s.mid(s.find("on(") + 3,
- s.find(")betw")-s.find("on(") - 3);
- if(!parseEntries(token, TQDate::currentDate().year(),
+ token = s.mid(s.tqfind("on(") + 3,
+ s.tqfind(")betw")-s.tqfind("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.contains(TQRegExp("name=.*"))) {
+ if(s.tqcontains(TQRegExp("name=.*"))) {
_name = s.right(s.length()-5);
return !_name.isEmpty();
}
// check default entry
- if(s.contains(TQRegExp("default=\\(.*\\)"))) {
+ if(s.tqcontains(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.contains(TQRegExp("minimum_costs=.*"))) {
+ if(s.tqcontains(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.contains(TQRegExp("currency_digits=.*"))) {
+ if(s.tqcontains(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.contains(TQRegExp("currency_position=.*")))
+ if(s.tqcontains(TQRegExp("currency_position=.*")))
return TRUE;
// check per connection fee
- if(s.contains(TQRegExp("per_connection="))) {
+ if(s.tqcontains(TQRegExp("per_connection="))) {
TQString token = s.mid(15, s.length()-15);
bool ok;
pcf = token.toDouble(&ok);