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/hddtempsrc.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/hddtempsrc.cpp')
-rw-r--r-- | src/sources/hddtempsrc.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/sources/hddtempsrc.cpp b/src/sources/hddtempsrc.cpp index eb0419e..b22a6c8 100644 --- a/src/sources/hddtempsrc.cpp +++ b/src/sources/hddtempsrc.cpp @@ -20,50 +20,50 @@ #include "hddtempsrc.h" -#include <qsocketdevice.h> -#include <qhostaddress.h> -#include <qcstring.h> +#include <tqsocketdevice.h> +#include <tqhostaddress.h> +#include <tqcstring.h> #include <klocale.h> //#include <kdebug.h> -const Q_ULONG HDDTempSrc::BUFFERSIZE = 128; -const Q_UINT32 HDDTempSrc::ADDRESS = (127<<24)|1; -const Q_UINT16 HDDTempSrc::PORT = 7634; +const TQ_ULONG HDDTempSrc::BUFFERSIZE = 128; +const TQ_UINT32 HDDTempSrc::ADDRESS = (127<<24)|1; +const TQ_UINT16 HDDTempSrc::PORT = 7634; -HDDTempSrc::HDDTempSrc(QWidget* inParent, uint inIndex, const QString& inDevice, const QString& inModelName): +HDDTempSrc::HDDTempSrc(TQWidget* inParent, uint inIndex, const TQString& inDevice, const TQString& inModelName): LabelSource(inParent), mIndex(inIndex), mTrigger(this){ - mID = "HDDTemp" + QString().setNum(inIndex); + mID = "HDDTemp" + TQString().setNum(inIndex); mName = mID; - mDescription = i18n("This source is provided by hddtemp. (%1, %2)").arg(inDevice).arg(inModelName); + mDescription = i18n("This source is provided by hddtemp. (%1, %2)").tqarg(inDevice).tqarg(inModelName); } HDDTempSrc::~HDDTempSrc(){ } -std::list<Source*>HDDTempSrc::createInstances(QWidget* inParent){ +std::list<Source*>HDDTempSrc::createInstances(TQWidget* inParent){ std::list<Source*> list; - QSocketDevice sd; + TQSocketDevice sd; sd.setBlocking(true); if(sd.connect((ADDRESS), PORT)){ //kdDebug() << "hddtemp is availalble" << endl; - QCString tmp(0); - Q_LONG numBytes = 0; - Q_LONG numTotalBytes = 0; + TQCString tmp(0); + TQ_LONG numBytes = 0; + TQ_LONG numTotalBytes = 0; do{ tmp.resize(numTotalBytes+BUFFERSIZE); numBytes = sd.readBlock(tmp.data()+numTotalBytes, BUFFERSIZE); // numBytes could be -1 too in case of an error! - numTotalBytes += QMAX(numBytes, 0); + numTotalBytes += TQMAX(numBytes, 0); }while(numBytes>0); sd.close(); tmp.resize(numTotalBytes+1); //kdDebug() << "following data was read: " << tmp << endl; // split the string - QStringList sl = QStringList::split(tmp[0], tmp); + TQStringList sl = TQStringList::split(tmp[0], tmp); // create the sources if(sl.size() > 0 && sl.size()%4 == 0){ for(uint i = 0; i < sl.size(); i += 4) @@ -74,23 +74,23 @@ std::list<Source*>HDDTempSrc::createInstances(QWidget* inParent){ return list; } -QString HDDTempSrc::fetchValue(){ - QString s = "n/a"; - QSocketDevice sd; +TQString HDDTempSrc::fetchValue(){ + TQString s = "n/a"; + TQSocketDevice sd; sd.setBlocking(true); if(sd.connect((ADDRESS), PORT)){ - QCString tmp(0); - Q_LONG numBytes = 0; - Q_LONG numTotalBytes = 0; + TQCString tmp(0); + TQ_LONG numBytes = 0; + TQ_LONG numTotalBytes = 0; do{ tmp.resize(numTotalBytes+BUFFERSIZE); numBytes = sd.readBlock(tmp.data()+numTotalBytes, BUFFERSIZE); // numBytes could be -1 too in case of an error! - numTotalBytes += QMAX(numBytes, 0); + numTotalBytes += TQMAX(numBytes, 0); }while(numBytes>0); sd.close(); tmp.resize(numTotalBytes+1); - QStringList sl = QStringList::split(tmp[0], tmp); + TQStringList sl = TQStringList::split(tmp[0], tmp); if(sl.size() > 0 && sl.size()%4 == 0){ s = formatTemperature(sl[mIndex*4+2]); } |