From ad1fc5fc8eadb9b63e8767e57ac41cbac84f7eb7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 16 Dec 2011 09:57:30 -0600 Subject: Revert "Rename a number of old tq methods that are no longer tq specific" This reverts commit 9d6927a7d6a543332f828bffedf65eecf6774c6d. --- src/common/port/parallel.cpp | 28 ++++++++++++++-------------- src/common/port/parallel.h | 2 +- src/common/port/port_base.cpp | 6 +++--- src/common/port/serial.cpp | 32 ++++++++++++++++---------------- src/common/port/usb_port.cpp | 36 ++++++++++++++++++------------------ 5 files changed, 52 insertions(+), 52 deletions(-) (limited to 'src/common/port') diff --git a/src/common/port/parallel.cpp b/src/common/port/parallel.cpp index 3d92ae0..daa0c6a 100644 --- a/src/common/port/parallel.cpp +++ b/src/common/port/parallel.cpp @@ -59,12 +59,12 @@ TQStringList Port::Parallel::deviceList() TQStringList list; #if defined(HAVE_PPDEV) // standard parport in user space - for(int i = 0; i<8; ++i) list.append(TQString("/dev/parport%1").arg(i)); + for(int i = 0; i<8; ++i) list.append(TQString("/dev/parport%1").tqarg(i)); // new devfs parport flavour - for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").arg(i)); + for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").tqarg(i)); #elif defined(HAVE_PPBUS) // FreeBSD - for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").arg(i)); + for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").tqarg(i)); #endif return list; } @@ -100,12 +100,12 @@ const Port::Parallel::PPinData Port::Parallel::PIN_DATA[Nb_Pins] = { { Data, 0x20, Out, "D5" }, // data 5 { Data, 0x40, Out, "D6" }, // data 6 { Data, 0x80, Out, "D7" }, // data 7 - { Status, 0x40, In, "/ACK" }, // !ack - { Status, 0x80, In, "BUSY" }, // busy - { Status, 0x20, In, "PAPER" }, // pout - { Status, 0x10, In, "SELin" }, // select + { tqStatus, 0x40, In, "/ACK" }, // !ack + { tqStatus, 0x80, In, "BUSY" }, // busy + { tqStatus, 0x20, In, "PAPER" }, // pout + { tqStatus, 0x10, In, "SELin" }, // select { Control, 0x02, Out, "LF" }, // !feed - { Status, 0x08, In, "/ERROR" }, // !error + { tqStatus, 0x08, In, "/ERROR" }, // !error { Control, 0x04, Out, "PRIME" }, // !init { Control, 0x08, Out, "SELout" }, // !si { Nb_RequestTypes, 0x00, NoIO, "GND" }, // GND @@ -166,17 +166,17 @@ bool Port::Parallel::internalOpen() #if defined(HAVE_PPDEV) _fd = ::open(_device.latin1(), O_RDWR); if ( _fd<0 ) { - setSystemError(i18n("Could not open device \"%1\"").arg(_device)); + setSystemError(i18n("Could not open device \"%1\"").tqarg(_device)); return false; } if ( ioctl(_fd, PPCLAIM)<0 ) { - setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").arg(_device)); + setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").tqarg(_device)); return false; } #elif defined(HAVE_PPBUS) _fd = ::open(_device.latin1(), O_RDWR); if ( _fd<0 ) { - setSystemError(i18n("Could not open device \"%1\"").arg(_device)); + setSystemError(i18n("Could not open device \"%1\"").tqarg(_device)); return false; } #endif @@ -208,7 +208,7 @@ bool Port::Parallel::setPinOn(uint pin, bool on, LogicType type) int request = REQUEST_DATA[rtype].write; Q_ASSERT( request!=0 ); if ( ioctl(_fd, request, &c)<0 ) { - setSystemError(i18n("Error setting pin %1 to %2").arg(PIN_DATA[pin].label).arg(on)); + setSystemError(i18n("Error setting pin %1 to %2").tqarg(PIN_DATA[pin].label).tqarg(on)); return false; } _images[rtype] = c; @@ -228,7 +228,7 @@ bool Port::Parallel::readPin(uint pin, LogicType type, bool &value) Q_ASSERT( request!=0 ); uchar c = 0; if ( ioctl(_fd, request, &c)<0 ) { - setSystemError(i18n("Error reading bit on pin %1").arg(PIN_DATA[pin].label)); + setSystemError(i18n("Error reading bit on pin %1").tqarg(PIN_DATA[pin].label)); return false; } _images[rtype] = c; @@ -240,7 +240,7 @@ bool Port::Parallel::readPin(uint pin, LogicType type, bool &value) void Port::Parallel::setSystemError(const TQString &message) { #if defined(HAVE_PPDEV) || defined(HAVE_PPBUS) - log(Log::LineType::Error, message + TQString(" (errno=%1).").arg(strerror(errno))); + log(Log::LineType::Error, message + TQString(" (errno=%1).").tqarg(strerror(errno))); #else Q_UNUSED(message); #endif diff --git a/src/common/port/parallel.h b/src/common/port/parallel.h index d25529d..08741e1 100644 --- a/src/common/port/parallel.h +++ b/src/common/port/parallel.h @@ -33,7 +33,7 @@ public: enum Pin { DS = 0, D0, D1, D2, D3, D4, D5, D6, D7, ACK, BUSY, PAPER, SELin, LF, ERROR, PRIME, SELout, P18, P19, P20, P21, P22, P23, P24, P25, Nb_Pins }; - enum RequestType { Control = 0, Status, Data, Nb_RequestTypes }; + enum RequestType { Control = 0, tqStatus, Data, Nb_RequestTypes }; struct PPinData { RequestType rType; uchar mask; diff --git a/src/common/port/port_base.cpp b/src/common/port/port_base.cpp index 63e820e..0112a1b 100644 --- a/src/common/port/port_base.cpp +++ b/src/common/port/port_base.cpp @@ -28,7 +28,7 @@ void Port::Base::close() bool Port::Base::send(const char *data, uint size, uint timeout) { - log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").arg(toPrintable(data, size, PrintAlphaNum))); + log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").tqarg(toPrintable(data, size, PrintAlphaNum))); return internalSend(data, size, timeout); } @@ -45,14 +45,14 @@ bool Port::Base::receive(uint size, TQMemArray &a, uint timeout) { a.resize(size); bool ok = internalReceive(size, (char *)a.data(), timeout); - if (ok) log(Log::DebugLevel::LowLevel, TQString("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, TQString("Received: \"%1\"").arg(toPrintable(c, PrintAlphaNum))); + log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").tqarg(toPrintable(c, PrintAlphaNum))); return true; } diff --git a/src/common/port/serial.cpp b/src/common/port/serial.cpp index 977f31c..2db84b9 100644 --- a/src/common/port/serial.cpp +++ b/src/common/port/serial.cpp @@ -73,21 +73,21 @@ TQStringList Port::Serial::deviceList() TQStringList list; #if defined(Q_OS_UNIX) // standard serport in user space - for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").tqarg(i)); // new devfs serport flavour - for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").tqarg(i)); // standard USB serport in user space - for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").tqarg(i)); // new devfs USB serport flavour - for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").tqarg(i)); // FreeBSD - for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").tqarg(i)); // Slackware 11 devfs USB Serial port support. - for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").arg(i)); + for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").tqarg(i)); // MacOSX devfs USB Serial port support. list.append("/dev/tty.usbserial"); #elif defined(Q_OS_WIN) - for (uint i=1; i<10; i++) list.append(TQString("COM%1").arg(i)); + for (uint i=1; i<10; i++) list.append(TQString("COM%1").tqarg(i)); #endif return list; } @@ -187,7 +187,7 @@ bool Port::Serial::internalOpen() { _fd = openHandle(_device, In | Out); if ( _fd==INVALID_HANDLE ) { - setSystemError(i18n("Could not open device \"%1\" read-write").arg(_device)); + setSystemError(i18n("Could not open device \"%1\" read-write").tqarg(_device)); return false; } if ( !getParameters(_oldParameters) ) return false; // save configuration @@ -232,7 +232,7 @@ bool Port::Serial::internalSend(const char *data, uint size, uint timeout) if ( res>0 ) todo -= res; else { if ( uint(time.elapsed())>timeout ) { - log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").arg(size-todo).arg(size)); + log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").tqarg(size-todo).tqarg(size)); return false; } msleep(1); @@ -277,7 +277,7 @@ bool Port::Serial::internalReceive(uint size, char *data, uint timeout) if ( res>0 ) todo -= res; else { if ( uint(time.elapsed())>timeout ) { - log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").arg(size-todo).arg(size)); + log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").tqarg(size-todo).tqarg(size)); return false; } msleep(1); @@ -303,7 +303,7 @@ bool Port::Serial::drain(uint timeout) if ( nb==0 ) break; if ( uint(time.elapsed())>timeout ) { _fd = INVALID_HANDLE; // otherwise close blocks... - log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").arg(nb)); + log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").tqarg(nb)); return false; } } @@ -364,7 +364,7 @@ bool Port::Serial::setPinOn(uint pin, bool on, LogicType type) Q_ASSERT( pindevices; dev; dev=dev->next) { if ( dev->descriptor.idVendor==0 ) continue; // controller list.append(TQString("Vendor Id: %1 - Product Id: %2") - .arg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).arg(toLabel(NumberBase::Hex, dev->descriptor.idProduct, 4))); + .tqarg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).tqarg(toLabel(NumberBase::Hex, dev->descriptor.idProduct, 4))); } } #endif @@ -179,7 +179,7 @@ Port::USB::~USB() void Port::USB::setSystemError(const TQString &message) { #ifdef HAVE_USB - log(Log::LineType::Error, message + TQString(" (err=%1).").arg(usb_strerror())); + log(Log::LineType::Error, message + TQString(" (err=%1).").tqarg(usb_strerror())); #else log(Log::LineType::Error, message); #endif @@ -192,7 +192,7 @@ void Port::USB::tryToDetachDriver() log(Log::DebugLevel::Extra, "find if there is already an installed driver"); char dname[256] = ""; if ( usb_get_driver_np(_handle, _interface, dname, 255)<0 ) return; - log(Log::DebugLevel::Normal, TQString(" a driver \"%1\" is already installed...").arg(dname)); + log(Log::DebugLevel::Normal, TQString(" a driver \"%1\" is already installed...").tqarg(dname)); # if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP) && LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP usb_detach_kernel_driver_np(_handle, _interface); log(Log::DebugLevel::Normal, " try to detach it..."); @@ -208,10 +208,10 @@ bool Port::USB::internalOpen() _device = findDevice(_vendorId, _productId); if ( _device==0 ) { log(Log::LineType::Error, i18n("Could not find USB device (vendor=%1 product=%2).") - .arg(toLabel(NumberBase::Hex, _vendorId, 4)).arg(toLabel(NumberBase::Hex, _productId, 4))); + .tqarg(toLabel(NumberBase::Hex, _vendorId, 4)).tqarg(toLabel(NumberBase::Hex, _productId, 4))); return false; } - log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").arg(_device->filename).arg(_device->bus->dirname)); + log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").tqarg(_device->filename).tqarg(_device->bus->dirname)); _handle = usb_open(_device); if ( _handle==0 ) { setSystemError(i18n("Error opening USB device.")); @@ -239,11 +239,11 @@ bool Port::USB::internalOpen() uint old = _config; i = 0; _config = _device->config[i].bConfigurationValue; - log(Log::LineType::Warning, i18n("Configuration %1 not present: using %2").arg(old).arg(_config)); + log(Log::LineType::Warning, i18n("Configuration %1 not present: using %2").tqarg(old).tqarg(_config)); } const usb_config_descriptor &configd = _device->config[i]; if ( usb_set_configuration(_handle, _config)<0 ) { - setSystemError(i18n("Error setting USB configuration %1.").arg(_config)); + setSystemError(i18n("Error setting USB configuration %1.").tqarg(_config)); return false; } for (i=0; i_interface = &(configd.interface[i].altsetting[0]); if ( usb_claim_interface(_handle, _interface)<0 ) { - setSystemError(i18n("Could not claim USB interface %1").arg(_interface)); + setSystemError(i18n("Could not claim USB interface %1").tqarg(_interface)); return false; } - log(Log::DebugLevel::Max, TQString("alternate setting is %1").arg(_private->_interface->bAlternateSetting)); - log(Log::DebugLevel::Max, TQString("USB bcdDevice: %1").arg(toHexLabel(_device->descriptor.bcdDevice, 4))); + log(Log::DebugLevel::Max, TQString("alternate setting is %1").tqarg(_private->_interface->bAlternateSetting)); + log(Log::DebugLevel::Max, TQString("USB bcdDevice: %1").tqarg(toHexLabel(_device->descriptor.bcdDevice, 4))); return true; #else log(Log::LineType::Error, i18n("USB support disabled")); @@ -343,7 +343,7 @@ bool Port::USB::write(uint ep, const char *data, uint size) IODir dir = endpointDir(ep); EndpointMode mode = endpointMode(ep); log(Log::DebugLevel::LowLevel, TQString("write to endpoint %1 (%2 - %3) %4 chars: \"%5\"") - .arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(size).arg(toPrintable(data, size, PrintEscapeAll))); + .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size).tqarg(toPrintable(data, size, PrintEscapeAll))); Q_ASSERT( dir==Out ); TQTime time; time.start(); @@ -356,8 +356,8 @@ bool Port::USB::write(uint ep, const char *data, uint size) //qDebug("res: %i", res); if ( res==todo ) break; if ( uint(time.elapsed())>3000 ) { // 3 s - if ( res<0 ) setSystemError(i18n("Error sending data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); - else log(Log::LineType::Error, i18n("Timeout: only some data sent (%1/%2 bytes).").arg(size-todo).arg(size)); + if ( res<0 ) setSystemError(i18n("Error sending data (ep=%1 res=%2)").tqarg(toHexLabel(ep, 2)).tqarg(res)); + else log(Log::LineType::Error, i18n("Timeout: only some data sent (%1/%2 bytes).").tqarg(size-todo).tqarg(size)); return false; } if ( res==0 ) log(Log::DebugLevel::Normal, i18n("Nothing sent: retrying...")); @@ -377,7 +377,7 @@ bool Port::USB::read(uint ep, char *data, uint size, bool *poll) IODir dir = endpointDir(ep); EndpointMode mode = endpointMode(ep); log(Log::DebugLevel::LowLevel, TQString("read from endpoint %1 (%2 - %3) %4 chars") - .arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(size)); + .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size)); Q_ASSERT( dir==In ); TQTime time; time.start(); @@ -390,8 +390,8 @@ bool Port::USB::read(uint ep, char *data, uint size, bool *poll) //qDebug("res: %i", res); if ( res==todo ) break; if ( uint(time.elapsed())>3000 ) { // 3 s: seems to help icd2 in some case (?) - if ( res<0 ) setSystemError(i18n("Error receiving data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); - else log(Log::LineType::Error, i18n("Timeout: only some data received (%1/%2 bytes).").arg(size-todo).arg(size)); + if ( res<0 ) setSystemError(i18n("Error receiving data (ep=%1 res=%2)").tqarg(toHexLabel(ep, 2)).tqarg(res)); + else log(Log::LineType::Error, i18n("Timeout: only some data received (%1/%2 bytes).").tqarg(size-todo).tqarg(size)); return false; } if ( res==0 ) { -- cgit v1.2.1