diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 20:48:23 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 20:48:23 +0000 |
commit | 383adc283801b6238d8acfc750890613a63f8060 (patch) | |
tree | af3a65389067c05263db2ef4551a541501422998 /src/sources/uptimesrc.cpp | |
parent | da7847adb43726079c7a4be1f06acbebe0bdde57 (diff) | |
download | kima-383adc283801b6238d8acfc750890613a63f8060.tar.gz kima-383adc283801b6238d8acfc750890613a63f8060.zip |
TQt4 port kima
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kima@1239290 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/sources/uptimesrc.cpp')
-rw-r--r-- | src/sources/uptimesrc.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sources/uptimesrc.cpp b/src/sources/uptimesrc.cpp index fd392f5..cc9d0b5 100644 --- a/src/sources/uptimesrc.cpp +++ b/src/sources/uptimesrc.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include "uptimesrc.h" -#include <qtextstream.h> +#include <tqtextstream.h> #include <klocale.h> -UptimeSrc::UptimeSrc(QWidget* inParent, const QFile& inSourceFile): +UptimeSrc::UptimeSrc(TQWidget* inParent, const TQFile& inSourceFile): LabelSource(inParent), mSourceFile(inSourceFile.name()), mTrigger(this, 30000){ // 30 seconds @@ -35,29 +35,29 @@ UptimeSrc::UptimeSrc(QWidget* inParent, const QFile& inSourceFile): UptimeSrc::~UptimeSrc(){ } -std::list<Source*>UptimeSrc::createInstances(QWidget* inParent){ +std::list<Source*>UptimeSrc::createInstances(TQWidget* inParent){ std::list<Source*> list; - QFile uptimeFile("/proc/uptime" ); + TQFile uptimeFile("/proc/uptime" ); if(uptimeFile.open(IO_ReadOnly)) list.push_back(new UptimeSrc(inParent, uptimeFile)); return list; } -QString UptimeSrc::fetchValue(){ - QString s = "n/a"; +TQString UptimeSrc::fetchValue(){ + TQString s = "n/a"; int secs; if(mSourceFile.open(IO_ReadOnly)) { - QTextStream stream( &mSourceFile ); + TQTextStream stream( &mSourceFile ); stream >> secs; - //QString seconds = QString::number(secs % 60).rightJustify(2, '0'); - QString minutes = QString::number(secs / 60 % 60).rightJustify(2, '0'); - QString hours = QString::number(secs / 3600 % 24).rightJustify(2, '0'); - QString days = QString::number(secs / 86400); + //TQString seconds = TQString::number(secs % 60).rightJustify(2, '0'); + TQString minutes = TQString::number(secs / 60 % 60).rightJustify(2, '0'); + TQString hours = TQString::number(secs / 3600 % 24).rightJustify(2, '0'); + TQString days = TQString::number(secs / 86400); if(days != "0") - s = mTimeFormatLong.arg(days).arg(hours).arg(minutes); + s = mTimeFormatLong.tqarg(days).tqarg(hours).tqarg(minutes); else - s = mTimeFormatShort.arg(hours).arg(minutes); + s = mTimeFormatShort.tqarg(hours).tqarg(minutes); mSourceFile.close(); } return s; |