diff options
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]); } |