summaryrefslogtreecommitdiffstats
path: root/src/sources/nvidiathermalsrc.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 20:48:23 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 20:48:23 +0000
commit383adc283801b6238d8acfc750890613a63f8060 (patch)
treeaf3a65389067c05263db2ef4551a541501422998 /src/sources/nvidiathermalsrc.cpp
parentda7847adb43726079c7a4be1f06acbebe0bdde57 (diff)
downloadkima-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/nvidiathermalsrc.cpp')
-rw-r--r--src/sources/nvidiathermalsrc.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/sources/nvidiathermalsrc.cpp b/src/sources/nvidiathermalsrc.cpp
index 000ece7..34fec06 100644
--- a/src/sources/nvidiathermalsrc.cpp
+++ b/src/sources/nvidiathermalsrc.cpp
@@ -19,39 +19,39 @@
***************************************************************************/
#include "nvidiathermalsrc.h"
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kdebug.h>
#ifndef HAVE_NVCONTROL
#include <kprocio.h>
#else
- #include <qpaintdevice.h> // for the Device* pointer
+ #include <tqpaintdevice.h> // for the Device* pointer
// include the NVCtrl include stuff
#include <X11/Xlib.h>
- #include <fixx11h.h> // needed for Qt, to include X11 header
+ #include <fixx11h.h> // needed for TQt, to include X11 header
extern "C" {
#include <NVCtrlLib.h>
}
#endif
#ifndef HAVE_NVCONTROL
-NVidiaThermalSrc::NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName):
+NVidiaThermalSrc::NVidiaThermalSrc(TQWidget* inParent, const TQString& inID, const TQString& inName):
LabelSource(inParent), mProcess(0) {
#else
-NVidiaThermalSrc::NVidiaThermalSrc(QWidget* inParent, const QString& inID, const QString& inName, unsigned int attrib):
+NVidiaThermalSrc::NVidiaThermalSrc(TQWidget* inParent, const TQString& inID, const TQString& inName, unsigned int attrib):
LabelSource(inParent), mAttrib(attrib) {
#endif
mID = inID;
mName = inName;
mDescription = i18n("This source is provided by the nVidia GPU card driver tools");
- mRefreshTimer = new QTimer(this, "default refresh handler" );
+ mRefreshTimer = new TQTimer(this, "default refresh handler" );
// connect the timer
- connect(mRefreshTimer, SIGNAL(timeout()), this, SLOT(fetchValue()));
- connect(this, SIGNAL(enabledChanged(bool, Source*)), this, SLOT(enable(bool)));
+ connect(mRefreshTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fetchValue()));
+ connect(this, TQT_SIGNAL(enabledChanged(bool, Source*)), this, TQT_SLOT(enable(bool)));
}
NVidiaThermalSrc::~NVidiaThermalSrc(){
@@ -60,7 +60,7 @@ NVidiaThermalSrc::~NVidiaThermalSrc(){
#endif
}
-std::list<Source*>NVidiaThermalSrc::createInstances(QWidget* inParent){
+std::list<Source*>NVidiaThermalSrc::createInstances(TQWidget* inParent){
std::list<Source*> list;
#ifndef HAVE_NVCONTROL
// see if the path contains nvidia-settings. if yes,
@@ -77,18 +77,18 @@ std::list<Source*>NVidiaThermalSrc::createInstances(QWidget* inParent){
return list;
// now see what it printed...
- QString ln;
- QString pout;
+ TQString ln;
+ TQString pout;
while(proc.readln(ln) != -1)
pout+= ln + '\n';
- if(pout.contains("Attribute 'GPUCoreTemp'"))
+ if(pout.tqcontains("Attribute 'GPUCoreTemp'"))
list.push_back(new NVidiaThermalSrc(inParent, "GPUCoreTemp", "NVidiaCore"));
- if(pout.contains("Attribute 'GPUAmbientTemp'"))
+ if(pout.tqcontains("Attribute 'GPUAmbientTemp'"))
list.push_back(new NVidiaThermalSrc(inParent, "GPUAmbientTemp", "NVidiaAmbient"));
#else
int evt_base = 0, err_base = 0, temp;
- Display * dpy = QPaintDevice::x11AppDisplay();
+ Display * dpy = TQPaintDevice::x11AppDisplay();
// do we have the XNVCtrl extension loaded?
if(!XNVCTRLQueryExtension(dpy, &evt_base, &err_base))
@@ -122,14 +122,14 @@ void NVidiaThermalSrc::enable(bool inEnable){
void NVidiaThermalSrc::evaluateStdout(){
#ifndef HAVE_NVCONTROL
- QString val = i18n("n/a");
+ TQString val = i18n("n/a");
// now see what it printed...
- QString ln;
- QString pout;
+ TQString ln;
+ TQString pout;
while(mProcess->readln(ln) != -1)
pout+= ln + '\n';
- QRegExp regexp("Attribute\\s'" + mID + "'.*(\\d+)\\.");
+ TQRegExp regexp("Attribute\\s'" + mID + "'.*(\\d+)\\.");
if(regexp.search(pout) != -1)
val = formatTemperature(regexp.cap(1));
mValue = val;
@@ -144,13 +144,13 @@ void NVidiaThermalSrc::evaluateStdout(){
#ifndef HAVE_NVCONTROL
void NVidiaThermalSrc::createProcess() {
mProcess = new KProcIO;
- connect(mProcess, SIGNAL(processExited(KProcess*)), this, SLOT(evaluateStdout()));
+ connect(mProcess, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(evaluateStdout()));
*mProcess << "nvidia-settings" << "-n"
<< "-q" << mID;
}
#endif
-QString NVidiaThermalSrc::fetchValue(){
+TQString NVidiaThermalSrc::fetchValue(){
#ifndef HAVE_NVCONTROL
if(!mProcess) {
createProcess();
@@ -163,9 +163,9 @@ QString NVidiaThermalSrc::fetchValue(){
return getValue();
#else
int temp;
- Display * dpy = QPaintDevice::x11AppDisplay();
+ Display * dpy = TQPaintDevice::x11AppDisplay();
if(XNVCTRLQueryAttribute (dpy, 0, 0, mAttrib, &temp))
- mValue = formatTemperature(QString::number(temp));
+ mValue = formatTemperature(TQString::number(temp));
else
mValue = "n/a";
emit valueUpdated(mValue); // calls updateLabel(mValue) of LabelSource