diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/common/port/port_base.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
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
Diffstat (limited to 'src/common/port/port_base.cpp')
-rw-r--r-- | src/common/port/port_base.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/common/port/port_base.cpp b/src/common/port/port_base.cpp index 7528eeb..0112a1b 100644 --- a/src/common/port/port_base.cpp +++ b/src/common/port/port_base.cpp @@ -28,31 +28,31 @@ void Port::Base::close() bool Port::Base::send(const char *data, uint size, uint timeout) { - log(Log::DebugLevel::LowLevel, QString("Sending: \"%1\"").arg(toPrintable(data, size, PrintAlphaNum))); + log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").tqarg(toPrintable(data, size, PrintAlphaNum))); return internalSend(data, size, timeout); } -bool Port::Base::receive(uint size, QString &s, uint timeout) +bool Port::Base::receive(uint size, TQString &s, uint timeout) { - QMemArray<uchar> a; + TQMemArray<uchar> a; if ( !receive(size, a, timeout) ) return false; s.fill(0, size); for (uint i=0; i<size; i++) s[i] = a[i]; return true; } -bool Port::Base::receive(uint size, QMemArray<uchar> &a, uint timeout) +bool Port::Base::receive(uint size, TQMemArray<uchar> &a, uint timeout) { a.resize(size); bool ok = internalReceive(size, (char *)a.data(), timeout); - if (ok) log(Log::DebugLevel::LowLevel, QString("Received: \"%1\"").arg(toPrintable(a, PrintAlphaNum))); + if (ok) log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").tqarg(toPrintable(a, PrintAlphaNum))); return ok; } bool Port::Base::receiveChar(char &c, uint timeout) { if ( !internalReceive(1, &c, timeout) ) return false; - log(Log::DebugLevel::LowLevel, QString("Received: \"%1\"").arg(toPrintable(c, PrintAlphaNum))); + log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").tqarg(toPrintable(c, PrintAlphaNum))); return true; } @@ -66,10 +66,10 @@ bool Port::Base::readPin(uint, LogicType, bool &) qFatal("readPin not implemented"); return 0; } -QValueVector<Port::PinData> Port::Base::pinData(IODir) const +TQValueVector<Port::PinData> Port::Base::pinData(IODir) const { qFatal("pinData not implemented"); - return QValueVector<PinData>(); + return TQValueVector<PinData>(); } bool Port::Base::isGroundPin(uint) const { @@ -87,22 +87,22 @@ Port::IODir Port::Base::ioDir(uint) const return NoIO; } -void Port::Base::log(Log::LineType lineType, const QString &message) +void Port::Base::log(Log::LineType lineType, const TQString &message) { if ( lineType==Log::LineType::Error && _closing ) return; Log::Base::log(lineType, description().type.label() + ": " + message); if ( lineType==Log::LineType::Error ) close(); } -void Port::Base::log(Log::DebugLevel level, const QString &message) +void Port::Base::log(Log::DebugLevel level, const TQString &message) { Log::Base::log(level, description().type.label() + ": " + message); } -void Port::Base::logData(const QString &) +void Port::Base::logData(const TQString &) { /* - QString vs; + TQString vs; for (uint i=0; i<s.length(); i++) { char c = s[i]; switch (c) { @@ -113,7 +113,7 @@ void Port::Base::logData(const QString &) default: { if ( c>=32 && c<=126 ) vs += c; else { - QString tmp; + TQString tmp; tmp.sprintf("\\x%02x", c); vs += tmp; } |