diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kppp/accounting.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-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/accounting.cpp')
-rw-r--r-- | kppp/accounting.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kppp/accounting.cpp b/kppp/accounting.cpp index 76c5f02e..b9280eda 100644 --- a/kppp/accounting.cpp +++ b/kppp/accounting.cpp @@ -67,15 +67,15 @@ static TQString timet2qstring(time_t t) { // accounting is accomplished withing it's derived classes // ///////////////////////////////////////////////////////////////////////////// -AccountingBase::AccountingBase(TQObject *parent) : - TQObject(parent), +AccountingBase::AccountingBase(TQObject *tqparent) : + TQObject(tqparent), _total(0), _session(0) { - TQDate dt = TQDate::currentDate(); + TQDate dt = TQDate::tqcurrentDate(); LogFileName = TQString("%1-%2.log") - .arg(TQDate::shortMonthName(dt.month())) - .arg(dt.year(), 4); + .tqarg(TQDate::shortMonthName(dt.month())) + .tqarg(dt.year(), 4); LogFileName = KGlobal::dirs()->saveLocation("appdata", "Log") + "/" + LogFileName; @@ -212,8 +212,8 @@ TQString AccountingBase::getAccountingFile(const TQString &accountname) { // Accounting class for ruleset files // ///////////////////////////////////////////////////////////////////////////// -Accounting::Accounting(TQObject *parent, PPPStats *st) : - AccountingBase(parent), +Accounting::Accounting(TQObject *tqparent, PPPStats *st) : + AccountingBase(tqparent), acct_timer_id(0), update_timer_id(0), stats(st) @@ -233,7 +233,7 @@ void Accounting::timerEvent(TQTimerEvent *t) { double newLen; double connect_time = difftime(time(0), start_time); - rules.getActiveRule(TQDateTime::currentDateTime(), connect_time, newCosts, newLen); + rules.getActiveRule(TQDateTime::tqcurrentDateTime(), connect_time, newCosts, newLen); if(newLen < 1) { // changed to < 1 slotStop(); return; // no default rule found @@ -279,7 +279,7 @@ void Accounting::slotStart() { _lastcosts = 0.0; _lastlen = 0.0; _session = rules.perConnectionCosts(); - rules.setStartTime(TQDateTime::currentDateTime()); + rules.setStartTime(TQDateTime::tqcurrentDateTime()); acct_timer_id = startTimer(1); if(UPDATE_TIME > 0) update_timer_id = startTimer(UPDATE_TIME); @@ -358,8 +358,8 @@ double Accounting::session() const { -ExecutableAccounting::ExecutableAccounting(PPPStats *st, TQObject *parent) : - AccountingBase(parent), +ExecutableAccounting::ExecutableAccounting(PPPStats *st, TQObject *tqparent) : + AccountingBase(tqparent), proc(0), stats(st) { @@ -384,11 +384,11 @@ void ExecutableAccounting::gotData(KProcess */*proc*/, char *buffer, int /*bufle // split string TQString b(buffer); - pos = b.find(':'); + pos = b.tqfind(':'); while(pos != -1 && nFields < 8) { field[nFields++] = b.mid(last_pos, pos-last_pos); last_pos = pos+1; - pos = b.find(':', last_pos); + pos = b.tqfind(':', last_pos); } for(int i = 0; i < nFields;i++) @@ -398,9 +398,9 @@ void ExecutableAccounting::gotData(KProcess */*proc*/, char *buffer, int /*bufle TQString s(buffer); int del1, del2, del3; - del1 = s.find(':'); - del2 = s.find(':', del1+1); - del3 = s.find(':', del2+1); + del1 = s.tqfind(':'); + del2 = s.tqfind(':', del1+1); + del3 = s.tqfind(':', del2+1); if(del1 == -1 || del2 == -1 || del3 == -1) { // TODO: do something usefull here return; |