From 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 00:15:53 +0000 Subject: TQt4 port piklab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/progs/sdcdb/base/sdcdb_debug.cpp | 64 ++++++++++++++++++------------------ src/progs/sdcdb/base/sdcdb_debug.h | 19 ++++++----- 2 files changed, 42 insertions(+), 41 deletions(-) (limited to 'src/progs/sdcdb') diff --git a/src/progs/sdcdb/base/sdcdb_debug.cpp b/src/progs/sdcdb/base/sdcdb_debug.cpp index fcccf22..d8d4ad4 100644 --- a/src/progs/sdcdb/base/sdcdb_debug.cpp +++ b/src/progs/sdcdb/base/sdcdb_debug.cpp @@ -9,7 +9,7 @@ #include "gpsim_debug.h" #include -#include +#include #include "devices/list/device_list.h" #include "devices/pic/pic/pic_debug.h" @@ -52,10 +52,10 @@ bool GPSim::Debugger::internalStep() return hardware()->execute("step", true); } -bool GPSim::Debugger::setBreakpoints(const QValueList
&list) +bool GPSim::Debugger::setBreakpoints(const TQValueList
&list) { for (uint i=0; i<_nbBreakpoints; i++) - if ( !hardware()->execute("clear " + QString::number(i), true) ) return false; + if ( !hardware()->execute("clear " + TQString::number(i), true) ) return false; for (uint i=0; iexecute("break e 0x" + toHex(list[i], nbChars(list[i].toUInt())), true) ) return false; _nbBreakpoints = list.count(); @@ -75,15 +75,15 @@ bool GPSim::Debugger::updateState() return true; } -bool GPSim::Debugger::findRegExp(const QStringList &lines, const QString &pattern, - const QString &label, QString &value) const +bool GPSim::Debugger::findRegExp(const TQStringList &lines, const TQString &pattern, + const TQString &label, TQString &value) const { - QRegExp rexp(pattern); + TQRegExp rexp(pattern); uint i = 0; for (; iversion()<=VersionData(0, 21, 7) || hardware()->version()>=VersionData(0, 22, 0) ) return getRegister("W", value); - QStringList lines; + TQStringList lines; if ( !hardware()->execute("dump s", true, &lines) ) return false; - QString s; + TQString s; if ( !findRegExp(lines, "^\\s*[0-9A-Fa-f]+\\s+(\\w+)\\s*=\\s*([0-9A-Fa-f]+)", "W", s) ) { log(Log::Error, i18n("Error reading register \"W\"")); return false; @@ -110,10 +110,10 @@ bool GPSim::Debugger::readWreg(BitValue &value) return true; } -bool GPSim::Debugger::getRegister(const QString &name, BitValue &value) +bool GPSim::Debugger::getRegister(const TQString &name, BitValue &value) { - QStringList lines; - QRegExp r; + TQStringList lines; + TQRegExp r; if ( hardware()->version()execute("x " + name, true, &lines) ) return false; r.setPattern("\\w+\\s*[][\\w]+\\s*=\\s*(?:0x|)([0-9A-Fa-f]+)(?:\\W.*|)"); @@ -125,7 +125,7 @@ bool GPSim::Debugger::getRegister(const QString &name, BitValue &value) for (; iregistersData(); - QString name = toHex(address, rdata.nbCharsAddress()); + TQString name = toHex(address, rdata.nbCharsAddress()); if ( hardware()->version()registersData().sfrNames[data.address()]; + TQString name = device()->registersData().sfrNames[data.address()]; if ( name=="WREG" ) return readWreg(value); if ( !name.isEmpty() ) return getRegister(name.lower(), value); return getRegister(data.address(), value); } -bool GPSim::Debugger::setRegister(const QString &name, BitValue value) +bool GPSim::Debugger::setRegister(const TQString &name, BitValue value) { if ( hardware()->version()registersData(); - QString s = QString("%1 = %2").arg(name).arg(toHexLabel(value, rdata.nbChars())); + TQString s = TQString("%1 = %2").tqarg(name).tqarg(toHexLabel(value, rdata.nbChars())); return hardware()->execute(s, true); } bool GPSim::Debugger::setRegister(Address address, BitValue value) { const Pic::RegistersData &rdata = device()->registersData(); - QString s = QString("ramData[$%1]").arg(toHex(address, rdata.nbCharsAddress())); + TQString s = TQString("ramData[$%1]").tqarg(toHex(address, rdata.nbCharsAddress())); return setRegister(s, value); } @@ -184,7 +184,7 @@ bool GPSim::Debugger::writeRegister(const Register::TypeData &data, BitValue val return false; } const Pic::RegistersData &rdata = device()->registersData(); - QString name = rdata.sfrNames[data.address()]; + TQString name = rdata.sfrNames[data.address()]; if ( !name.isEmpty() ) return setRegister(name.lower(), value); return setRegister(data.address(), value); } @@ -194,16 +194,16 @@ bool GPSim::Debugger::writeWreg(BitValue value) return setRegister("W", value); } -bool GPSim::Debugger::updatePortStatus(uint index, QMap &bits) +bool GPSim::Debugger::updatePorttqStatus(uint index, TQMap &bits) { for (uint i=0; iregistersData().hasPortBit(index, i) ) continue; - QString name = device()->registersData().portName(index).lower() + QString::number(i); - QStringList lines; + TQString name = device()->registersData().portName(index).lower() + TQString::number(i); + TQStringList lines; if ( !hardware()->execute("symbol " + name, true, &lines) ) return false; - QString pattern = "^(\\w+)=([^\\s])+\\s*", value; + TQString pattern = "^(\\w+)=([^\\s])+\\s*", value; if ( !findRegExp(lines, pattern, "bitState", value) || value.length()!=1 ) { - log(Log::Error, i18n("Error reading state of IO bit: %1").arg(name)); + log(Log::Error, i18n("Error reading state of IO bit: %1").tqarg(name)); return false; } switch (value[0].latin1()) { @@ -217,24 +217,24 @@ bool GPSim::Debugger::updatePortStatus(uint index, QMap(Device::lister().data(s)); if (data) { diff --git a/src/progs/sdcdb/base/sdcdb_debug.h b/src/progs/sdcdb/base/sdcdb_debug.h index 55cda75..e1f109b 100644 --- a/src/progs/sdcdb/base/sdcdb_debug.h +++ b/src/progs/sdcdb/base/sdcdb_debug.h @@ -19,6 +19,7 @@ namespace SDCDB class Programmer : public ::Programmer::PicBase { Q_OBJECT + TQ_OBJECT public: Programmer(const ::Programmer::Group &group, const Pic::Data *data) : Programmer::PicBase(group, data, "sdcdb_programmer") {} @@ -41,18 +42,18 @@ class Debugger : public ::Debugger::PicBase { public: Debugger(Programmer &programmer); - virtual bool setBreakpoints(const QValueList
&list); + virtual bool setBreakpoints(const TQValueList
&list); virtual bool readRegister(const Register::TypeData &data, BitValue &value); virtual bool writeRegister(const Register::TypeData &data, BitValue value); - virtual bool updatePortStatus(uint index, QMap &bits); + virtual bool updatePorttqStatus(uint index, TQMap &bits); private: uint _nbBreakpoints; - bool findRegExp(const QStringList &lines, const QString &pattern, - const QString &label, QString &value) const; - bool getRegister(const QString &name, BitValue &value); - bool setRegister(const QString &name, BitValue value); + bool findRegExp(const TQStringList &lines, const TQString &pattern, + const TQString &label, TQString &value) const; + bool getRegister(const TQString &name, BitValue &value); + bool setRegister(const TQString &name, BitValue value); bool getRegister(Address address, BitValue &value); bool setRegister(Address address, BitValue value); Hardware *hardware() { return static_cast(_programmer.hardware()); } @@ -72,9 +73,9 @@ private: class Group : public ::Programmer::PicGroup { public: - virtual QString name() const { return "sdcdb"; } - virtual QString label() const { return i18n("SDCDB"); } - virtual QString statusLabel() const; + virtual TQString name() const { return "sdcdb"; } + virtual TQString label() const { return i18n("SDCDB"); } + virtual TQString statusLabel() const; virtual ::Programmer::Properties properties() const { return ::Programmer::Debugger | ::Programmer::HasConnectedState; } virtual ::Programmer::TargetPowerMode targetPowerMode() const { return ::Programmer::TargetSelfPowered; } virtual bool isPortSupported(Port::Type) const { return false; } -- cgit v1.2.1