diff options
Diffstat (limited to 'src/hdsensorslist.cpp')
-rw-r--r-- | src/hdsensorslist.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/hdsensorslist.cpp b/src/hdsensorslist.cpp index 8cbfa13..aaec441 100644 --- a/src/hdsensorslist.cpp +++ b/src/hdsensorslist.cpp @@ -21,19 +21,19 @@ #include <dirent.h> #include <sys/types.h> #include <stdlib.h> -#include <qstringlist.h> -#include <klocale.h> -#include <qregexp.h> +#include <ntqstringlist.h> +#include <tdelocale.h> +#include <ntqregexp.h> #include "sensor.h" #include "hdsensorslist.h" -HDSensorsList::HDSensorsList(QObject *parent, const char * name): SensorsList(parent,name) +HDSensorsList::HDSensorsList(TQObject *parent, const char * name): SensorsList(parent,name) { process= 0; - setDescription( QString(i18n("Hard Disks")) ); + setDescription( TQString(i18n("Hard Disks")) ); setClass(Sensor::hdSensor); @@ -41,16 +41,16 @@ HDSensorsList::HDSensorsList(QObject *parent, const char * name): SensorsList(pa if(!isHddTempInstalled()) return; - QStringList disks; + TQStringList disks; if(!getDisks(disks)) return; - for(QStringList::Iterator it = disks.begin(); it != disks.end(); ++it ) { + for(TQStringList::Iterator it = disks.begin(); it != disks.end(); ++it ) { ProcessExec proc; proc << "hddtemp" << "-q"; proc << *it; if(proc.runAndWait()) { double value; - QString str; + TQString str; if(getDiskInfo(proc.getStdoutData(),str,value)) { Sensor *sensor= new Sensor(this); sensor->setType(Sensor::lmTemp); @@ -77,10 +77,10 @@ void HDSensorsList::updateSensors() { if(process) return; - QObjectList *list= (QObjectList *)children(); + TQObjectList *list= (TQObjectList *)children(); if(!list) return; - QStringList params; + TQStringList params; for(Sensor *obj= (Sensor *)list->first(); obj!=0; obj= (Sensor *)list->next()) if(obj->monitorized()) params << obj->name(); @@ -88,24 +88,24 @@ void HDSensorsList::updateSensors() if(params.count()>0) { process= new ProcessExec; *process << "hddtemp" << "-q" << params; - connect( process, SIGNAL(processExited(KProcess *)), this, SLOT(slotProcessExited(KProcess *)) ); + connect( process, SIGNAL(processExited(TDEProcess *)), this, SLOT(slotProcessExited(TDEProcess *)) ); process->run(); } } -void HDSensorsList::slotProcessExited(KProcess *) +void HDSensorsList::slotProcessExited(TDEProcess *) { - QObjectList *list= (QObjectList *)children(); + TQObjectList *list= (TQObjectList *)children(); if (!list) return; if (process->outputErrors()) - qWarning("HddTemp Error:\n%s", process->getStdoutData().ascii()); + tqWarning("HddTemp Error:\n%s", process->getStdoutData().ascii()); - QStringList buf = QStringList::split(QChar('\n'), process->getStdoutData()); - for(QStringList::Iterator it = buf.begin(); it != buf.end(); ++it ) { + TQStringList buf = TQStringList::split(TQChar('\n'), process->getStdoutData()); + for(TQStringList::Iterator it = buf.begin(); it != buf.end(); ++it ) { for(Sensor *obj= (Sensor *)list->first(); obj!=0; obj= (Sensor *)list->next()) { - QRegExp rx(QString(obj->name()) + QString(":\\s+.+:\\s+(\\d+).*C")); + TQRegExp rx(TQString(obj->name()) + TQString(":\\s+.+:\\s+(\\d+).*C")); if (rx.search((*it)) > -1) obj->setValue(rx.cap(1).toDouble(), Sensor::dgCelsius); } @@ -117,9 +117,9 @@ void HDSensorsList::slotProcessExited(KProcess *) // *************** Static methods -bool HDSensorsList::getDiskInfo(const QString buf, QString &name, double &value) +bool HDSensorsList::getDiskInfo(const TQString buf, TQString &name, double &value) { - QRegExp rx(":\\s+(.+):\\s+(\\d+).*C"); + TQRegExp rx(":\\s+(.+):\\s+(\\d+).*C"); if (rx.search(buf) > -1) { bool ok; @@ -142,12 +142,12 @@ bool HDSensorsList::isHddTempInstalled() proc << "hddtemp" << "-v" ; if(proc.runAndWait()) { if(proc.getStdoutData().contains("ERROR")==0) return true; - qWarning("HddTemp Error:\n%s", proc.getStdoutData().ascii()); + tqWarning("HddTemp Error:\n%s", proc.getStdoutData().ascii()); } return false; } -bool HDSensorsList::getDisks(QStringList &disks ) +bool HDSensorsList::getDisks(TQStringList &disks ) { DIR *dir; @@ -155,7 +155,7 @@ bool HDSensorsList::getDisks(QStringList &disks ) if((dir = opendir ("/sys/block")) == NULL) if ((dir = opendir ("/proc/ide")) == NULL) return false; - QString str; + TQString str; struct dirent *ptr; while((ptr= readdir(dir))) { if((ptr->d_name[0]=='h' || ptr->d_name[0]=='s') && ptr->d_name[1]=='d') { |