summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cli/cli_main.cpp4
-rw-r--r--src/common/cli/cli_pfile.cpp4
-rw-r--r--src/common/global/purl.cpp2
-rw-r--r--src/common/global/xml_data_file.cpp4
-rw-r--r--src/common/gui/container.cpp8
-rw-r--r--src/common/gui/container.h4
-rw-r--r--src/common/gui/pfile_ext.cpp8
-rw-r--r--src/common/gui/purl_gui.cpp2
-rw-r--r--src/common/nokde/nokde_kaboutdata.cpp2
-rw-r--r--src/common/nokde/nokde_kcmdlineargs.cpp60
-rw-r--r--src/common/port/parallel.cpp18
-rw-r--r--src/common/port/port_base.cpp6
-rw-r--r--src/common/port/serial.cpp30
-rw-r--r--src/common/port/usb_port.cpp36
14 files changed, 94 insertions, 94 deletions
diff --git a/src/common/cli/cli_main.cpp b/src/common/cli/cli_main.cpp
index 11537a7..8b8e2ab 100644
--- a/src/common/cli/cli_main.cpp
+++ b/src/common/cli/cli_main.cpp
@@ -26,7 +26,7 @@ CLI::ExitCode CLI::findCommand(const TQString &s)
{
if ( s.isEmpty() ) return errorExit(i18n("No command specified"), ARG_ERROR);
const CommandData *data = findCommandData(s);
- if ( data==0 ) return errorExit(i18n("Unknown command: %1").tqarg(s), ARG_ERROR);
+ if ( data==0 ) return errorExit(i18n("Unknown command: %1").arg(s), ARG_ERROR);
return OK;
}
@@ -182,7 +182,7 @@ CLI::ExitCode CLI::MainBase::doRun()
TQString option = _args->getOption(PROPERTY_DATA[i].name);
ExitCode code = executeSetCommand(PROPERTY_DATA[i].name, option);
if ( code!=OK ) return code;
- log(Log::LineType::Information, TQString("%1: %2").tqarg(PROPERTY_DATA[i].name).tqarg(executeGetCommand(PROPERTY_DATA[i].name)));
+ log(Log::LineType::Information, TQString("%1: %2").arg(PROPERTY_DATA[i].name).arg(executeGetCommand(PROPERTY_DATA[i].name)));
}
// process default lists
diff --git a/src/common/cli/cli_pfile.cpp b/src/common/cli/cli_pfile.cpp
index e984e52..1cdbc9a 100644
--- a/src/common/cli/cli_pfile.cpp
+++ b/src/common/cli/cli_pfile.cpp
@@ -17,7 +17,7 @@ bool PURL::File::openForWrite()
_file->setName(url().filepath());
if ( !_file->open(IO_WriteOnly) ) {
_error = i18n("Could not open file for writing.");
- _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_file->name()));
return false;
}
return true;
@@ -35,7 +35,7 @@ bool PURL::File::openForRead()
_file->setName(_url.filepath());
if ( !_file->open(IO_ReadOnly) ) {
_error = i18n("Could not open file for reading.");
- _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_file->name()));
return false;
}
return true;
diff --git a/src/common/global/purl.cpp b/src/common/global/purl.cpp
index ab1f8da..d0b5498 100644
--- a/src/common/global/purl.cpp
+++ b/src/common/global/purl.cpp
@@ -69,7 +69,7 @@ TQString PURL::Private::getWindowsDrivePath(char drive)
}
return _winDrives[drive];
#else
- return TQString("%1:\\").tqarg(drive);
+ return TQString("%1:\\").arg(drive);
#endif
}
diff --git a/src/common/global/xml_data_file.cpp b/src/common/global/xml_data_file.cpp
index 528f8e7..bae7f17 100644
--- a/src/common/global/xml_data_file.cpp
+++ b/src/common/global/xml_data_file.cpp
@@ -26,7 +26,7 @@ bool XmlDataFile::load(TQString &error)
Log::StringView sview;
PURL::File file(_url, sview);
if ( !file.openForRead() ) {
- error = i18n("Error opening file: %1").tqarg(sview.string());
+ error = i18n("Error opening file: %1").arg(sview.string());
return false;
}
if ( !_document.setContent(file.qfile(), false, &error) ) return false;
@@ -48,7 +48,7 @@ bool XmlDataFile::save(TQString &error) const
file.appendText(s);
ok = file.close();
}
- if ( !ok ) error = i18n("Error saving file: %1").tqarg(sview.string());
+ if ( !ok ) error = i18n("Error saving file: %1").arg(sview.string());
return ok;
}
diff --git a/src/common/gui/container.cpp b/src/common/gui/container.cpp
index 8a747d3..b5917dc 100644
--- a/src/common/gui/container.cpp
+++ b/src/common/gui/container.cpp
@@ -55,19 +55,19 @@ void Container::initLayout()
setFrame(_type);
}
-void Container::addWidget(TQWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment)
+void Container::addWidget(TQWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int alignment)
{
Q_ASSERT( startRow<=endRow );
Q_ASSERT( startCol<=endCol );
w->show();
- _gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, tqalignment);
+ _gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, alignment);
}
-void Container::addLayout(TQLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment)
+void Container::addLayout(TQLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int alignment)
{
Q_ASSERT( startRow<=endRow );
Q_ASSERT( startCol<=endCol );
- _gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, tqalignment);
+ _gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, alignment);
}
//----------------------------------------------------------------------------
diff --git a/src/common/gui/container.h b/src/common/gui/container.h
index af3e5a6..cf3f351 100644
--- a/src/common/gui/container.h
+++ b/src/common/gui/container.h
@@ -26,8 +26,8 @@ public:
Container(TQWidget *parent = 0, Type type = Flat);
Container(TQWidgetStack *stack, uint index, Type type = Flat);
Container(TQTabWidget *tabw, const TQString &title, Type type = Flat);
- void addWidget(TQWidget *widget, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0);
- void addLayout(TQLayout *tqlayout, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0);
+ void addWidget(TQWidget *widget, uint startRow, uint endRow, uint startCol, uint endCol, int alignment = 0);
+ void addLayout(TQLayout *tqlayout, uint startRow, uint endRow, uint startCol, uint endCol, int alignment = 0);
uint numRows() const { return _gridLayout->numRows(); }
uint numCols() const { return _gridLayout->numCols(); }
void setFrame(Type type);
diff --git a/src/common/gui/pfile_ext.cpp b/src/common/gui/pfile_ext.cpp
index 43f9e81..080421f 100644
--- a/src/common/gui/pfile_ext.cpp
+++ b/src/common/gui/pfile_ext.cpp
@@ -22,7 +22,7 @@ bool PURL::File::openForWrite()
_tmp->setAutoDelete(true);
if ( _tmp->status()!=0 ) {
_error = i18n("Could not create temporary file.");
- _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_tmp->name()));
return false;
}
return true;
@@ -61,7 +61,7 @@ bool PURL::File::openForRead()
_file->setName(tmp);
if ( !_file->open(IO_ReadOnly) ) {
_error = i18n("Could not open temporary file.");
- _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_file->name()));
return false;
}
return true;
@@ -92,7 +92,7 @@ bool PURL::TempFile::close()
_tmp->close();
if ( _tmp->status()!=IO_Ok ) {
_error = i18n("Could not write to temporary file.");
- _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_tmp->name()));
return false;
}
}
@@ -107,7 +107,7 @@ bool PURL::TempFile::openForWrite()
_tmp->setAutoDelete(true);
if ( _tmp->status()!=0 ) {
_error = i18n("Could not create temporary file.");
- _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
+ _log.sorry(_error, i18n("File: %1").arg(_tmp->name()));
return false;
}
return true;
diff --git a/src/common/gui/purl_gui.cpp b/src/common/gui/purl_gui.cpp
index 0284682..7515b99 100644
--- a/src/common/gui/purl_gui.cpp
+++ b/src/common/gui/purl_gui.cpp
@@ -40,7 +40,7 @@ PURL::Url PURL::getSaveUrl(const TQString &startDir, const TQString &filter,
case NoSaveAction: break;
case AskOverwrite:
if ( url.exists() ) {
- if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").tqarg(url.pretty())) ) return Url();
+ if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").arg(url.pretty())) ) return Url();
}
break;
case CancelIfExists:
diff --git a/src/common/nokde/nokde_kaboutdata.cpp b/src/common/nokde/nokde_kaboutdata.cpp
index 62d0d3d..85edf3c 100644
--- a/src/common/nokde/nokde_kaboutdata.cpp
+++ b/src/common/nokde/nokde_kaboutdata.cpp
@@ -434,7 +434,7 @@ KAboutData::license() const
}
if (!l.isEmpty())
- result += i18n("This program is distributed under the terms of the %1.").tqarg( l );
+ result += i18n("This program is distributed under the terms of the %1.").arg( l );
if (!f.isEmpty())
{
diff --git a/src/common/nokde/nokde_kcmdlineargs.cpp b/src/common/nokde/nokde_kcmdlineargs.cpp
index 1919d1e..42dc5c1 100644
--- a/src/common/nokde/nokde_kcmdlineargs.cpp
+++ b/src/common/nokde/nokde_kcmdlineargs.cpp
@@ -518,7 +518,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (ignoreUnknown)
return;
enable_i18n();
- usage( i18n("Unknown option '%1'.").tqarg(TQString::fromLocal8Bit(_opt)));
+ usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt)));
}
if ((result & 4) != 0)
@@ -534,7 +534,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (ignoreUnknown)
return;
enable_i18n();
- usage( i18n("Unknown option '%1'.").tqarg(TQString::fromLocal8Bit(_opt)));
+ usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt)));
}
if (argument.isEmpty())
{
@@ -542,7 +542,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (i >= argc)
{
enable_i18n();
- usage( i18n("'%1' missing.").tqarg( opt_name));
+ usage( i18n("'%1' missing.").arg( opt_name));
}
argument = argv[i];
}
@@ -618,10 +618,10 @@ KCmdLineArgs::parseAllArgs()
else if ( (::qstrcmp(option, "version") == 0) ||
(::qstrcmp(option, "v") == 0))
{
- printQ( TQString("TQt: %1\n").tqarg(qVersion()));
-// printQ( TQString("KDE: %1\n").tqarg(TDE_VERSION_STRING));
+ printQ( TQString("TQt: %1\n").arg(qVersion()));
+// printQ( TQString("KDE: %1\n").arg(TDE_VERSION_STRING));
printQ( TQString("%1: %2\n").
- arg(about->programName()).tqarg(about->version()));
+ arg(about->programName()).arg(about->version()));
exit(0);
} else if ( (::qstrcmp(option, "license") == 0) )
{
@@ -641,17 +641,17 @@ KCmdLineArgs::parseAllArgs()
email = " <" + (*it).emailAddress() + ">";
authorlist += TQString(" ") + (*it).name() + email + "\n";
}
- printQ( i18n("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2").arg ( TQString(about->programName()) ).tqarg( authorlist ) );
+ printQ( i18n("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2").arg ( TQString(about->programName()) ).arg( authorlist ) );
}
} else {
- printQ( i18n("%1 was written by somebody who wants to remain anonymous.").tqarg(about->programName()) );
+ printQ( i18n("%1 was written by somebody who wants to remain anonymous.").arg(about->programName()) );
}
if (!about->bugAddress().isEmpty())
{
if (about->bugAddress() == "submit@bugs.kde.org")
printQ( i18n( "Please use http://bugs.kde.org to report bugs, do not mail the authors directly.\n" ) );
else
- printQ( i18n( "Please use %1 to report bugs, do not mail the authors directly.\n" ).tqarg(about->bugAddress()) );
+ printQ( i18n( "Please use %1 to report bugs, do not mail the authors directly.\n" ).arg(about->bugAddress()) );
}
exit(0);
} else {
@@ -671,7 +671,7 @@ KCmdLineArgs::parseAllArgs()
if (ignoreUnknown)
continue;
enable_i18n();
- usage( i18n("Unexpected argument '%1'.").tqarg(TQString::fromLocal8Bit(argv[i])));
+ usage( i18n("Unexpected argument '%1'.").arg(TQString::fromLocal8Bit(argv[i])));
}
else
{
@@ -815,7 +815,7 @@ KCmdLineArgs::usage(const char *id)
{
if (args->name)
{
- usage = i18n("[%1-options]").tqarg(args->name)+" "+usage;
+ usage = i18n("[%1-options]").arg(args->name)+" "+usage;
}
args = argsList->prev();
}
@@ -835,30 +835,30 @@ KCmdLineArgs::usage(const char *id)
}
}
- printQ(i18n("Usage: %1 %2\n").tqarg(argv[0]).tqarg(usage));
+ printQ(i18n("Usage: %1 %2\n").arg(argv[0]).arg(usage));
printQ("\n"+about->shortDescription()+"\n");
- printQ(optionHeaderString.tqarg(i18n("Generic options")));
- printQ(optionFormatString.tqarg("--help", -25).tqarg(i18n("Show help about options")));
+ printQ(optionHeaderString.arg(i18n("Generic options")));
+ printQ(optionFormatString.arg("--help", -25).arg(i18n("Show help about options")));
args = argsList->first();
while(args)
{
if (args->name && args->id)
{
- TQString option = TQString("--help-%1").tqarg(args->id);
- TQString desc = i18n("Show %1 specific options").tqarg(args->name);
+ TQString option = TQString("--help-%1").arg(args->id);
+ TQString desc = i18n("Show %1 specific options").arg(args->name);
- printQ(optionFormatString.tqarg(option, -25).tqarg(desc));
+ printQ(optionFormatString.arg(option, -25).arg(desc));
}
args = argsList->next();
}
- printQ(optionFormatString.tqarg("--help-all",-25).tqarg(i18n("Show all options")));
- printQ(optionFormatString.tqarg("--author",-25).tqarg(i18n("Show author information")));
- printQ(optionFormatString.tqarg("-v, --version",-25).tqarg(i18n("Show version information")));
- printQ(optionFormatString.tqarg("--license",-25).tqarg(i18n("Show license information")));
- printQ(optionFormatString.tqarg("--", -25).tqarg(i18n("End of options")));
+ printQ(optionFormatString.arg("--help-all",-25).arg(i18n("Show all options")));
+ printQ(optionFormatString.arg("--author",-25).arg(i18n("Show author information")));
+ printQ(optionFormatString.arg("-v, --version",-25).arg(i18n("Show version information")));
+ printQ(optionFormatString.arg("--license",-25).arg(i18n("Show license information")));
+ printQ(optionFormatString.arg("--", -25).arg(i18n("End of options")));
args = argsList->first(); // Sets current to 1st.
@@ -880,7 +880,7 @@ KCmdLineArgs::usage(const char *id)
bool hasOptions = false;
TQString optionsHeader;
if (args->name)
- optionsHeader = optionHeaderString.tqarg(i18n("%1 options").tqarg(TQString::fromLatin1(args->name)));
+ optionsHeader = optionHeaderString.arg(i18n("%1 options").arg(TQString::fromLatin1(args->name)));
else
optionsHeader = i18n("\nOptions:\n");
@@ -950,8 +950,8 @@ KCmdLineArgs::usage(const char *id)
name = name.mid(1);
if ((name[0] == '[') && (name[name.length()-1] == ']'))
name = name.mid(1, name.length()-2);
- printQ(optionFormatString.tqarg(TQString(name), -25)
- .tqarg(description));
+ printQ(optionFormatString.arg(TQString(name), -25)
+ .arg(description));
}
else
{
@@ -974,13 +974,13 @@ KCmdLineArgs::usage(const char *id)
opt = opt + name;
if (!option->def)
{
- printQ(optionFormatString.tqarg(TQString(opt), -25)
- .tqarg(description));
+ printQ(optionFormatString.arg(TQString(opt), -25)
+ .arg(description));
}
else
{
- printQ(optionFormatStringDef.tqarg(TQString(opt), -25)
- .tqarg(description).tqarg(option->def));
+ printQ(optionFormatStringDef.arg(TQString(opt), -25)
+ .arg(description).arg(option->def));
}
opt = "";
}
@@ -989,7 +989,7 @@ KCmdLineArgs::usage(const char *id)
it != dl.end();
++it)
{
- printQ(optionFormatString.tqarg("", -25).tqarg(*it));
+ printQ(optionFormatString.arg("", -25).arg(*it));
}
option++;
diff --git a/src/common/port/parallel.cpp b/src/common/port/parallel.cpp
index 46e395b..3d92ae0 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").tqarg(i));
+ for(int i = 0; i<8; ++i) list.append(TQString("/dev/parport%1").arg(i));
// new devfs parport flavour
- for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").tqarg(i));
+ for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").arg(i));
#elif defined(HAVE_PPBUS)
// FreeBSD
- for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").tqarg(i));
+ for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").arg(i));
#endif
return list;
}
@@ -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\"").tqarg(_device));
+ setSystemError(i18n("Could not open device \"%1\"").arg(_device));
return false;
}
if ( ioctl(_fd, PPCLAIM)<0 ) {
- setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").tqarg(_device));
+ setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").arg(_device));
return false;
}
#elif defined(HAVE_PPBUS)
_fd = ::open(_device.latin1(), O_RDWR);
if ( _fd<0 ) {
- setSystemError(i18n("Could not open device \"%1\"").tqarg(_device));
+ setSystemError(i18n("Could not open device \"%1\"").arg(_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").tqarg(PIN_DATA[pin].label).tqarg(on));
+ setSystemError(i18n("Error setting pin %1 to %2").arg(PIN_DATA[pin].label).arg(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").tqarg(PIN_DATA[pin].label));
+ setSystemError(i18n("Error reading bit on pin %1").arg(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).").tqarg(strerror(errno)));
+ log(Log::LineType::Error, message + TQString(" (errno=%1).").arg(strerror(errno)));
#else
Q_UNUSED(message);
#endif
diff --git a/src/common/port/port_base.cpp b/src/common/port/port_base.cpp
index 0112a1b..63e820e 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\"").tqarg(toPrintable(data, size, PrintAlphaNum)));
+ log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").arg(toPrintable(data, size, PrintAlphaNum)));
return internalSend(data, size, timeout);
}
@@ -45,14 +45,14 @@ 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, TQString("Received: \"%1\"").tqarg(toPrintable(a, PrintAlphaNum)));
+ if (ok) log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").arg(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\"").tqarg(toPrintable(c, PrintAlphaNum)));
+ log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").arg(toPrintable(c, PrintAlphaNum)));
return true;
}
diff --git a/src/common/port/serial.cpp b/src/common/port/serial.cpp
index 2aaa7a8..977f31c 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").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").arg(i));
// new devfs serport flavour
- for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").arg(i));
// standard USB serport in user space
- for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").arg(i));
// new devfs USB serport flavour
- for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").arg(i));
// FreeBSD
- for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").arg(i));
// Slackware 11 devfs USB Serial port support.
- for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").arg(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").tqarg(i));
+ for (uint i=1; i<10; i++) list.append(TQString("COM%1").arg(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").tqarg(_device));
+ setSystemError(i18n("Could not open device \"%1\" read-write").arg(_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).").tqarg(size-todo).tqarg(size));
+ log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").arg(size-todo).arg(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).").tqarg(size-todo).tqarg(size));
+ log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").arg(size-todo).arg(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).").tqarg(nb));
+ log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").arg(nb));
return false;
}
}
@@ -364,7 +364,7 @@ bool Port::Serial::setPinOn(uint pin, bool on, LogicType type)
Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==Out );
if ( !internalSetPinOn(Pin(pin), on) ) {
- setSystemError(i18n("Error setting bit %1 of serial port to %2").tqarg(PIN_DATA[pin].label).tqarg(on));
+ setSystemError(i18n("Error setting bit %1 of serial port to %2").arg(PIN_DATA[pin].label).arg(on));
return false;
}
return true;
@@ -406,7 +406,7 @@ bool Port::Serial::internalReadPin(Pin pin, LogicType type, bool &value)
Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==In );
if ( !internalReadPin(Pin(pin), type, value) ) {
- setSystemError(i18n("Error reading serial pin %1").tqarg(PIN_DATA[pin].label));
+ setSystemError(i18n("Error reading serial pin %1").arg(PIN_DATA[pin].label));
return false;
}
return true;
@@ -513,11 +513,11 @@ bool Port::Serial::setHardwareFlowControl(bool on)
void Port::Serial::setSystemError(const TQString &message)
{
#if defined(Q_OS_UNIX)
- log(Log::LineType::Error, message + TQString(" (errno=%1)").tqarg(strerror(errno)));
+ log(Log::LineType::Error, message + TQString(" (errno=%1)").arg(strerror(errno)));
#elif defined(Q_OS_WIN)
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL);
- log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").tqarg(GetLastError()).tqarg((const char *)(LPCTSTR)lpMsgBuf));
+ log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").arg(GetLastError()).arg((const char *)(LPCTSTR)lpMsgBuf));
LocalFree(lpMsgBuf);
#endif
}
diff --git a/src/common/port/usb_port.cpp b/src/common/port/usb_port.cpp
index 80e7de2..76fa5b0 100644
--- a/src/common/port/usb_port.cpp
+++ b/src/common/port/usb_port.cpp
@@ -38,7 +38,7 @@ void Port::USB::initialize()
#ifdef HAVE_USB
usb_init();
VersionData vd = VersionData::fromString(LIBUSB_VERSION);
- TQString s = TQString("libusb %1").tqarg(vd.pretty());
+ TQString s = TQString("libusb %1").arg(vd.pretty());
if ( vd<VersionData(0, 1, 8) ) qWarning("%s: may be too old (you need at least version 0.1.8)", s.latin1());
#endif
}
@@ -132,7 +132,7 @@ TQStringList Port::USB::probedDeviceList()
for (struct usb_device *dev=bus->devices; dev; dev=dev->next) {
if ( dev->descriptor.idVendor==0 ) continue; // controller
list.append(TQString("Vendor Id: %1 - Product Id: %2")
- .tqarg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).tqarg(toLabel(NumberBase::Hex, dev->descriptor.idProduct, 4)));
+ .arg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).arg(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).").tqarg(usb_strerror()));
+ log(Log::LineType::Error, message + TQString(" (err=%1).").arg(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...").tqarg(dname));
+ log(Log::DebugLevel::Normal, TQString(" a driver \"%1\" is already installed...").arg(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).")
- .tqarg(toLabel(NumberBase::Hex, _vendorId, 4)).tqarg(toLabel(NumberBase::Hex, _productId, 4)));
+ .arg(toLabel(NumberBase::Hex, _vendorId, 4)).arg(toLabel(NumberBase::Hex, _productId, 4)));
return false;
}
- log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").tqarg(_device->filename).tqarg(_device->bus->dirname));
+ log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").arg(_device->filename).arg(_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").tqarg(old).tqarg(_config));
+ log(Log::LineType::Warning, i18n("Configuration %1 not present: using %2").arg(old).arg(_config));
}
const usb_config_descriptor &configd = _device->config[i];
if ( usb_set_configuration(_handle, _config)<0 ) {
- setSystemError(i18n("Error setting USB configuration %1.").tqarg(_config));
+ setSystemError(i18n("Error setting USB configuration %1.").arg(_config));
return false;
}
for (i=0; i<configd.bNumInterfaces; i++)
@@ -252,15 +252,15 @@ bool Port::USB::internalOpen()
uint old = _interface;
i = 0;
_interface = configd.interface[i].altsetting[0].bInterfaceNumber;
- log(Log::LineType::Warning, i18n("Interface %1 not present: using %2").tqarg(old).tqarg(_interface));
+ log(Log::LineType::Warning, i18n("Interface %1 not present: using %2").arg(old).arg(_interface));
}
_private->_interface = &(configd.interface[i].altsetting[0]);
if ( usb_claim_interface(_handle, _interface)<0 ) {
- setSystemError(i18n("Could not claim USB interface %1").tqarg(_interface));
+ setSystemError(i18n("Could not claim USB interface %1").arg(_interface));
return false;
}
- 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)));
+ 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)));
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\"")
- .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size).tqarg(toPrintable(data, size, PrintEscapeAll)));
+ .arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(size).arg(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)").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));
+ 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));
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")
- .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size));
+ .arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(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)").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));
+ 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));
return false;
}
if ( res==0 ) {