summaryrefslogtreecommitdiffstats
path: root/superkaramba/src/cpusensor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:52:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:52:55 +0000
commit5f5ee2367157176ed223b86343eb0a9e4022e020 (patch)
tree6a9c87f14ee38e90eff3c77c784f14e4f38fd5a1 /superkaramba/src/cpusensor.cpp
parent4facf42feec57b22dcf46badc115ad6c5b5cc512 (diff)
downloadtdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.tar.gz
tdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'superkaramba/src/cpusensor.cpp')
-rw-r--r--superkaramba/src/cpusensor.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/superkaramba/src/cpusensor.cpp b/superkaramba/src/cpusensor.cpp
index bc4b095..1cf9a06 100644
--- a/superkaramba/src/cpusensor.cpp
+++ b/superkaramba/src/cpusensor.cpp
@@ -8,7 +8,7 @@
* (at your option) any later version. *
***************************************************************************/
-#include <qglobal.h>
+#include <tqglobal.h>
#ifdef __FreeBSD__
#include <sys/time.h>
@@ -26,11 +26,11 @@
#include "cpusensor.h"
-CPUSensor::CPUSensor( QString cpu, int interval ) :
+CPUSensor::CPUSensor( TQString cpu, int interval ) :
Sensor(interval), userTicks(0), sysTicks(0), niceTicks(0), idleTicks(0)
{
cpuNbr = cpu;
- QRegExp rx("^\\d+$");
+ TQRegExp rx("^\\d+$");
if( rx.search( cpu.lower() ) == -1)
cpuNbr = "";
cpuNbr = "cpu"+cpuNbr;
@@ -69,12 +69,12 @@ void CPUSensor::getTicks (long &u,long &s,long &n,long &i)
i = cp_time[CP_IDLE];
}
#else
- QFile file("/proc/stat");
- QString line;
+ TQFile file("/proc/stat");
+ TQString line;
if ( file.open(IO_ReadOnly | IO_Translate) )
{
- QTextStream t( &file ); // use a text stream
- QRegExp rx( cpuNbr+"\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)");
+ TQTextStream t( &file ); // use a text stream
+ TQRegExp rx( cpuNbr+"\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)");
line = t.readLine();
rx.search( line );
while( (line = t.readLine()) !=0 && rx.cap(0) == "" )
@@ -131,10 +131,10 @@ void CPUSensor::update()
{
SensorParams *sp;
Meter *meter;
- QString format;
+ TQString format;
int load = getCPULoad();
- QObjectListIt it( *objList );
+ TQObjectListIt it( *objList );
while (it != 0)
{
sp = (SensorParams*)(*it);
@@ -145,12 +145,12 @@ void CPUSensor::update()
{
format = "%v";
}
- format.replace( QRegExp("%load", false), QString::number( load ) );
- format.replace( QRegExp("%user", false), QString::number( user ) );
- format.replace( QRegExp("%nice", false), QString::number( nice ) );
- format.replace( QRegExp("%idle", false), QString::number( idle ) );
- format.replace( QRegExp("%system", false), QString::number( system ) );
- format.replace( QRegExp("%v", false), QString::number( load ) );
+ format.replace( TQRegExp("%load", false), TQString::number( load ) );
+ format.replace( TQRegExp("%user", false), TQString::number( user ) );
+ format.replace( TQRegExp("%nice", false), TQString::number( nice ) );
+ format.replace( TQRegExp("%idle", false), TQString::number( idle ) );
+ format.replace( TQRegExp("%system", false), TQString::number( system ) );
+ format.replace( TQRegExp("%v", false), TQString::number( load ) );
meter->setValue( format );
++it;