diff options
Diffstat (limited to 'src/hardware_cpu.cpp')
-rw-r--r-- | src/hardware_cpu.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/hardware_cpu.cpp b/src/hardware_cpu.cpp index f0d939c..5af515c 100644 --- a/src/hardware_cpu.cpp +++ b/src/hardware_cpu.cpp @@ -33,8 +33,8 @@ #include "hardware_cpu.moc" // QT Header -#include <qdir.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqtimer.h> // system header #include <fcntl.h> @@ -63,8 +63,8 @@ int CPUInfo::getCPUNum() { kdDebugFuncIn(trace); int cpu_id=0; - QDir tmp_dir; - QString cpu_path = "/sys/devices/system/cpu/cpu0/"; + TQDir tmp_dir; + TQString cpu_path = "/sys/devices/system/cpu/cpu0/"; #ifdef FAKE_CPU cpu_path.prepend("/tmp/foo"); #endif @@ -76,13 +76,13 @@ int CPUInfo::getCPUNum() { cpuFreqHW = false; } - QString tmp_path = tmp_dir.absFilePath(cpu_path, true); + TQString tmp_path = tmp_dir.absFilePath(cpu_path, true); while (tmp_dir.exists(tmp_path)) { int tmp = cpu_id; cpu_id++; - cpu_path.replace(QString::number(tmp), QString::number(cpu_id)); + cpu_path.tqreplace(TQString::number(tmp), TQString::number(cpu_id)); tmp_path = tmp_dir.absFilePath(cpu_path, true); } @@ -107,7 +107,7 @@ int CPUInfo::checkCPUSpeed(){ int new_value = -1; int fd; char buf[15]; - QString cpu_device = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"; + TQString cpu_device = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"; #ifdef FAKE_CPU cpu_device.prepend("/tmp/foo"); #endif @@ -141,7 +141,7 @@ int CPUInfo::checkCPUSpeed(){ cpufreq_speed.append(new_value); } - cpu_device.replace(QString::number(cpu_id), QString::number(cpu_id+1)); + cpu_device.tqreplace(TQString::number(cpu_id), TQString::number(cpu_id+1)); } if (speed_changed) { @@ -164,11 +164,11 @@ int CPUInfo::checkCPUSpeed(){ int CPUInfo::checkCPUSpeedThrottling() { kdDebugFuncOut(trace); - QString cpu_file = "/proc/cpuinfo"; + TQString cpu_file = "/proc/cpuinfo"; #ifdef FAKE_CPU cpu_file.prepend("/tmp/foo"); #endif - QFile cpu_info(cpu_file); + TQFile cpu_info(cpu_file); // clear cpufreq list cpufreq_speed.clear(); @@ -179,8 +179,8 @@ int CPUInfo::checkCPUSpeedThrottling() { return -1; } - QTextStream stream( &cpu_info ); - QString line; + TQTextStream stream( &cpu_info ); + TQString line; while ( !stream.atEnd() ) { line = stream.readLine(); @@ -212,24 +212,24 @@ bool CPUInfo::getCPUThrottlingState() { kdDebugFuncIn(trace); int id = 0; - QFileInfo *fi; - QString cpu_dirname; - QString dir_acpi_processor = "/proc/acpi/processor/"; + TQFileInfo *fi; + TQString cpu_dirname; + TQString dir_acpi_processor = "/proc/acpi/processor/"; #ifdef FAKE_CPU dir_acpi_processor.prepend("/tmp/foo"); #endif - QDir d_throttling(dir_acpi_processor); + TQDir d_throttling(dir_acpi_processor); if (!d_throttling.exists()) { kdDebugFuncOut(trace); return false; } - d_throttling.setFilter( QDir::Dirs ); + d_throttling.setFilter( TQDir::Dirs ); d_throttling.setNameFilter("CPU*"); - const QFileInfoList *list = d_throttling.entryInfoList(); - QFileInfoListIterator it( *list ); + const TQFileInfoList *list = d_throttling.entryInfoList(); + TQFileInfoListIterator it( *list ); // clear throttling value list cpu_throttling.clear(); @@ -237,17 +237,17 @@ bool CPUInfo::getCPUThrottlingState() { while ((fi = it.current()) != 0 ) { cpu_dirname = fi->fileName(); - QString throttling_device = d_throttling.absPath(); + TQString throttling_device = d_throttling.absPath(); throttling_device.append("/").append(cpu_dirname).append("/throttling"); kdDebug() << "Throttling state file for CPU" << id << " will be: " << throttling_device << endl; - QFile throttling(throttling_device); + TQFile throttling(throttling_device); // open throttling state file if ( throttling.open(IO_ReadOnly) ) { - QTextStream stream( &throttling ); - QString line; + TQTextStream stream( &throttling ); + TQString line; do { line = stream.readLine(); @@ -283,7 +283,7 @@ void CPUInfo::getCPUMaxSpeed() { int fd; int maxfreq; char buf[15]; - QString cpu_device_max = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; + TQString cpu_device_max = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; #ifdef FAKE_CPU cpu_device_max.prepend("/tmp/foo"); #endif @@ -306,7 +306,7 @@ void CPUInfo::getCPUMaxSpeed() { close(fd); } - cpu_device_max.replace(QString::number(cpu_id), QString::number(cpu_id+1)); + cpu_device_max.tqreplace(TQString::number(cpu_id), TQString::number(cpu_id+1)); } kdDebugFuncOut(trace); |