Remove additional unneeded tq method conversions

(cherry picked from commit 4374b9aebc)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 1177a9f23b
commit 07dae48f6a

@ -101,7 +101,7 @@ CDB::Object::~Object()
void CDB::Object::log(Log::LineType type, const TQString &message)
{
_log.log(type, message + " " + i18n("at line #%1, column #%2").tqarg(_line+1).tqarg(_col+1));
_log.log(type, message + " " + i18n("at line #%1, column #%2").arg(_line+1).arg(_col+1));
}
void CDB::Object::logMalformed(const TQString &detail)
@ -125,7 +125,7 @@ bool CDB::Object::readAndCheckChar(char c)
char r;
if ( !readChar(r) ) return false;
if ( r!=c ) {
logMalformed(i18n("was expecting '%1'").tqarg(c));
logMalformed(i18n("was expecting '%1'").arg(c));
return false;
}
return true;
@ -197,7 +197,7 @@ bool CDB::Object::readBool(bool &b)
if ( c=='0' ) b = false;
else if ( c=='1' ) b = true;
else {
logMalformed(i18n("was expecting a bool ('%1')").tqarg(c));
logMalformed(i18n("was expecting a bool ('%1')").arg(c));
return false;
}
return true;

@ -52,7 +52,7 @@ CoffType Coff::identify(const TQByteArray &data, uint &offset, Log::Base &log, F
}
}
if ( !getULong(data, offset, 2, log, magic) ) return CoffType::Nb_Types;
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").tqarg(toHexLabel(magic, 4)));
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").arg(toHexLabel(magic, 4)));
format = Format::Nb_Types;
FOR_EACH(Format, f) if ( magic==f.data().magic ) format = f;
return CoffType::Object;
@ -64,7 +64,7 @@ bool Coff::getULong(const TQByteArray &data, uint &offset, uint nbBytes, Log::Ba
bool ok;
v = ::getULong(data, offset, nbBytes, &ok);
if ( !ok ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbBytes).tqarg(data.count()));
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbBytes).arg(data.count()));
return false;
}
offset += nbBytes;
@ -74,7 +74,7 @@ bool Coff::getULong(const TQByteArray &data, uint &offset, uint nbBytes, Log::Ba
bool Coff::getString(const TQByteArray &data, uint &offset, uint nbChars, Log::Base &log, TQString &name)
{
if ( !checkAvailable(data, offset, nbChars) ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbChars).tqarg(data.count()));
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbChars).arg(data.count()));
return false;
}
name = TQString::fromAscii(data.data()+offset, nbChars);
@ -90,7 +90,7 @@ bool Coff::Base::initParse(CoffType type, TQByteArray &data, uint &offset, Log::
data = file.readAll();
if ( log.hasError() ) return false;
if ( identify(data, offset, log, _format, _magic)!=type ) {
log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").tqarg(toHexLabel(_magic, 4)));
log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").arg(toHexLabel(_magic, 4)));
return false;
}
return true;

@ -16,7 +16,7 @@ Coff::Member::Member(const TQByteArray &data, uint &offset, Log::Base &log)
if ( !getString(data, offset, 256, log, s) ) return;
int i = s.find('/');
if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("Member name not terminated by '/' (\"%1\").").tqarg(s));
log.log(Log::LineType::Error, i18n("Member name not terminated by '/' (\"%1\").").arg(s));
return;
}
_name = s.mid(0, i);
@ -24,20 +24,20 @@ Coff::Member::Member(const TQByteArray &data, uint &offset, Log::Base &log)
if ( !getString(data, offset, 10, log, s) ) return;
i = s.find('l');
if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("File size not terminated by 'l' (\"%1\").").tqarg(s));
log.log(Log::LineType::Error, i18n("File size not terminated by 'l' (\"%1\").").arg(s));
return;
}
bool ok;
_nbBytes = s.mid(0, i).toUInt(&ok);
if ( !ok ) {
log.log(Log::LineType::Error, i18n("Wrong format for file size \"%1\".").tqarg(s));
log.log(Log::LineType::Error, i18n("Wrong format for file size \"%1\".").arg(s));
return;
}
TQ_UINT32 v;
if ( !getULong(data, offset, 2, log, v) ) return;
log.log(Log::DebugLevel::Extra, i18n("Magic number: %1").tqarg(toHexLabel(v, 4)));
log.log(Log::DebugLevel::Extra, i18n("Magic number: %1").arg(toHexLabel(v, 4)));
// if ( v!=0x600A ) {
// log.log(Log::LineType::Error, i18n("Wrong magic for Microchip archive (\"%1\").").tqarg(toHexLabel(v, 4)));
// log.log(Log::LineType::Error, i18n("Wrong magic for Microchip archive (\"%1\").").arg(toHexLabel(v, 4)));
// return;
// }
offset += _nbBytes;
@ -89,7 +89,7 @@ bool Coff::Archive::readSymbols(const TQByteArray &data, uint offset, Log::Base
TQ_UINT32 start;
if ( !getULong(data, offset, 4, log, start) ) return false;
if ( !_offsets.contains(start) ) {
log.log(Log::LineType::Error, i18n("Unknown file member offset: %1").tqarg(toHexLabel(start, 8)));
log.log(Log::LineType::Error, i18n("Unknown file member offset: %1").arg(toHexLabel(start, 8)));
return false;
}
members[i] = _offsets[start];
@ -115,7 +115,7 @@ Log::KeyList Coff::Archive::membersInformation() const
Log::KeyList keys(i18n("File Members:"));
TQMap<TQString, Member *>::const_iterator it;
for (it=members().begin(); it!=members().end(); ++it)
keys.append(it.key(), i18n("size: %1 bytes").tqarg(it.data()->nbBytes()));
keys.append(it.key(), i18n("size: %1 bytes").arg(it.data()->nbBytes()));
return keys;
}

@ -212,7 +212,7 @@ Coff::Symbol::Symbol(const Object &object, const TQByteArray &data, uint start,
else if ( _name==".ident" ) auxType = AuxSymbolType::Identifier;
else if ( _sclass==SymbolClass::Filename ) auxType = AuxSymbolType::File;
else if ( _sclass==SymbolClass::Section ) auxType = AuxSymbolType::Section;
if ( auxType!=AuxSymbolType::Nb_Types && nbAux==0 ) log.log(Log::LineType::Warning, i18n("Symbol without needed auxilliary symbol (type=%1)").tqarg(auxType.type()));
if ( auxType!=AuxSymbolType::Nb_Types && nbAux==0 ) log.log(Log::LineType::Warning, i18n("Symbol without needed auxilliary symbol (type=%1)").arg(auxType.type()));
Q_ASSERT( (offset-start)==object.size(SymbolSize) );
_aux.resize(nbAux);
for (uint i=0; i<nbAux; i++) {
@ -245,14 +245,14 @@ Coff::Relocation::Relocation(const Object &object, const Section &section,
TQ_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return;
_address = v;
if ( _address>section.size() ) log.log(Log::LineType::Warning, i18n("Relocation address beyong section size: %1/%2").tqarg(v).tqarg(section.size()));
if ( _address>section.size() ) log.log(Log::LineType::Warning, i18n("Relocation address beyong section size: %1/%2").arg(v).arg(section.size()));
if ( !getULong(data, offset, 4, log, v) ) return;
if ( v>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Relocation has unknown symbol: %1").tqarg(v));
log.log(Log::LineType::Error, i18n("Relocation has unknown symbol: %1").arg(v));
return;
}
if ( object.symbol(v)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Relocation is an auxiliary symbol: %1").tqarg(v));
log.log(Log::LineType::Error, i18n("Relocation is an auxiliary symbol: %1").arg(v));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(v));
@ -283,11 +283,11 @@ Coff::CodeLine::CodeLine(const Object &object, const Section &section,
//qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1());
} else {
if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").tqarg(tmp));
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp));
return;
}
if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").tqarg(tmp));
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(tmp));
@ -296,11 +296,11 @@ Coff::CodeLine::CodeLine(const Object &object, const Section &section,
}
} else {
if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").tqarg(tmp));
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp));
return;
}
if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").tqarg(tmp));
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(tmp));
@ -318,7 +318,7 @@ Coff::CodeLine::CodeLine(const Object &object, const Section &section,
}
// if ( _symbol && _symbol->_class!=Symbol::CFile )
// log.log(Log::LineType::Warning, i18n("Line without file symbol associated (%1:%2 %3).")
// .tqarg(_section._name).tqarg(toHexLabel(_address, nbChars(_address))).tqarg(_symbol->_class));
// .arg(_section._name).arg(toHexLabel(_address, nbChars(_address))).arg(_symbol->_class));
}
//----------------------------------------------------------------------------
@ -343,7 +343,7 @@ Coff::Section::Section(const Device::Data &device, const Object &object,
_address = v;
if ( !getULong(data, offset, 4, log, v) ) return;
//if ( _address!=v ) log.log(Log::LineType::Warning, i18n("Virtual address (%1) does not match physical address (%2) in %3.")
// .tqarg(toHexLabel(v, 4)).tqarg(toHexLabel(_address, 4)).tqarg(_name));
// .arg(toHexLabel(v, 4)).arg(toHexLabel(_address, 4)).arg(_name));
if ( !getULong(data, offset, 4, log, v) ) return;
_size = v;
if ( !getULong(data, offset, 4, log, v) ) return;
@ -451,25 +451,25 @@ bool Coff::Object::parse(Log::Base &log)
uint offset = 0;
if ( !initParse(CoffType::Object, data, offset, log) ) return false;
if ( _format==Format::Nb_Types ) {
log.log(Log::LineType::Error, i18n("COFF format not supported: magic number is %1.").tqarg(toHexLabel(_magic, 4)));
log.log(Log::LineType::Error, i18n("COFF format not supported: magic number is %1.").arg(toHexLabel(_magic, 4)));
return false;
}
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").tqarg(toHexLabel(_magic, 4)));
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").arg(toHexLabel(_magic, 4)));
if ( !parseHeader(data, offset, log) ) return false;
// optionnal header
Q_ASSERT( offset==size(HeaderSize) );
if ( !getULong(data, offset, 2, log, _optHeaderMagic) ) return false;
log.log(Log::DebugLevel::Extra, TQString("COFF optionnal header format: %1").tqarg(toHexLabel(_optHeaderMagic, 4)));
log.log(Log::DebugLevel::Extra, TQString("COFF optionnal header format: %1").arg(toHexLabel(_optHeaderMagic, 4)));
_optHeaderFormat = OptHeaderFormat::Nb_Types;
uint i = 0;
for (; OPT_HEADER_DATA[i].optHeaderFormat!=OptHeaderFormat::Nb_Types; i++) if ( _optHeaderMagic==OPT_HEADER_DATA[i].magic ) break;
_optHeaderFormat = OPT_HEADER_DATA[i].optHeaderFormat;
if ( _optHeaderFormat==OptHeaderFormat::Nb_Types ) {
log.log(Log::LineType::Warning, i18n("Optional header format not supported: magic number is %1.").tqarg(toHexLabel(_optHeaderMagic, 4)));
log.log(Log::LineType::Warning, i18n("Optional header format not supported: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2;
} else if ( !OPT_HEADER_DATA[i].parsed ) {
log.log(Log::DebugLevel::Normal, TQString("Optional header not parsed: magic number is %1.").tqarg(toHexLabel(_optHeaderMagic, 4)));
log.log(Log::DebugLevel::Normal, TQString("Optional header not parsed: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2;
} else if ( !parseOptionnalHeader(data, offset, log) ) return false;
@ -535,7 +535,7 @@ bool Coff::Object::parseHeader(const TQByteArray &data, uint &offset, Log::Base
_nbSymbols = v;
if ( !getULong(data, offset, 2, log, v) ) return false;
if ( v!=size(OptHeaderSize) ) {
log.log(Log::LineType::Error, i18n("Optionnal header size is not %1: %2").tqarg(size(OptHeaderSize)).tqarg(v));
log.log(Log::LineType::Error, i18n("Optionnal header size is not %1: %2").arg(size(OptHeaderSize)).arg(v));
return false;
}
if ( !getULong(data, offset, 2, log, v) ) return false;
@ -561,23 +561,23 @@ bool Coff::Object::parseOptionnalHeader(const TQByteArray &data, uint &offset, L
// #### at least for C18 compiler, it can be compiled for generic processor: in such case
// the pic type will be 18C452 in non-extended mode and 18F4620 for extended mode...
TQString name = Coff::findId(v);
log.log(Log::DebugLevel::Normal, TQString("Device name: \"%1\"").tqarg(name));
log.log(Log::DebugLevel::Normal, TQString("Device name: \"%1\"").arg(name));
if ( name.isEmpty() ) {
log.log(Log::DebugLevel::Normal, TQString("Unknown processor type: %1").tqarg(toHexLabel(v, 4)));
log.log(Log::LineType::Error, i18n("Could not determine processor (%1).").tqarg(toHexLabel(v, 4)));
log.log(Log::DebugLevel::Normal, TQString("Unknown processor type: %1").arg(toHexLabel(v, 4)));
log.log(Log::LineType::Error, i18n("Could not determine processor (%1).").arg(toHexLabel(v, 4)));
return false;
} else if ( _device==0 ) _device = Device::lister().data(name);
else if ( name!=_device->name() ) log.log(Log::DebugLevel::Normal, TQString("Different processor name: %1").tqarg(name));
else if ( name!=_device->name() ) log.log(Log::DebugLevel::Normal, TQString("Different processor name: %1").arg(name));
if ( !getULong(data, offset, 4, log, v) ) return false;
const Pic::Data *pdata = static_cast<const Pic::Data *>(_device);
if (pdata) {
uint nbBits = pdata->nbBitsWord(Pic::MemoryRangeType::Code) / pdata->addressIncrement(Pic::MemoryRangeType::Code);
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Rom width is not %1: %2").tqarg(nbBits).tqarg(v));
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Rom width is not %1: %2").arg(nbBits).arg(v));
}
if ( !getULong(data, offset, 4, log, v) ) return false;
if (pdata) {
uint nbBits = pdata->registersData().nbBits();
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Ram width is not %1: %2").tqarg(nbBits).tqarg(v));
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Ram width is not %1: %2").arg(nbBits).arg(v));
}
}
return true;

@ -249,12 +249,12 @@ TQString Coff::TextObject::disassembly() const
Log::KeyList Coff::TextObject::information() const
{
Log::KeyList keys;
keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").tqarg(format().label()).tqarg(toHexLabel(format().data().magic, 4)));
keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").arg(format().label()).arg(toHexLabel(format().data().magic, 4)));
TQString name = (format()==Format::PIC30 || device()==0 ? "?" : device()->name());
keys.append(i18n("Device:"), name);
OptHeaderFormat ohf = optHeaderFormat();
TQString label = (ohf==OptHeaderFormat::Nb_Types ? i18n("Unknown") : ohf.label());
keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").tqarg(label).tqarg(toHexLabel(optHeaderMagic(), 4)));
keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").arg(label).arg(toHexLabel(optHeaderMagic(), 4)));
keys.append(i18n("No. of sections:"), TQString::number(nbSections()));
keys.append(i18n("No. of symbols:"), TQString::number(nbSymbols()));
keys.append(i18n("No. of variables:"), TQString::number(variables().count()));

@ -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

@ -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;

@ -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
}

@ -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;
}

@ -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);
}
//----------------------------------------------------------------------------

@ -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);

@ -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;

@ -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:

@ -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())
{

@ -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(KDE_VERSION_STRING));
printQ( TQString("TQt: %1\n").arg(qVersion()));
// printQ( TQString("KDE: %1\n").arg(KDE_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++;

@ -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

@ -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;
}

@ -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
}

@ -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 ) {

@ -232,8 +232,8 @@ TQString Device::htmlInfo(const Device::Data &data, const TQString &deviceHref,
if ( i!=0 ) s += ", ";
if ( deviceHref.isEmpty() ) s += data.alternatives()[i].upper();
else {
TQString href = deviceHref.tqarg(data.alternatives()[i].upper());
s += TQString("<a href=\"%1\">%2</a>").tqarg(href).tqarg(data.alternatives()[i].upper());
TQString href = deviceHref.arg(data.alternatives()[i].upper());
s += TQString("<a href=\"%1\">%2</a>").arg(href).arg(data.alternatives()[i].upper());
}
}
doc += htmlTableRow(i18n("Alternatives"), s);
@ -247,7 +247,7 @@ TQString Device::htmlInfo(const Device::Data &data, const TQString &deviceHref,
TQString s;
for (uint i=0; i<data.packages().count(); i++)
for (uint k=0; k<data.packages()[i].types.count(); k++)
s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + TQString("[%1] ").tqarg(data.packages()[i].pins.count());
s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + TQString("[%1] ").arg(data.packages()[i].pins.count());
doc += htmlTableRow(i18n("Packaging"), s);
doc += "</table>";
@ -260,7 +260,7 @@ TQString Device::htmlPinDiagrams(const Device::Data &data, const TQString &image
// pins
const Package *package = 0;
for (uint i=0; Package::TYPE_DATA[i].name; i++) {
if ( Package::TYPE_DATA[i].tqshape!=Package::Bar ) continue;
if ( Package::TYPE_DATA[i].shape!=Package::Bar ) continue;
package = barPackage(Package::TYPE_DATA[i].name, data);
if (package) break;
}

@ -70,7 +70,7 @@ public:
enum { MAX_NB = 9 };
struct TypeData {
const char *name, *label;
Shape tqshape;
Shape shape;
uint nbPins[MAX_NB];
};
static const TypeData TYPE_DATA[];

@ -31,7 +31,7 @@ Device::Memory::WarningTypes Device::Memory::fromHexBuffer(const HexBuffer &hb,
if ( !it.data().isInitialized() || inRange[it.key()] ) continue;
if ( !(result & ValueOutsideRange) ) {
result |= ValueOutsideRange;
warnings += i18n("At least one value (at address %1) is defined outside memory ranges.").tqarg(toHexLabel(it.key(), 8));
warnings += i18n("At least one value (at address %1) is defined outside memory ranges.").arg(toHexLabel(it.key(), 8));
}
break;
}

@ -136,10 +136,10 @@ bool HexBuffer::fetchNextBlock(const_iterator& it, const const_iterator &end, in
TQString HexBuffer::ErrorData::message() const
{
switch (type) {
case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").tqarg(line);
case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").arg(line);
case UnexpectedEOF: return i18n("Unexpected end-of-file.");
case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").tqarg(line);
case WrongCRC: return i18n("CRC mismatch (line %1).").tqarg(line);
case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").arg(line);
case WrongCRC: return i18n("CRC mismatch (line %1).").arg(line);
}
Q_ASSERT(false);
return TQString();

@ -48,7 +48,7 @@ Register::Type Register::TypeData::type() const
TQString Register::TypeData::toString() const
{
return TQString("%1 %2 %3").tqarg(toLabel(_address)).tqarg(_nbChars).tqarg(_name);
return TQString("%1 %2 %3").arg(toLabel(_address)).arg(_nbChars).arg(_name);
}
Register::TypeData Register::TypeData::fromString(const TQString &s)

@ -43,7 +43,7 @@ void Register::PortBitListViewItem::updateView()
else text += (pdata[_bit].drivenState==Device::IoHigh ? "1" : "0");
}
setText(2, text);
tqrepaint();
repaint();
}
void Register::PortBitListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align)
@ -114,7 +114,7 @@ void Register::ListViewItem::updateView()
if ( _data.type()!=Special ) setText(0, toHexLabel(_data.address(), nbCharsAddress()) + ":");
setText(1, label());
setText(2, text());
tqrepaint();
repaint();
for (uint i=0; i<_items.count(); i++) _items[i]->updateView();
}
@ -145,8 +145,8 @@ TQString Register::ListViewItem::tooltip(int col) const
if ( isprint(c) ) s = c + s;
else s = "." + s;
}
return TQString("%1 - %2 - \"%3\"").tqarg(toHexLabel(value, _data.nbChars()))
.tqarg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).tqarg(s);
return TQString("%1 - %2 - \"%3\"").arg(toHexLabel(value, _data.nbChars()))
.arg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).arg(s);
}
TQWidget *Register::ListViewItem::editWidgetFactory(int col) const

@ -18,7 +18,7 @@ Device::Memory *Mem24::Group::createMemory(const Device::Data &data) const
TQString Mem24::Group::informationHtml(const Device::Data &data) const
{
const Mem24::Data &mdata = static_cast<const Mem24::Data &>(data);
TQString tmp = i18n("%1 bytes").tqarg(formatNumber(mdata.nbBytes()));
TQString tmp = i18n("%1 bytes").arg(formatNumber(mdata.nbBytes()));
return htmlTableRow(i18n("Memory Size"), tmp);
}
@ -35,7 +35,7 @@ TQPixmap Mem24::Group::memoryGraph(const Device::Data &data) const
data.endAddress = offset - 1;
data.start = toHexLabel(data.startAddress, mdata.nbCharsAddress());
data.end = toHexLabel(data.endAddress, mdata.nbCharsAddress());
data.label = i18n("Block #%1").tqarg(i+1);
data.label = i18n("Block #%1").arg(i+1);
ranges.append(data);
}
return Device::memoryGraph(ranges);

@ -84,7 +84,7 @@ void Mem24::Memory::fromHexBuffer(const HexBuffer &hb, WarningTypes &result,
if ( !(result & ValueTooLarge) && !_data[k].isInside(mask) ) {
result |= ValueTooLarge;
warnings += i18n("At least one word (at offset %1) is larger (%2) than the corresponding mask (%3).")
.tqarg(toHexLabel(k, 8)).tqarg(toHexLabel(_data[k], 8)).tqarg(toHexLabel(mask, 8));
.arg(toHexLabel(k, 8)).arg(toHexLabel(_data[k], 8)).arg(toHexLabel(mask, 8));
}
_data[k] = _data[k].maskWith(mask);
}

@ -38,9 +38,9 @@ bool Programmer::Mem24DeviceSpecific::verifyByte(uint index, BitValue d, const V
Address address = index;
if ( vdata.actions & BlankCheckVerify )
log(Log::LineType::Error, i18n("Device memory is not blank (at address %1: reading %2 and expecting %3).")
.tqarg(toHexLabel(address, device().nbCharsAddress())).tqarg(toHexLabel(d, 2)).tqarg(toHexLabel(v, 2)));
.arg(toHexLabel(address, device().nbCharsAddress())).arg(toHexLabel(d, 2)).arg(toHexLabel(v, 2)));
else log(Log::LineType::Error, i18n("Device memory doesn't match hex file (at address %1: reading %2 and expecting %3).")
.tqarg(toHexLabel(address, device().nbCharsAddress())).tqarg(toHexLabel(d, 2)).tqarg(toHexLabel(v, 2)));
.arg(toHexLabel(address, device().nbCharsAddress())).arg(toHexLabel(d, 2)).arg(toHexLabel(v, 2)));
return false;
}

@ -49,7 +49,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const
if ( !pinLabels.contains("VSS") ) qFatal("No VSS pin specified");
TQMap<TQString, uint>::const_iterator it;
for (it=pinLabels.begin(); it!=pinLabels.end(); ++it)
if ( it.data()!=1 ) qFatal(TQString("Duplicated pin %1").tqarg(it.key()));
if ( it.data()!=1 ) qFatal(TQString("Duplicated pin %1").arg(it.key()));
}
}; // class

@ -212,17 +212,17 @@ TQStringList Pic::Data::idNames(const TQMap<TQString, Device::IdData> &ids) cons
case Architecture::P18C:
case Architecture::P18F:
case Architecture::P18J:
list += i18n("%1 (rev. %2)").tqarg(it.key()).tqarg(toLabel(it.data().revision));
list += i18n("%1 (rev. %2)").arg(it.key()).arg(toLabel(it.data().revision));
break;
case Architecture::P24F:
list += i18n("%1 (rev. %2.%3)").tqarg(it.key()).tqarg(toLabel(it.data().revision)).tqarg(toLabel(it.data().minorRevision));
list += i18n("%1 (rev. %2.%3)").arg(it.key()).arg(toLabel(it.data().revision)).arg(toLabel(it.data().minorRevision));
break;
case Architecture::P30F:
list += i18n("%1 (proc. %2; rev. %3.%4)").tqarg(it.key()).tqarg(toLabel(it.data().process)).tqarg(toLabel(it.data().revision)).tqarg(toLabel(it.data().minorRevision));
list += i18n("%1 (proc. %2; rev. %3.%4)").arg(it.key()).arg(toLabel(it.data().process)).arg(toLabel(it.data().revision)).arg(toLabel(it.data().minorRevision));
break;
case Architecture::P24H:
case Architecture::P33F:
list += i18n("%1 (rev. %2)").tqarg(it.key()).tqarg(toLabel(it.data().revision));
list += i18n("%1 (rev. %2)").arg(it.key()).arg(toLabel(it.data().revision));
break;
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
@ -236,14 +236,14 @@ bool Pic::Data::checkCalibration(const Device::Array &data, TQString *message) c
for (uint i=0; i<data.count(); i++) {
TQString address = toHexLabel(range(MemoryRangeType::Cal).start + i*addressIncrement(MemoryRangeType::Cal), nbCharsAddress());
if ( data[i]==mask(MemoryRangeType::Cal) ) {
if (message) *message = i18n("Calibration word at address %1 is blank.").tqarg(address);
if (message) *message = i18n("Calibration word at address %1 is blank.").arg(address);
return false;
}
}
if ( data.count()==1 ) {
if ( data[0].maskWith(_calibration.opcodeMask)!=_calibration.opcode ) {
if (message) *message = i18n("Calibration word is not a compatible opcode (%2).")
.tqarg(toHexLabel(_calibration.opcode, nbCharsWord(MemoryRangeType::Code)));
.arg(toHexLabel(_calibration.opcode, nbCharsWord(MemoryRangeType::Code)));
return false;
}
}

@ -289,7 +289,7 @@ TQMap<TQString, Pic::Config::MapData> &Pic::Config::masks()
(*_masks)[DATA[i].mask.name] = MapData(i, -1);
if ( DATA[i].type==MemoryRange ) {
for (uint k=0; k<Protection::MAX_NB_BLOCKS; k++)
(*_masks)[TQString("%1_%2").tqarg(DATA[i].mask.name).tqarg(k)] = MapData(i, k);
(*_masks)[TQString("%1_%2").arg(DATA[i].mask.name).arg(k)] = MapData(i, k);
}
}
}
@ -305,7 +305,7 @@ TQString Pic::Config::maskLabel(const TQString &mask)
{
const MapData &mp = masks()[mask];
TQString s = i18n(DATA[mp.index].mask.label);
if ( mp.block>=0 ) return i18n("%1 for block %2").tqarg(s).tqarg(mp.block);
if ( mp.block>=0 ) return i18n("%1 for block %2").arg(s).arg(mp.block);
return s;
}

@ -30,7 +30,7 @@ Pic::Protection::Family Pic::Protection::family() const
{
if ( _config.findMask("WRTBS") ) return CodeGuard;
TQString mask = maskName(ProgramProtected, MemoryRangeType::Code);
if ( _config.findMask(TQString("%1_%2").tqarg(mask).tqarg(0)) ) return BlockProtection;
if ( _config.findMask(TQString("%1_%2").arg(mask).arg(0)) ) return BlockProtection;
if ( _config.findMask(mask) ) return BasicProtection;
return NoProtection;
}
@ -79,7 +79,7 @@ TQString Pic::Protection::blockMaskName(Type type, uint block) const
if ( type==StandardSecurity || type==HighSecurity ) return (block==0 ? "SSSEC" : "GSSEC");
return TQString();
}
return TQString("%1_%2").tqarg(maskName(type, MemoryRangeType::Code)).tqarg(block);
return TQString("%1_%2").arg(maskName(type, MemoryRangeType::Code)).arg(block);
}
TQString Pic::Protection::maskName(Type type, MemoryRangeType mtype) const
@ -341,7 +341,7 @@ uint Pic::Protection::nbBlocks() const
{
if ( family()==CodeGuard ) return 2; // codeguard : secure segment + general segment
for (uint i=0; i<MAX_NB_BLOCKS; i++)
if ( _config.findMask(TQString("CP_%1").tqarg(i))==0 ) return i;
if ( _config.findMask(TQString("CP_%1").arg(i))==0 ) return i;
return MAX_NB_BLOCKS;
}
@ -357,5 +357,5 @@ TQString Pic::Protection::blockLabel(uint i) const
if ( i==0 ) return i18n("Secure Segment");
return i18n("General Segment");
}
return i18n("Block #%1").tqarg(i);
return i18n("Block #%1").arg(i);
}

@ -73,7 +73,7 @@ TQString Pic::RegistersData::label(Address address) const
{
switch ( type(address) ) {
case UnusedRegister: return "---";
case Mirrored: return i18n("Mirror of %1").tqarg(toHexLabel(mirroredAddress(address), nbCharsAddress()));
case Mirrored: return i18n("Mirror of %1").arg(toHexLabel(mirroredAddress(address), nbCharsAddress()));
case Gpr: return "<GPR>";
case Sfr: return sfrNames[address];
}

@ -56,7 +56,7 @@ void Pic::GroupUI::fillWatchListContainer(ListContainer *container, TQValueVecto
list = Pic::gprList(data, coff);
for (uint k=0; k<rdata.nbBanks; k++) {
if ( !rdata.isBankUsed(k) ) continue;
ListContainer *bbranch = (rdata.nbBanks==1 ? branch : branch->appendBranch(i18n("Bank %1").tqarg(k)));
ListContainer *bbranch = (rdata.nbBanks==1 ? branch : branch->appendBranch(i18n("Bank %1").arg(k)));
uint nb = 0;
for (uint i=0; i<list.count(); i++) {
if ( rdata.bankFromAddress(list[i].data().address())!=k ) continue;

@ -112,14 +112,14 @@ void Pic::MemoryEditorLegend::updateDisplay()
if (_boot.label) {
AddressRange r = memory().bootRange();
if ( r.isEmpty() ) _boot.label->setText(i18n("not present"));
else _boot.label->setText(TQString("[%1:%2]").tqarg(toHex(r.start, nbChars)).tqarg(toHex(r.end, nbChars)));
else _boot.label->setText(TQString("[%1:%2]").arg(toHex(r.start, nbChars)).arg(toHex(r.end, nbChars)));
_boot.button->setEnabled(!r.isEmpty());
_boot.setProtected(memory().isBootProtected(ptype));
}
for (uint i=0; i<_blocks.count(); i++) {
AddressRange r = memory().blockRange(i);
if ( r.isEmpty() ) _blocks[i].label->setText(i18n("not present"));
else _blocks[i].label->setText(TQString("[%1:%2]").tqarg(toHex(r.start, nbChars)).tqarg(toHex(r.end, nbChars)));
else _blocks[i].label->setText(TQString("[%1:%2]").arg(toHex(r.start, nbChars)).arg(toHex(r.end, nbChars)));
_blocks[i].button->setEnabled(!r.isEmpty());
_blocks[i].setProtected(memory().isBlockProtected(ptype, i));
}
@ -251,10 +251,10 @@ void Pic::MemoryTypeEditor::init(bool first)
uint nbChars = device().nbCharsWord(type());
TQString add;
if ( type()==MemoryRangeType::UserId ) add = i18n(" - recommended mask: %1").tqarg(toHexLabel(device().userIdRecommendedMask(), nbChars));
if ( type()==MemoryRangeType::UserId ) add = i18n(" - recommended mask: %1").arg(toHexLabel(device().userIdRecommendedMask(), nbChars));
if ( type()==MemoryRangeType::Cal && _hexview ) add = i18n(" - not programmed by default");
TQString comment = i18n("%1-bit words - mask: %2")
.tqarg(device().nbBitsWord(type())).tqarg(toHexLabel(device().mask(type()), nbChars));
.arg(device().nbBitsWord(type())).arg(toHexLabel(device().mask(type()), nbChars));
_comment->setText(comment + add);
}

@ -36,6 +36,6 @@ void Programmer::PicAdvancedDialog::updateDisplay()
if ( !base().group().canReadVoltage(Pic::VoltageType(i)) ) continue;
double v = base().voltage(Pic::VoltageType(i));
if ( v==::Programmer::UNKNOWN_VOLTAGE ) _voltages[i]->setText("---");
else _voltages[i]->setText(TQString("%1 V").tqarg(v));
else _voltages[i]->setText(TQString("%1 V").arg(v));
}
}

@ -51,14 +51,14 @@ Pic::BankWidget::BankWidget(uint i, TQWidget *parent)
} else {
_bankCombo = new TQComboBox(this);
for (uint k=1; k<2*rdata.nbBanks-1; k++) {
_bankCombo->insertItem((k%2)==0 ? i18n("Bank %1 (low)").tqarg(k/2) : i18n("Bank %1 (high)").tqarg(k/2));
_bankCombo->insertItem((k%2)==0 ? i18n("Bank %1 (low)").arg(k/2) : i18n("Bank %1 (high)").arg(k/2));
}
if ( _bindex==3 ) _bankCombo->setCurrentItem(1);
connect(_bankCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(bankChanged()));
top->addMultiCellWidget(_bankCombo, row,row, 0,6, AlignHCenter);
}
} else {
TQLabel *label = new TQLabel(i18n("Bank %1").tqarg(i), this);
TQLabel *label = new TQLabel(i18n("Bank %1").arg(i), this);
label->setAlignment(AlignCenter);
top->addMultiCellWidget(label, row,row, 0,6, AlignHCenter);
}

@ -27,14 +27,14 @@ TQString Pic::Group::informationHtml(const Device::Data &data) const
TQString s = htmlTableRow(i18n("Memory Type"), data.memoryTechnology().label());
if ( pdata.isPresent(MemoryRangeType::Code) ) {
uint nbw = pdata.nbWords(MemoryRangeType::Code);
TQString tmp = i18n("%1 words").tqarg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").tqarg(pdata.nbBitsWord(MemoryRangeType::Code));
TQString tmp = i18n("%1 words").arg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").arg(pdata.nbBitsWord(MemoryRangeType::Code));
s += htmlTableRow(MemoryRangeType(MemoryRangeType::Code).label(), tmp);
}
if ( pdata.isPresent(MemoryRangeType::Eeprom) ) {
uint nbw = pdata.nbWords(MemoryRangeType::Eeprom);
TQString tmp = i18n("%1 bytes").tqarg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").tqarg(pdata.nbBitsWord(MemoryRangeType::Eeprom));
TQString tmp = i18n("%1 bytes").arg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").arg(pdata.nbBitsWord(MemoryRangeType::Eeprom));
if ( !(pdata.range(MemoryRangeType::Eeprom).properties & Programmable) ) tmp += i18n(" (not programmable)");
s += htmlTableRow(MemoryRangeType(MemoryRangeType::Eeprom).label(), tmp);
}

@ -543,7 +543,7 @@ void Pic::Memory::fromHexBuffer(MemoryRangeType type, const HexBuffer &hb, Warni
if ( !(result & ValueTooLarge) && _ranges[type][wOffset].maskWith(mask)!=_ranges[type][wOffset] ) {
result |= ValueTooLarge;
warnings += i18n("At least one word (at offset %1) is larger (%2) than the corresponding mask (%3).")
.tqarg(toHexLabel(offset, 8)).tqarg(toHexLabel(_ranges[type][wOffset], 8)).tqarg(toHexLabel(mask, 8));
.arg(toHexLabel(offset, 8)).arg(toHexLabel(_ranges[type][wOffset], 8)).arg(toHexLabel(mask, 8));
}
_ranges[type][wOffset] = _ranges[type][wOffset].maskWith(mask);
}

@ -86,9 +86,9 @@ TQString Debugger::P16FSpecific::statusString() const
uint bank = (status.bit(5) ? 1 : 0) + (status.bit(6) ? 2 : 0);
BitValue wreg = Register::list().value(wregTypeData());
return TQString("W:%1 %2 %3 %4 PC:%5 Bank:%6")
.tqarg(toHexLabel(wreg, rdata.nbChars())).tqarg(status.bit(2) ? "Z" : "z")
.tqarg(status.bit(1) ? "DC" : "dc").tqarg(status.bit(0) ? "C" : "c")
.tqarg(toHexLabel(_base.pc(), device().nbCharsAddress())).tqarg(bank);
.arg(toHexLabel(wreg, rdata.nbChars())).arg(status.bit(2) ? "Z" : "z")
.arg(status.bit(1) ? "DC" : "dc").arg(status.bit(0) ? "C" : "c")
.arg(toHexLabel(_base.pc(), device().nbCharsAddress())).arg(bank);
}
//----------------------------------------------------------------------------
@ -111,8 +111,8 @@ TQString Debugger::P18FSpecific::statusString() const
BitValue bsr = Register::list().value(base().registerTypeData("BSR"));
BitValue wreg = Register::list().value(wregTypeData());
return TQString("W:%1 %2 %3 %4 %5 %6 PC:%7 Bank:%8")
.tqarg(toHexLabel(wreg, rdata.nbChars())).tqarg(status.bit(4) ? "N" : "n")
.tqarg(status.bit(3) ? "OV" : "ov").tqarg(status.bit(2) ? "Z" : "z")
.tqarg(status.bit(1) ? "DC" : "dc").tqarg(status.bit(0) ? "C" : "c")
.tqarg(toHexLabel(base().pc(), device().nbCharsAddress())).tqarg(toLabel(bsr));
.arg(toHexLabel(wreg, rdata.nbChars())).arg(status.bit(4) ? "N" : "n")
.arg(status.bit(3) ? "OV" : "ov").arg(status.bit(2) ? "Z" : "z")
.arg(status.bit(1) ? "DC" : "dc").arg(status.bit(0) ? "C" : "c")
.arg(toHexLabel(base().pc(), device().nbCharsAddress())).arg(toLabel(bsr));
}

@ -106,9 +106,9 @@ bool Programmer::PicBase::readVoltages()
if ( !group().canReadVoltage(Pic::VoltageType(i)) ) continue;
if ( _voltages[i].error==true ) {
ok = false;
log(Log::LineType::Error, i18n(" %1 = %2 V: error in voltage level.").tqarg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).tqarg(_voltages[i].value));
log(Log::LineType::Error, i18n(" %1 = %2 V: error in voltage level.").arg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).arg(_voltages[i].value));
} else if ( _voltages[i].value!=UNKNOWN_VOLTAGE )
log(Log::DebugLevel::Normal, TQString(" %1 = %2 V").tqarg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).tqarg(_voltages[i].value));
log(Log::DebugLevel::Normal, TQString(" %1 = %2 V").arg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).arg(_voltages[i].value));
}
return ok;
}
@ -136,10 +136,10 @@ bool Programmer::PicBase::initProgramming(Task)
const Pic::VoltageData &tvpp = device()->voltage(Pic::Vpp);
if ( vpp()<tvpp.min )
log(Log::LineType::Warning, i18n("Vpp (%1 V) is lower than the minimum required voltage (%2 V).")
.tqarg(vpp()).tqarg(tvpp.min));
.arg(vpp()).arg(tvpp.min));
if ( vpp()>tvpp.max ) {
TQString s = i18n("Vpp (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.")
.tqarg(vpp()).tqarg(tvpp.max);
.arg(vpp()).arg(tvpp.max);
log(Log::LineType::Warning, s);
if ( !askContinue(s) ) {
logUserAbort();
@ -153,15 +153,15 @@ bool Programmer::PicBase::initProgramming(Task)
if ( vdd()<tvdd.min ) {
if ( type==Pic::VddBulkErase && device()->voltage(Pic::VddWrite).min!=tvdd.min )
log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for high-voltage programming\n(piklab only supports high-voltage programming at the moment).\nMinimum required is %2 V.")
.tqarg(vdd()).tqarg(tvdd.min));
.arg(vdd()).arg(tvdd.min));
else if ( type==Pic::VddRead && device()->voltage(Pic::VddWrite).min!=tvdd.min )
log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for reading\nMinimum required is %2 V.")
.tqarg(vdd()).tqarg(tvdd.min));
.arg(vdd()).arg(tvdd.min));
else log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for programming\nMinimum required is %2 V.")
.tqarg(vdd()).tqarg(tvdd.min));
.arg(vdd()).arg(tvdd.min));
} else if ( vdd()>tvdd.max ) {
TQString s = i18n("Vdd (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.")
.tqarg(vdd()).tqarg(tvdd.max);
.arg(vdd()).arg(tvdd.max);
log(Log::LineType::Warning, s);
if ( !askContinue(s) ) {
logUserAbort();
@ -178,7 +178,7 @@ bool Programmer::PicBase::initProgramming(Task)
_hasProtectedCode = _deviceMemory->isProtected(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code);
_hasProtectedEeprom = _deviceMemory->isProtected(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Eeprom);
log(Log::DebugLevel::Normal, TQString(" protected: code=%1 data=%2")
.tqarg(_hasProtectedCode ? "true" : "false").tqarg(_hasProtectedEeprom ? "true" : "false"));
.arg(_hasProtectedCode ? "true" : "false").arg(_hasProtectedEeprom ? "true" : "false"));
// read calibration
if ( !readCalibration() ) return false;
}
@ -250,14 +250,14 @@ bool Programmer::PicBase::verifyDeviceId()
{
if ( !specific()->canReadRange(Pic::MemoryRangeType::DeviceId ) ) return true;
if ( !device()->isReadable(Pic::MemoryRangeType::DeviceId) ) {
log(Log::LineType::Information, i18n("Device not autodetectable: continuing with the specified device name \"%1\"...").tqarg(device()->name()));
log(Log::LineType::Information, i18n("Device not autodetectable: continuing with the specified device name \"%1\"...").arg(device()->name()));
return true;
}
BitValue rawId = readDeviceId();
if ( hasError() ) return false;
uint nbChars = device()->nbWords(Pic::MemoryRangeType::DeviceId) * device()->nbCharsWord(Pic::MemoryRangeType::DeviceId);
if ( rawId==0x0 || rawId==device()->mask(Pic::MemoryRangeType::DeviceId) ) {
log(Log::LineType::Error, i18n("Missing or incorrect device (Read id is %1).").tqarg(toHexLabel(rawId, nbChars)));
log(Log::LineType::Error, i18n("Missing or incorrect device (Read id is %1).").arg(toHexLabel(rawId, nbChars)));
return false;
}
TQMap<TQString, Device::IdData> ids;
@ -270,18 +270,18 @@ bool Programmer::PicBase::verifyDeviceId()
}
TQString message;
if ( ids.count()!=0 ) {
log(Log::LineType::Information, i18n("Read id: %1").tqarg(device()->idNames(ids).join("; ")));
log(Log::LineType::Information, i18n("Read id: %1").arg(device()->idNames(ids).join("; ")));
if ( ids.contains(device()->name()) ) return true;
message = i18n("Read id does not match the specified device name \"%1\".").tqarg(device()->name());
message = i18n("Read id does not match the specified device name \"%1\".").arg(device()->name());
} else {
log(Log::LineType::Warning, i18n(" Unknown or incorrect device (Read id is %1).").tqarg(toHexLabel(rawId, nbChars)));
log(Log::LineType::Warning, i18n(" Unknown or incorrect device (Read id is %1).").arg(toHexLabel(rawId, nbChars)));
message = i18n("Unknown device.");
}
if ( !askContinue(message) ) {
logUserAbort();
return false;
}
log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").tqarg(device()->name()));
log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").arg(device()->name()));
return true;
}
@ -306,7 +306,7 @@ bool Programmer::PicBase::readCalibration()
Device::Array data;
if ( !specific()->read(Pic::MemoryRangeType::Cal, data, 0) ) return false;
_deviceMemory->setArray(Pic::MemoryRangeType::Cal, data);
log(Log::DebugLevel::Normal, TQString(" Read osccal: %1").tqarg(prettyCalibration(data)));
log(Log::DebugLevel::Normal, TQString(" Read osccal: %1").arg(prettyCalibration(data)));
TQString message;
if ( !device()->checkCalibration(data, &message) ) log(Log::LineType::Warning, " " + message);
if ( device()->isReadable(Pic::MemoryRangeType::CalBackup) ) {
@ -316,7 +316,7 @@ bool Programmer::PicBase::readCalibration()
}
if ( !specific()->read(Pic::MemoryRangeType::CalBackup, data, 0) ) return false;
_deviceMemory->setArray(Pic::MemoryRangeType::CalBackup, data);
log(Log::DebugLevel::Normal, TQString(" Read osccal backup: %1").tqarg(prettyCalibration(data)));
log(Log::DebugLevel::Normal, TQString(" Read osccal backup: %1").arg(prettyCalibration(data)));
if ( !device()->checkCalibration(data, &message) ) log(Log::LineType::Warning, " " + message);
}
}
@ -381,7 +381,7 @@ bool Programmer::PicBase::restoreBandGapBits()
log(Log::LineType::Warning, i18n("Could not restore band gap bits because programmer does not support writing config bits."));
return true;
}
log(Log::DebugLevel::Normal, TQString(" Write config with band gap bits: %2").tqarg(toHexLabel(cdata[0], device()->nbCharsWord(Pic::MemoryRangeType::Config))));
log(Log::DebugLevel::Normal, TQString(" Write config with band gap bits: %2").arg(toHexLabel(cdata[0], device()->nbCharsWord(Pic::MemoryRangeType::Config))));
if ( !programRange(Pic::MemoryRangeType::Config, cdata) ) return false;
if ( !specific()->read(Pic::MemoryRangeType::Config, data, 0) ) return false;
if ( data==cdata ) log(Log::LineType::Information, i18n(" Band gap bits have been preserved."));
@ -464,7 +464,7 @@ bool Programmer::PicBase::internalEraseRange(Pic::MemoryRangeType type)
log(Log::LineType::SoftError, i18n("Cannot erase specified range because of programmer limitations."));
return false;
}
if ( !askContinue(i18n("%1: Erasing this range only is not supported with this programmer. This will erase the whole chip and restore the other memory ranges.").tqarg(type.label())) ) {
if ( !askContinue(i18n("%1: Erasing this range only is not supported with this programmer. This will erase the whole chip and restore the other memory ranges.").arg(type.label())) ) {
logUserAbort();
return false;
}
@ -497,19 +497,19 @@ bool Programmer::PicBase::readRange(Pic::MemoryRangeType type, Pic::Memory *memo
{
if ( !device()->isReadable(type) ) return true;
if ( !specific()->canReadRange(type) ) {
log(Log::LineType::Information, i18n("The selected programmer cannot read %1: operation skipped.").tqarg(type.label()));
log(Log::LineType::Information, i18n("The selected programmer cannot read %1: operation skipped.").arg(type.label()));
return true;
}
VerifyData *vdata = (vd ? new VerifyData(vd->actions, vd->memory) : 0);
if (vdata) {
log(Log::LineType::Information, i18n(" Verify memory: %1").tqarg(type.label()));
log(Log::LineType::Information, i18n(" Verify memory: %1").arg(type.label()));
if ( !(vdata->actions & IgnoreProtectedVerify) ) {
vdata->protectedRanges = static_cast<const Pic::Memory &>(vdata->memory).protectedRanges(Pic::Protection::ProgramProtected, type);
if ( !vdata->protectedRanges.isEmpty() ) log(Log::LineType::Warning, i18n(" Part of device memory is protected (in %1) and cannot be verified.")
.tqarg(type.label()));
.arg(type.label()));
} else vdata->protectedRanges.clear();
} else {
log(Log::LineType::Information, i18n(" Read memory: %1").tqarg(type.label()));
log(Log::LineType::Information, i18n(" Read memory: %1").arg(type.label()));
CRASH_ASSERT(memory);
}
Device::Array data;
@ -562,7 +562,7 @@ bool Programmer::PicBase::programSingle(Pic::MemoryRangeType type, const Pic::Me
bool Programmer::PicBase::programRange(Pic::MemoryRangeType mtype, const Device::Array &data)
{
log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(mtype.label()));
log(Log::LineType::Information, i18n(" Write memory: %1").arg(mtype.label()));
bool only = ( readConfigEntry(Config::OnlyProgramNonMask).toBool()
&& (mtype==Pic::MemoryRangeType::Code || mtype==Pic::MemoryRangeType::Eeprom) );
return specific()->write(mtype, data, !only);
@ -672,15 +672,15 @@ bool Programmer::PicBase::checkProgramCalibration(const Device::Array &data)
{
TQString message, s = prettyCalibration(data);
if ( !device()->checkCalibration(data, &message) ) {
sorry(i18n("The calibration word %1 is not valid.").tqarg(s), message);
sorry(i18n("The calibration word %1 is not valid.").arg(s), message);
return false;
}
return askContinue(i18n("Do you want to overwrite the device calibration with %1?").tqarg(s));
return askContinue(i18n("Do you want to overwrite the device calibration with %1?").arg(s));
}
bool Programmer::PicBase::tryProgramCalibration(const Device::Array &data, bool &success)
{
log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(Pic::MemoryRangeType(Pic::MemoryRangeType::Cal).label()));
log(Log::LineType::Information, i18n(" Write memory: %1").arg(Pic::MemoryRangeType(Pic::MemoryRangeType::Cal).label()));
success = true;
if ( !specific()->write(Pic::MemoryRangeType::Cal, data, true) ) return false;
Device::Array read;
@ -691,7 +691,7 @@ bool Programmer::PicBase::tryProgramCalibration(const Device::Array &data, bool
if ( device()->isWritable(Pic::MemoryRangeType::CalBackup) ) {
if ( !specific()->read(Pic::MemoryRangeType::CalBackup, read, 0) ) return false;
if ( device()->checkCalibration(read) ) return true; // do not overwrite correct backup value
log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(Pic::MemoryRangeType(Pic::MemoryRangeType::CalBackup).label()));
log(Log::LineType::Information, i18n(" Write memory: %1").arg(Pic::MemoryRangeType(Pic::MemoryRangeType::CalBackup).label()));
if ( !specific()->write(Pic::MemoryRangeType::CalBackup, data, true) ) return false;
if ( !specific()->read(Pic::MemoryRangeType::CalBackup, read, 0) ) return false;
for (uint i=0; i<data.count(); i++)

@ -29,10 +29,10 @@ uint Programmer::PicDeviceSpecific::findNonMaskStart(Pic::MemoryRangeType type,
uint start = 0;
for (; start<data.count(); start++)
if ( data[start]!=device().mask(type) ) break;
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("start before align: %1").tqarg(start));
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("start before align: %1").arg(start));
uint align = device().nbWordsWriteAlignment(type);
start -= start % align;
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("start after align: %1 (align=%2)").tqarg(start).tqarg(align));
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("start after align: %1 (align=%2)").arg(start).arg(align));
return start;
}
@ -41,10 +41,10 @@ uint Programmer::PicDeviceSpecific::findNonMaskEnd(Pic::MemoryRangeType type, co
uint end = data.count()-1;
for (; end>0; end--)
if ( data[end]!=device().mask(type) ) break;
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("end before align: %1").tqarg(end));
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("end before align: %1").arg(end));
uint align = device().nbWordsWriteAlignment(type);
if ( (end+1) % align ) end += align - (end+1) % align;
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("end after align: %1 (align=%2)").tqarg(end).tqarg(align));
const_cast<PicDeviceSpecific *>(this)->log(Log::DebugLevel::Normal, TQString("end after align: %1 (align=%2)").arg(end).arg(align));
Q_ASSERT(end<data.count());
return end;
}
@ -99,11 +99,11 @@ bool Programmer::PicHardware::compareWords(Pic::MemoryRangeType type, uint index
Address address = device().range(type).start + inc * index;
if ( actions & ::Programmer::BlankCheckVerify )
log(Log::LineType::SoftError, i18n("Device memory is not blank (in %1 at address %2: reading %3 and expecting %4).")
.tqarg(type.label()).tqarg(toHexLabel(address, device().nbCharsAddress()))
.tqarg(toHexLabel(d, device().nbCharsWord(type))).tqarg(toHexLabel(v, device().nbCharsWord(type))));
.arg(type.label()).arg(toHexLabel(address, device().nbCharsAddress()))
.arg(toHexLabel(d, device().nbCharsWord(type))).arg(toHexLabel(v, device().nbCharsWord(type))));
else log(Log::LineType::SoftError, i18n("Device memory does not match hex file (in %1 at address %2: reading %3 and expecting %4).")
.tqarg(type.label()).tqarg(toHexLabel(address, device().nbCharsAddress()))
.tqarg(toHexLabel(d, device().nbCharsWord(type))).tqarg(toHexLabel(v, device().nbCharsWord(type))));
.arg(type.label()).arg(toHexLabel(address, device().nbCharsAddress()))
.arg(toHexLabel(d, device().nbCharsWord(type))).arg(toHexLabel(v, device().nbCharsWord(type))));
return false;
}

@ -29,7 +29,7 @@ bool getVoltages(ProgVoltageType type, TQDomElement element)
data()->_voltages[type].min = voltages.attribute("min").toDouble(&ok1);
data()->_voltages[type].max = voltages.attribute("max").toDouble(&ok2);
data()->_voltages[type].nominal = voltages.attribute("nominal").toDouble(&ok3);
if ( !ok1 || !ok2 || !ok3 ) qFatal(TQString("Cannot extract voltage value for \"%1\"").tqarg(type.key()));
if ( !ok1 || !ok2 || !ok3 ) qFatal(TQString("Cannot extract voltage value for \"%1\"").arg(type.key()));
if ( data()->_voltages[type].min>data()->_voltages[type].max
|| data()->_voltages[type].nominal<data()->_voltages[type].min
|| data()->_voltages[type].nominal>data()->_voltages[type].max )
@ -50,11 +50,11 @@ bool getMemoryRange(MemoryRangeType type, TQDomElement element)
if ( !ok ) qFatal("Cannot extract end address");
if ( data()->_ranges[type].end<data()->_ranges[type].start ) qFatal("Memory range end is before its start");
uint nbCharsWord = data()->nbCharsWord(type);
if ( data()->nbBitsWord(type)==0 ) qFatal(TQString("Architecture doesn't contain memory range %1").tqarg(type.key()));
if ( data()->nbBitsWord(type)==0 ) qFatal(TQString("Architecture doesn't contain memory range %1").arg(type.key()));
if ( type==MemoryRangeType::UserId ) {
data()->_userIdRecommendedMask = fromHexLabel(range.attribute("rmask"), nbCharsWord, &ok);
if ( !ok ) qFatal("Cannot extract rmask value for user id");
if ( !data()->_userIdRecommendedMask.isInside(data()->mask(type)) ) qFatal(TQString("rmask is not inside mask %1 (%2)").tqarg(toHexLabel(data()->_userIdRecommendedMask, 8)).tqarg(toHexLabel(data()->mask(type), 8)));
if ( !data()->_userIdRecommendedMask.isInside(data()->mask(type)) ) qFatal(TQString("rmask is not inside mask %1 (%2)").arg(toHexLabel(data()->_userIdRecommendedMask, 8)).arg(toHexLabel(data()->mask(type), 8)));
}
if ( range.attribute("hexfile_offset")!="?" ) {
data()->_ranges[type].properties |= Programmable;
@ -100,19 +100,19 @@ void processName(const Pic::Config::Mask &cmask, BitValue pmask, Pic::Config::Va
TQStringList &cnames = cvalue.configNames[Pic::ConfigNameType::Default];
if ( cvalue.name=="invalid" ) {
cvalue.name = TQString();
if ( !cnames.isEmpty() ) qFatal(TQString("No cname should be defined for invalid value in mask %1").tqarg(cmask.name));
if ( !cnames.isEmpty() ) qFatal(TQString("No cname should be defined for invalid value in mask %1").arg(cmask.name));
return;
}
if ( cvalue.name.isEmpty() ) qFatal(TQString("Empty value name in mask %1").tqarg(cmask.name));
if ( cvalue.name.isEmpty() ) qFatal(TQString("Empty value name in mask %1").arg(cmask.name));
if ( cmask.value.isInside(pmask) ) { // protected bits
if ( !cnames.isEmpty() ) qFatal(TQString("Config name should be null for protected config mask \"%1\"").tqarg(cmask.name));
if ( !cnames.isEmpty() ) qFatal(TQString("Config name should be null for protected config mask \"%1\"").arg(cmask.name));
} else {
if ( cnames.isEmpty() && cmask.name!="BSSEC" && cmask.name!="BSSIZ" && cmask.name!="SSSEC" && cmask.name!="SSSIZ" ) {
// ### FIXME: 18J 24H 30F1010/202X
if ( data()->architecture()!=Pic::Architecture::P18J && data()->architecture()!=Pic::Architecture::P24H
&& data()->architecture()!=Pic::Architecture::P24F && data()->architecture()!=Pic::Architecture::P33F
&& data()->name()!="30F1010" && data()->name()!="30F2020" && data()->name()!="30F2023" )
qFatal(TQString("cname not defined for \"%1\" (%2)").tqarg(cvalue.name).tqarg(cmask.name));
qFatal(TQString("cname not defined for \"%1\" (%2)").arg(cvalue.name).arg(cmask.name));
}
if ( cnames.count()==1 && cnames[0]=="_" ) cnames.clear();
for (uint i=0; i<uint(cnames.count()); i++) {
@ -124,11 +124,11 @@ void processName(const Pic::Config::Mask &cmask, BitValue pmask, Pic::Config::Va
BitValue mask = cmask.value.complementInMask(maxValue(NumberBase::Hex, nbChars));
if ( ok && v==(mask | cvalue.value) ) continue;
} else if ( XOR(cnames[i].startsWith("_"), data()->architecture()==Pic::Architecture::P30F) ) continue;
qFatal(TQString("Invalid config name for \"%1\"/\"%2\"").tqarg(cmask.name).tqarg(cvalue.name));
qFatal(TQString("Invalid config name for \"%1\"/\"%2\"").arg(cmask.name).arg(cvalue.name));
}
TQStringList &ecnames = cvalue.configNames[Pic::ConfigNameType::Extra];
for (uint i=0; i<uint(ecnames.count()); i++)
if ( ecnames[i][0]!='_' ) qFatal(TQString("Invalid extra config name for %1").tqarg(cvalue.name));
if ( ecnames[i][0]!='_' ) qFatal(TQString("Invalid extra config name for %1").arg(cvalue.name));
}
}
@ -140,30 +140,30 @@ Pic::Config::Mask toConfigMask(TQDomElement mask, BitValue pmask)
TQMap<Pic::ConfigNameType, TQStringList> defConfigNames;
Config::Mask cmask;
cmask.name = mask.attribute("name");
if ( !Config::hasMaskName(cmask.name) ) qFatal(TQString("Unknown mask name %1").tqarg(cmask.name));
if ( !Config::hasMaskName(cmask.name) ) qFatal(TQString("Unknown mask name %1").arg(cmask.name));
cmask.value = fromHexLabel(mask.attribute("value"), nbChars, &ok);
if ( !ok || cmask.value==0 || cmask.value>data()->mask(MemoryRangeType::Config) )
qFatal(TQString("Malformed mask value in mask %1").tqarg(mask.attribute("name")));
qFatal(TQString("Malformed mask value in mask %1").arg(mask.attribute("name")));
//TQStringList names;
TQDomNode child = mask.firstChild();
while ( !child.isNull() ) {
TQDomElement value = child.toElement();
child = child.nextSibling();
if ( value.isNull() ) continue;
if ( value.nodeName()!="value" ) qFatal(TQString("Non value child in mask %1").tqarg(cmask.name));
if ( value.nodeName()!="value" ) qFatal(TQString("Non value child in mask %1").arg(cmask.name));
if ( value.attribute("value")=="default" ) {
if ( !defName.isEmpty() ) qFatal(TQString("Default value already defined for mask %1").tqarg(cmask.name));
if ( !defName.isEmpty() ) qFatal(TQString("Default value already defined for mask %1").arg(cmask.name));
defName = value.attribute("name");
//if ( names.contains(defName) ) qFatal(TQString("Value name duplicated in mask %1").tqarg(cmask.name));
//if ( names.contains(defName) ) qFatal(TQString("Value name duplicated in mask %1").arg(cmask.name));
//names.append(defName);
FOR_EACH(Pic::ConfigNameType, type) defConfigNames[type] = TQStringList::split(' ', value.attribute(type.data().key));
continue;
}
Config::Value cvalue;
cvalue.value = fromHexLabel(value.attribute("value"), nbChars, &ok);
if ( !ok || !cvalue.value.isInside(cmask.value) ) qFatal(TQString("Malformed value in mask %1").tqarg(cmask.name));
if ( !ok || !cvalue.value.isInside(cmask.value) ) qFatal(TQString("Malformed value in mask %1").arg(cmask.name));
cvalue.name = value.attribute("name");
//if ( names.contains(cvalue.name) ) qFatal(TQString("Value name duplicated in mask %1").tqarg(cmask.name));
//if ( names.contains(cvalue.name) ) qFatal(TQString("Value name duplicated in mask %1").arg(cmask.name));
//names.append(cvalue.name);
FOR_EACH(Pic::ConfigNameType, type) cvalue.configNames[type] = TQStringList::split(' ', value.attribute(type.data().key));
processName(cmask, pmask, cvalue);
@ -183,7 +183,7 @@ Pic::Config::Mask toConfigMask(TQDomElement mask, BitValue pmask)
processName(cmask, pmask, cvalue);
cmask.values.append(cvalue);
}
if ( nb<=1 ) qFatal(TQString("Default value used less than twice in mask %1").tqarg(cmask.name));
if ( nb<=1 ) qFatal(TQString("Default value used less than twice in mask %1").arg(cmask.name));
}
qHeapSort(cmask.values);
return cmask;
@ -198,9 +198,9 @@ Pic::Config::Word toConfigWord(TQDomElement config)
bool ok;
cword.wmask = fromHexLabel(config.attribute("wmask"), nbChars, &ok);
BitValue gmask = data()->mask(MemoryRangeType::Config);
if ( !ok || cword.wmask>gmask ) qFatal(TQString("Missing or malformed config wmask \"%1\"").tqarg(config.attribute("wmask")));
if ( !ok || cword.wmask>gmask ) qFatal(TQString("Missing or malformed config wmask \"%1\"").arg(config.attribute("wmask")));
cword.bvalue = fromHexLabel(config.attribute("bvalue"), nbChars, &ok);
if ( !ok ) qFatal(TQString("Missing or malformed config bvalue \"%1\"").tqarg(config.attribute("bvalue")));
if ( !ok ) qFatal(TQString("Missing or malformed config bvalue \"%1\"").arg(config.attribute("bvalue")));
if ( config.attribute("pmask").isEmpty() ) cword.pmask = 0;
else {
bool ok;
@ -209,19 +209,19 @@ Pic::Config::Word toConfigWord(TQDomElement config)
}
cword.ignoredCNames = TQStringList::split(' ', config.attribute("icnames"));
for (uint i=0; i<uint(cword.ignoredCNames.count()); i++)
if ( cword.ignoredCNames[i][0]!='_' ) qFatal(TQString("Invalid ignored config name for %1").tqarg(cword.name));
if ( cword.ignoredCNames[i][0]!='_' ) qFatal(TQString("Invalid ignored config name for %1").arg(cword.name));
TQDomNode child = config.firstChild();
while ( !child.isNull() ) {
TQDomElement mask = child.toElement();
child = child.nextSibling();
if ( mask.isNull() ) continue;
if ( mask.nodeName()!="mask" ) qFatal(TQString("Non mask child in config %1").tqarg(cword.name));
if ( mask.attribute("name").isEmpty() ) qFatal(TQString("Empty mask name in config %1").tqarg(cword.name));
if ( mask.nodeName()!="mask" ) qFatal(TQString("Non mask child in config %1").arg(cword.name));
if ( mask.attribute("name").isEmpty() ) qFatal(TQString("Empty mask name in config %1").arg(cword.name));
Config::Mask cmask = toConfigMask(mask, cword.pmask);
if ( !cmask.value.isInside(gmask) ) qFatal(TQString("Mask value not inside mask in config %1").tqarg(cword.name));
if ( !cmask.value.isInside(gmask) ) qFatal(TQString("Mask value not inside mask in config %1").arg(cword.name));
for (uint i=0; i<uint(cword.masks.count()); i++) {
if ( cword.masks[i].name==cmask.name ) qFatal(TQString("Duplicated mask name %1 in config %2").tqarg(cmask.name).tqarg(cword.name));
if ( cmask.value.isOverlapping(cword.masks[i].value) ) qFatal(TQString("Overlapping masks in config %1").tqarg(cword.name));
if ( cword.masks[i].name==cmask.name ) qFatal(TQString("Duplicated mask name %1 in config %2").arg(cmask.name).arg(cword.name));
if ( cmask.value.isOverlapping(cword.masks[i].value) ) qFatal(TQString("Overlapping masks in config %1").arg(cword.name));
}
cword.masks.append(cmask);
}
@ -234,8 +234,8 @@ Pic::Config::Word toConfigWord(TQDomElement config)
bool ok;
cword.cmask = fromHexLabel(config.attribute("cmask"), nbChars, &ok);
if ( !ok || cword.cmask>gmask ) qFatal("Missing or malformed config cmask");
//if ( data()->_architecture==Pic::Architecture::P30X &&cword.cmask==cword.wmask ) qFatal(TQString("Redundant cmask in %1").tqarg(cword.name));
if ( cword.cmask==mask ) qFatal(TQString("Redundant cmask in %1").tqarg(cword.name));
//if ( data()->_architecture==Pic::Architecture::P30X &&cword.cmask==cword.wmask ) qFatal(TQString("Redundant cmask in %1").arg(cword.name));
if ( cword.cmask==mask ) qFatal(TQString("Redundant cmask in %1").arg(cword.name));
}
if ( !cword.pmask.isInside(cword.usedMask()) ) qFatal("pmask should be inside or'ed mask values.");
return cword;
@ -255,11 +255,11 @@ TQValueVector<Pic::Config::Word> getConfigWords(TQDomElement element)
if ( !ok ) qFatal("Missing or malformed config offset");
if ( (offset % data()->addressIncrement(MemoryRangeType::Config))!=0 ) qFatal("Config offset not aligned");
offset /= data()->addressIncrement(MemoryRangeType::Config);
if ( offset>=nbWords ) qFatal(TQString("Offset too big %1/%2").tqarg(offset).tqarg(nbWords));
if ( !configWords[offset].name.isNull() ) qFatal(TQString("Config offset %1 is duplicated").tqarg(offset));
if ( offset>=nbWords ) qFatal(TQString("Offset too big %1/%2").arg(offset).arg(nbWords));
if ( !configWords[offset].name.isNull() ) qFatal(TQString("Config offset %1 is duplicated").arg(offset));
for (uint i=0; i<nbWords; i++) {
if ( !configWords[i].name.isNull() && configWords[i].name==config.attribute("name") )
qFatal(TQString("Duplicated config name %1").tqarg(configWords[i].name));
qFatal(TQString("Duplicated config name %1").arg(configWords[i].name));
}
configWords[offset] = toConfigWord(config);
}
@ -320,13 +320,13 @@ TQString getChecksumData(TQDomElement checksum)
TQStringList list = TQStringList::split(" ", s);
for (uint i=0; i<uint(list.count()); i++) {
const Config::Mask *mask = data()->config().findMask(list[i]);
if ( mask==0 ) qFatal(TQString("Not valid mask name for \"protected\" tag in checksum: %1").tqarg(list[i]));
if ( mask==0 ) qFatal(TQString("Not valid mask name for \"protected\" tag in checksum: %1").arg(list[i]));
if ( mask->values.count()==2 ) continue;
for (uint k=0; k<uint(mask->values.count()); k++) {
TQString valueName = mask->values[k].name;
if ( valueName.isEmpty() ) continue;
if ( !protection.isNoneProtectedValueName(valueName) && !protection.isAllProtectedValueName(valueName) )
qFatal(TQString("Not switch protection from mask name for \"protected\" tag in checksum: %1").tqarg(list[i]));
qFatal(TQString("Not switch protection from mask name for \"protected\" tag in checksum: %1").arg(list[i]));
}
}
cdata.protectedMaskNames = list;
@ -358,7 +358,7 @@ virtual void processDevice(TQDomElement device)
TQString arch = device.attribute("architecture");
data()->_architecture = Architecture::fromKey(arch);
if ( data()->_architecture==Architecture::Nb_Types ) qFatal(TQString("Unrecognized architecture \"%1\"").tqarg(arch));
if ( data()->_architecture==Architecture::Nb_Types ) qFatal(TQString("Unrecognized architecture \"%1\"").arg(arch));
if ( (data()->_architecture==Architecture::P18F && data()->_name.contains("C"))
|| (data()->_architecture==Architecture::P18F && data()->_name.contains("J")) ) qFatal("Not matching family");
@ -396,7 +396,7 @@ virtual void processDevice(TQDomElement device)
if ( !getVoltages(vtype, device) ) {
switch (vtype.type()) {
case ProgVoltageType::Vpp:
case ProgVoltageType::VddBulkErase: qFatal(TQString("Voltage \"%1\" not defined").tqarg(vtype.key()));
case ProgVoltageType::VddBulkErase: qFatal(TQString("Voltage \"%1\" not defined").arg(vtype.key()));
case ProgVoltageType::VddWrite: data()->_voltages[ProgVoltageType::VddWrite] = data()->_voltages[ProgVoltageType::VddBulkErase]; break;
case ProgVoltageType::Nb_Types: Q_ASSERT(false); break;
}
@ -426,7 +426,7 @@ virtual void processDevice(TQDomElement device)
Address start2 = data()->_ranges[i].start + data()->_ranges[i].hexFileOffset;
Address end2 = data()->_ranges[i].end + data()->_ranges[i].hexFileOffset;
if ( end1>=start2 && start1<=end2 )
qFatal(TQString("Overlapping memory ranges (%1 and %2)").tqarg(k.key()).tqarg(i.key()));
qFatal(TQString("Overlapping memory ranges (%1 and %2)").arg(k.key()).arg(i.key()));
}
}
checkTagNames(device, "memory", names);
@ -440,7 +440,7 @@ virtual void processDevice(TQDomElement device)
FOR_EACH(Pic::ConfigNameType, type) {
TQMap<TQString, TQString> cnames; // cname -> mask name
for (uint i=0; i<nbWords; i++) {
if ( cwords[i].name.isNull() ) qFatal(TQString("Config word #%1 not defined").tqarg(i));
if ( cwords[i].name.isNull() ) qFatal(TQString("Config word #%1 not defined").arg(i));
data()->_config->_words[i] = cwords[i];
const Config::Word &word = data()->_config->_words[i];
for (uint j=0; j<uint(word.masks.count()); j++) {
@ -450,7 +450,7 @@ virtual void processDevice(TQDomElement device)
for (uint l=0; l<uint(vcnames.count()); l++) {
if ( vcnames[l].startsWith("0x") ) continue;
if ( cnames.contains(vcnames[l]) && cnames[vcnames[l]]!=mask.name )
qFatal(TQString("Duplicated config name for %1/%2").tqarg(mask.name).tqarg(mask.values[k].name));
qFatal(TQString("Duplicated config name for %1/%2").arg(mask.name).arg(mask.values[k].name));
cnames[vcnames[l]] = word.masks[j].name;
}
}
@ -466,7 +466,7 @@ virtual void processDevice(TQDomElement device)
const Config::Value &value = mask.values[k];
if ( !value.isValid() ) continue;
if ( !data()->_config->checkValueName(mask.name, value.name) )
qFatal(TQString("Malformed value name \"%1\" in mask %2").tqarg(value.name).tqarg(mask.name));
qFatal(TQString("Malformed value name \"%1\" in mask %2").arg(value.name).arg(mask.name));
}
}
}
@ -477,7 +477,7 @@ virtual void processDevice(TQDomElement device)
const Config::Mask &mask = word.masks[j];
BitValue::const_iterator it;
for (it=mask.value.begin(); it!=mask.value.end(); ++it)
if ( !hasValue(mask, *it) ) qFatal(TQString("Value %1 not defined in mask %2").tqarg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).tqarg(mask.name));
if ( !hasValue(mask, *it) ) qFatal(TQString("Value %1 not defined in mask %2").arg(toHexLabel(*it, data()->nbCharsWord(MemoryRangeType::Config))).arg(mask.name));
}
}
@ -507,7 +507,7 @@ virtual void processDevice(TQDomElement device)
}
TQMap<TQString, bool>::const_iterator it;
for (it=valueNames.begin(); it!=valueNames.end(); ++it)
if ( !it.key().isEmpty() && !it.data() ) qFatal(TQString("Missing checksum \"%1\"").tqarg(it.key()));
if ( !it.key().isEmpty() && !it.data() ) qFatal(TQString("Missing checksum \"%1\"").arg(it.key()));
}
}
@ -552,13 +552,13 @@ void processSfr(TQDomElement e)
qFatal("SFR name is duplicated");
bool ok;
uint address = fromHexLabel(e.attribute("address"), &ok);
if ( !ok ) qFatal(TQString("SFR %1 address %2 is malformed").tqarg(name).tqarg(e.attribute("address")));
if ( !ok ) qFatal(TQString("SFR %1 address %2 is malformed").arg(name).arg(e.attribute("address")));
uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength;
if ( address>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(address, 3)));
if ( address>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(address, 3)));
RegisterData rdata;
rdata.address = address;
uint nb = data()->registersData().nbBits();
if ( nb>Device::MAX_NB_PORT_BITS ) qFatal(TQString("Need higher MAX_NB_PORT_BITS: %1").tqarg(nb));
if ( nb>Device::MAX_NB_PORT_BITS ) qFatal(TQString("Need higher MAX_NB_PORT_BITS: %1").arg(nb));
TQString access = e.attribute("access");
if ( uint(access.length())!=nb ) qFatal("access is missing or malformed");
TQString mclr = e.attribute("mclr");
@ -569,11 +569,11 @@ void processSfr(TQDomElement e)
uint k = nb - i - 1;
bool ok;
rdata.bits[k].properties = RegisterBitProperties(fromHex(access[i].latin1(), &ok));
if ( !ok || rdata.bits[k].properties>MaxRegisterBitProperty ) qFatal(TQString("Malformed access bit %1").tqarg(k));
if ( !ok || rdata.bits[k].properties>MaxRegisterBitProperty ) qFatal(TQString("Malformed access bit %1").arg(k));
rdata.bits[k].mclr = RegisterBitState(fromHex(mclr[i].latin1(), &ok));
if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) qFatal(TQString("Malformed mclr bit %1").tqarg(k));
if ( !ok || rdata.bits[k].mclr>Nb_RegisterBitStates ) qFatal(TQString("Malformed mclr bit %1").arg(k));
rdata.bits[k].por = RegisterBitState(fromHex(por[i].latin1(), &ok));
if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) qFatal(TQString("Malformed por bit %1").tqarg(k));
if ( !ok || rdata.bits[k].por>Nb_RegisterBitStates ) qFatal(TQString("Malformed por bit %1").arg(k));
}
static_cast<RegistersData *>(data()->_registersData)->sfrs[name] = rdata;
}
@ -587,13 +587,13 @@ void processCombined(TQDomElement e)
bool ok;
CombinedData rdata;
rdata.address = fromHexLabel(e.attribute("address"), &ok);
if ( !ok ) qFatal(TQString("Combined %1 address %2 is malformed").tqarg(name).tqarg(e.attribute("address")));
if ( !ok ) qFatal(TQString("Combined %1 address %2 is malformed").arg(name).arg(e.attribute("address")));
uint rlength = data()->registersData().nbBanks * data()->architecture().data().registerBankLength;
if ( rdata.address>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(rdata.address, 3)));
if ( rdata.address>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(rdata.address, 3)));
rdata.nbChars = 2*e.attribute("size").toUInt(&ok);
if ( !ok || rdata.nbChars<2 ) qFatal(TQString("Combined %1 size %2 is malformed").tqarg(name).tqarg(e.attribute("size")));
if ( !ok || rdata.nbChars<2 ) qFatal(TQString("Combined %1 size %2 is malformed").arg(name).arg(e.attribute("size")));
Address end = rdata.address + rdata.nbChars/2 - 1;
if ( end>=rlength ) qFatal(TQString("Address %1 outside register range").tqarg(toHexLabel(end, 3)));
if ( end>=rlength ) qFatal(TQString("Address %1 outside register range").arg(toHexLabel(end, 3)));
static_cast<RegistersData *>(data()->_registersData)->combined[name] = rdata;
}
@ -601,7 +601,7 @@ void processDeviceRegisters(TQDomElement element)
{
TQString s = element.attribute("same_as");
if ( !s.isEmpty() ) {
if ( !_map.contains(s) ) qFatal(TQString("Registers same as unknown device %1").tqarg(s));
if ( !_map.contains(s) ) qFatal(TQString("Registers same as unknown device %1").arg(s));
const Pic::Data *d = static_cast<const Pic::Data *>(_map[s]);
data()->_registersData = d->_registersData;
return;
@ -629,7 +629,7 @@ void processDeviceRegisters(TQDomElement element)
else if ( e.nodeName()=="unused" ) processUnused(e);
else if ( e.nodeName()=="combined" ) processCombined(e);
else if ( e.nodeName()=="sfr" ) processSfr(e);
else qFatal(TQString("Node name \"%1\" is not recognized").tqarg(e.nodeName()));
else qFatal(TQString("Node name \"%1\" is not recognized").arg(e.nodeName()));
child = child.nextSibling();
}
@ -640,11 +640,11 @@ void processDeviceRegisters(TQDomElement element)
TQString trisname = rdata.trisName(i);
if ( trisname.isEmpty() ) continue;
bool hasTris = rdata.sfrs.contains(trisname);
if ( !hasPort && hasTris ) qFatal(TQString("%1 needs %2 to be present").tqarg(trisname).tqarg(portname));
if ( !hasPort && hasTris ) qFatal(TQString("%1 needs %2 to be present").arg(trisname).arg(portname));
TQString latchname = rdata.latchName(i);
if ( latchname.isEmpty() ) continue;
bool hasLatch = rdata.sfrs.contains(latchname);
if ( !hasPort && hasLatch ) qFatal(TQString("%1 needs %2 to be present").tqarg(latchname).tqarg(portname));
if ( !hasPort && hasLatch ) qFatal(TQString("%1 needs %2 to be present").arg(latchname).arg(portname));
}
}
@ -660,7 +660,7 @@ void processRegistersFile(const TQString &filename, TQStringList &devices)
if ( child.nodeName()!="device" ) qFatal("Device node should be named \"device\"");
TQDomElement device = child.toElement();
TQString name = device.attribute("name");
if ( devices.contains(name) ) qFatal(TQString("Registers already defined for %1").tqarg(name));
if ( devices.contains(name) ) qFatal(TQString("Registers already defined for %1").arg(name));
if ( _map.contains(name) ) {
_data = _map[name];
processDeviceRegisters(device);
@ -691,7 +691,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const
TQMap<TQString, uint>::const_iterator it;
for (it=pinLabels.begin(); it!=pinLabels.end(); ++it) {
if ( it.key()=="VDD" || it.key()=="VSS" || it.key().startsWith("CCP") ) continue;
if ( it.data()!=1 ) qFatal(TQString("Duplicated pin \"%1\"").tqarg(it.key()));
if ( it.data()!=1 ) qFatal(TQString("Duplicated pin \"%1\"").arg(it.key()));
}
const Pic::RegistersData &rdata = static_cast<const Pic::RegistersData &>(*_data->registersData());
for (uint i=0; i<Device::MAX_NB_PORTS; i++) {
@ -699,7 +699,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const
for (uint k=0; k<Device::MAX_NB_PORT_BITS; k++) {
if ( !rdata.hasPortBit(i, k) ) continue;
TQString name = rdata.portBitName(i, k);
if ( !pinLabels.contains(name) ) qFatal(TQString("Pin \"%1\" not present").tqarg(name));
if ( !pinLabels.contains(name) ) qFatal(TQString("Pin \"%1\" not present").arg(name));
}
}
}

@ -63,7 +63,7 @@ void DeviceEditor::setDevice(bool force)
if ( name==Device::AUTO_DATA.name )
_labelDevice->setText(i18n("The target device is not configured and cannot be guessed from source file. "
"The source file either cannot be found or does not contain any processor directive."));
else _labelDevice->setText(i18n("Device guessed from file: %1").tqarg(name));
else _labelDevice->setText(i18n("Device guessed from file: %1").arg(name));
_labelDevice->show();
} else {
if ( !force && Main::device()==_device ) return;
@ -71,7 +71,7 @@ void DeviceEditor::setDevice(bool force)
_labelDevice->hide();
}
if ( _view && isModified() ) {
if ( MessageBox::questionYesNo(i18n("File %1 not saved.").tqarg(filename()), KStdGuiItem::save(), KStdGuiItem::discard()) )
if ( MessageBox::questionYesNo(i18n("File %1 not saved.").arg(filename()), KStdGuiItem::save(), KStdGuiItem::discard()) )
Editor::save();
}
_labelWarning->hide();

@ -260,12 +260,12 @@ void DeviceChooser::Dialog::updateList(const TQString &device)
TQListViewItem *selected = 0;
const Programmer::Group *pgroup = programmerGroup();
if ( pgroup && pgroup->supportedDevices().isEmpty() && pgroup->isSoftware() ) {
_deviceView->setText(i18n("Could not detect supported devices for \"%1\". Please check installation.").tqarg(pgroup->label()));
_deviceView->setText(i18n("Could not detect supported devices for \"%1\". Please check installation.").arg(pgroup->label()));
return;
}
const Tool::Group *tgroup = toolGroup();
if ( tgroup && tgroup->supportedDevices().isEmpty() ) {
_deviceView->setText(i18n("Could not detect supported devices for toolchain \"%1\". Please check installation.").tqarg(tgroup->label()));
_deviceView->setText(i18n("Could not detect supported devices for toolchain \"%1\". Please check installation.").arg(tgroup->label()));
return;
}
for (int i=list.count()-1; i>=0; i--) {

@ -77,7 +77,7 @@ TQString Editor::filename() const
bool Editor::checkSaved()
{
if ( !isModified() ) return true;
MessageBox::Result res = MessageBox::questionYesNoCancel(i18n("File %1 not saved.").tqarg(filename()),
MessageBox::Result res = MessageBox::questionYesNoCancel(i18n("File %1 not saved.").arg(filename()),
KStdGuiItem::save(), KStdGuiItem::discard());
if ( res==MessageBox::Cancel ) return false;
if ( res==MessageBox::Yes ) save();

@ -106,7 +106,7 @@ bool EditorManager::openFile(const PURL::Url &url)
if ( url.isEmpty() ) return false;
Editor *e = findEditor(url);
if (e) { // document already loaded
if ( !MessageBox::askContinue(i18n("File \"%1\" already loaded. Reload?").tqarg(url.kurl().prettyURL()),
if ( !MessageBox::askContinue(i18n("File \"%1\" already loaded. Reload?").arg(url.kurl().prettyURL()),
i18n("Warning"), i18n("Reload")) ) return true;
if ( !e->slotLoad() ) {
closeEditor(e, false);
@ -439,7 +439,7 @@ void EditorManager::switchToEditor()
SwitchToDialog dialog(names, this);
if ( dialog.exec()!=TQDialog::Accepted ) return;
for (uint i=0; i<names.count(); i++) {
if ( dialog.name()!=names[i] && dialog.name()!=TQString("%1").tqarg(i+1) ) continue;
if ( dialog.name()!=names[i] && dialog.name()!=TQString("%1").arg(i+1) ) continue;
showEditor(_editors[i]);
return;
}

@ -40,7 +40,7 @@ PURL::UrlList GlobalConfig::openedFiles()
PURL::UrlList files;
uint i = 0;
for (;;) {
TQString file = config.readEntry(TQString("file%1").tqarg(i), TQString::null);
TQString file = config.readEntry(TQString("file%1").arg(i), TQString::null);
if ( file.isEmpty() ) break;
files += PURL::Url::fromPathOrUrl(file);
i++;
@ -52,7 +52,7 @@ void GlobalConfig::writeOpenedFiles(const PURL::UrlList &files)
GenericConfig config(TQString::null);
for (uint i=0; i<=files.count(); i++) {
TQString s = (i==files.count() ? TQString::null : files[i].filepath());
config.writeEntry(TQString("file%1").tqarg(i), s);
config.writeEntry(TQString("file%1").arg(i), s);
}
}

@ -99,7 +99,7 @@ bool HexEditor::simpleLoad()
TQStringList warnings;
if ( _memory->fromHexBuffer(_hexBuffer, warnings)!=Device::Memory::NoWarning ) {
_labelWarning->setText(i18n("<b>Warning:</b> hex file seems to be incompatible with the selected device %1:<br>%2")
.tqarg(_memory->device().name()).tqarg(warnings.join("<br>")));
.arg(_memory->device().name()).arg(warnings.join("<br>")));
_labelWarning->show();
} else _labelWarning->hide();
display();
@ -139,7 +139,7 @@ bool HexEditor::open(const PURL::Url &url)
bool HexEditor::save(const PURL::Url &url)
{
return save(url, i18n("File URL: \"%1\".").tqarg(url.pretty()));
return save(url, i18n("File URL: \"%1\".").arg(url.pretty()));
}
bool HexEditor::save(const PURL::Url &url, const TQString &fileErrorString)
@ -147,7 +147,7 @@ bool HexEditor::save(const PURL::Url &url, const TQString &fileErrorString)
PURL::File file(url, Main::compileLog());
if ( !file.openForWrite() ) return false;
if ( !_memory->save(file.stream(), HexBuffer::IHX32) ) {
MessageBox::detailedSorry(i18n("Error while writing file \"%1\".").tqarg(url.pretty()), fileErrorString, Log::Show);
MessageBox::detailedSorry(i18n("Error while writing file \"%1\".").arg(url.pretty()), fileErrorString, Log::Show);
return false;
}
_originalMemory->copyFrom(*_memory);
@ -186,7 +186,7 @@ void HexEditor::statusChanged()
TQString s;
if (_memory) {
BitValue cs = static_cast<Device::HexView *>(_view)->checksum();
s = i18n("Checksum: %1").tqarg(toHexLabel(cs, 4));
s = i18n("Checksum: %1").arg(toHexLabel(cs, 4));
}
emit statusTextChanged(s);
}

@ -171,7 +171,7 @@ void LikeBack::showInformationMessage()
TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon);
TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon);
KMessageBox::information(0,
"<p><b>" + i18n("This is a quick feedback system for %1.").tqarg(s_about->programName()) + "</b></p>"
"<p><b>" + i18n("This is a quick feedback system for %1.").arg(s_about->programName()) + "</b></p>"
"<p>" + i18n("To help us improve it, your comments are important.") + "</p>"
"<p>" + i18n("Each time you have a great or frustrating experience, "
"please click the appropriate hand below the window title-bar, "

@ -48,7 +48,7 @@ void Log::Widget::doLog(DebugLevel level, const TQString &text, Action action)
void Log::Widget::doLog(const TQString &text, const TQString &color, bool bold, Action action)
{
logExtra(text + "\n");
TQString s = TQString("<font color=%1>").tqarg(color);
TQString s = TQString("<font color=%1>").arg(color);
if (bold) s += "<b>";
s += escapeXml(text);
if (bold) s += "</b>";

@ -123,7 +123,7 @@ bool DisassemblyEditor::open(const PURL::Url &url)
Device::Memory *memory = 0;
if ( _editor==0 ) {
log(Log::LineType::Information, i18n("Disassembling hex file: %1").tqarg(_source.pretty()));
log(Log::LineType::Information, i18n("Disassembling hex file: %1").arg(_source.pretty()));
PURL::File file(_source, Main::compileLog());
if ( !file.openForRead() ) return false;
memory = _device.group().createMemory(_device);

@ -21,7 +21,7 @@ bool Project::load(TQString &error)
if ( _url.fileType()==PURL::Project ) return XmlDataFile::load(error);
if ( !_url.exists() ) {
error = i18n("Project file %1 does not exist.").tqarg(_url.pretty());
error = i18n("Project file %1 does not exist.").arg(_url.pretty());
return false;
}
PURL::Url tmp = _url;

@ -242,7 +242,7 @@ void ProjectManager::View::closeProject()
_project->setWatchedRegisters(Register::list().watched());
TQString error;
if ( !_project->save(error) )
MessageBox::detailedSorry(i18n("Could not save project file \"%1\".").tqarg(_project->url().pretty()), error, Log::Show);
MessageBox::detailedSorry(i18n("Could not save project file \"%1\".").arg(_project->url().pretty()), error, Log::Show);
delete _project;
_project = 0;
}
@ -304,25 +304,25 @@ void ProjectManager::View::insertObjectFiles()
void ProjectManager::View::insertFile(const PURL::Url &url)
{
if ( !url.exists() ) {
MessageBox::detailedSorry(i18n("Could not find file."), i18n("File: %1").tqarg(url.pretty()), Log::Show);
MessageBox::detailedSorry(i18n("Could not find file."), i18n("File: %1").arg(url.pretty()), Log::Show);
return;
}
PURL::Url purl = url;
MessageBox::Result copy = MessageBox::No;
if ( !url.isInto(_project->directory()) ) {
copy = MessageBox::questionYesNoCancel(i18n("File \"%1\" is not inside the project directory. Do you want to copy the file to your project directory?").tqarg(url.pretty()),
copy = MessageBox::questionYesNoCancel(i18n("File \"%1\" is not inside the project directory. Do you want to copy the file to your project directory?").arg(url.pretty()),
i18n("Copy and Add"), i18n("Add only"));
if ( copy==MessageBox::Cancel ) return;
if ( copy==MessageBox::Yes ) purl = PURL::Url(_project->directory(), url.filename());
}
if ( _project->absoluteFiles().contains(purl) ) {
MessageBox::detailedSorry(i18n("File is already in the project."), i18n("File: %1").tqarg(purl.pretty()), Log::Show);
MessageBox::detailedSorry(i18n("File is already in the project."), i18n("File: %1").arg(purl.pretty()), Log::Show);
return;
}
if ( copy==MessageBox::Yes ) {
Log::StringView sview;
if ( !url.copyTo(purl, sview) ) {
MessageBox::detailedSorry(i18n("Copying file to project directory failed."), i18n("File: %1\n").tqarg(url.pretty()) + sview.string(), Log::Show);
MessageBox::detailedSorry(i18n("Copying file to project directory failed."), i18n("File: %1\n").arg(url.pretty()) + sview.string(), Log::Show);
return;
}
}

@ -36,7 +36,7 @@ FileListItem::FileListItem(KListView *view)
void FileListItem::toggle()
{
_copy = !_copy;
tqrepaint();
repaint();
}
PURL::FileGroup FileListItem::fileGroup() const
@ -184,7 +184,7 @@ void ProjectWizard::next()
return;
}
} else if ( url().exists() ) {
if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").tqarg(url().filename())) ) return;
if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").arg(url().filename())) ) return;
}
if ( !toolchain().check(device(), &Main::compileLog()) ) return;
_files->setDirectory(_directory->directory());
@ -203,7 +203,7 @@ void ProjectWizard::next()
for (uint i=0; i<_files->count(); i++)
if ( static_cast<const FileListItem *>(_files->item(i))->fileGroup()==PURL::Source ) nb++;
if ( toolchain().compileType()==Tool::SingleFile && nb>1 ) {
if ( !MessageBox::askContinue(i18n("The selected toolchain can only compile a single source file and you have selected %1 source files. Continue anyway? ").tqarg(nb)) ) return;
if ( !MessageBox::askContinue(i18n("The selected toolchain can only compile a single source file and you have selected %1 source files. Continue anyway? ").arg(nb)) ) return;
}
}
KWizard::next();
@ -243,7 +243,7 @@ void ProjectWizard::done(int r)
}
Log::StringView sview;
if ( turl.write(text, sview) ) files += turl;
else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").tqarg(turl.pretty()) + sview.string(), Log::Show);
else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").arg(turl.pretty()) + sview.string(), Log::Show);
_project->setOpenedFiles(files);
} else {
Log::StringView sview;

@ -167,7 +167,7 @@ void TextEditor::statusChanged()
{
uint line, col;
_view->cursorPosition(&line, &col) ;
TQString text = i18n("Line: %1 Col: %2").tqarg(line+1).tqarg(col+1);
TQString text = i18n("Line: %1 Col: %2").arg(line+1).arg(col+1);
if( isReadOnly() ) text += " " + i18n("R/O");
emit statusTextChanged(" " + text + " ");
if ( isReadOnly()!=_oldReadOnly || isModified()!=_oldModified ) emit guiChanged();

@ -728,7 +728,7 @@ void MainWindow::runPikloops()
_pikloopsProcess->setup("pikloops", TQStringList(), false);
connect(_pikloopsProcess, TQT_SIGNAL(done(int)), TQT_SLOT(pikloopsDone()));
if ( !_pikloopsProcess->start(0) )
MessageBox::detailedSorry(i18n("Could not run \"pikloops\""), i18n("The Pikloops utility (%1) is not installed in your system.").tqarg("http://pikloops.sourceforge.net"), Log::Show);
MessageBox::detailedSorry(i18n("Could not run \"pikloops\""), i18n("The Pikloops utility (%1) is not installed in your system.").arg("http://pikloops.sourceforge.net"), Log::Show);
}
void MainWindow::pikloopsDone()

@ -95,11 +95,11 @@ TQString CLI::Main::prettySymbol(const Coff::Symbol &sym)
for (uint i=0; i<uint(sym.auxSymbols().count()); i++) saux += prettyAuxSymbol(*sym.auxSymbols()[i]);
TQString s = (sym.auxSymbols().count()!=0 ? " aux=[" + saux.join(" ") + "]" : TQString());
TQStringList slist;
if ( sym.sectionType()!=Coff::SymbolSectionType::Nb_Types ) slist += TQString("sectionType=\"%1\"").tqarg(sym.sectionType().label());
if ( sym.symbolClass()!=Coff::SymbolClass::Nb_Types ) slist += TQString("class=\"%1\"").tqarg(sym.symbolClass().label());
if ( sym.sectionType()!=Coff::SymbolSectionType::Nb_Types ) slist += TQString("sectionType=\"%1\"").arg(sym.sectionType().label());
if ( sym.symbolClass()!=Coff::SymbolClass::Nb_Types ) slist += TQString("class=\"%1\"").arg(sym.symbolClass().label());
if ( sym.type()!=Coff::SymbolType::Nb_Types ) {
slist += TQString("type=\"%1\"").tqarg(sym.type().label());
if ( sym.derivedType()!=Coff::SymbolDerivedType::Nb_Types ) slist += TQString("/\"%1\"").tqarg(sym.derivedType().label());
slist += TQString("type=\"%1\"").arg(sym.type().label());
if ( sym.derivedType()!=Coff::SymbolDerivedType::Nb_Types ) slist += TQString("/\"%1\"").arg(sym.derivedType().label());
}
return slist.join(" ") + s;
}
@ -165,8 +165,8 @@ CLI::ExitCode CLI::Main::executeCommandObject(const TQString &command, Log::KeyL
for (uint i=0; i<coff.nbSections(); i++) {
const Coff::Section *s = coff.Coff::Object::section(i);
keys.append(s->name(), i18n("type=\"%1\" address=%2 size=%3 flags=%4")
.tqarg(s->type()==Coff::SectionType::Nb_Types ? "?" : s->type().label())
.tqarg(toHexLabel(s->address(), nbCharsAddress)).tqarg(toHexLabel(s->size(), nbCharsAddress)).tqarg(toHexLabel(s->flags(), 8)));
.arg(s->type()==Coff::SectionType::Nb_Types ? "?" : s->type().label())
.arg(toHexLabel(s->address(), nbCharsAddress)).arg(toHexLabel(s->size(), nbCharsAddress)).arg(toHexLabel(s->flags(), 8)));
}
return OK;
}
@ -180,13 +180,13 @@ CLI::ExitCode CLI::Main::executeCommandObject(const TQString &command, Log::KeyL
for (uint k=0; k<uint(s->lines().count()); k++) {
if (first) {
first = false;
keys.append(i18n("section \"%1\":").tqarg(s->name()), TQString());
keys.append(i18n("section \"%1\":").arg(s->name()), TQString());
}
const Coff::CodeLine *cl = s->lines()[k];
TQString key = cl->filename() + ":" + TQString::number(cl->line());
if ( !cl->address().isValid() ) {
const Coff::Symbol &sym = *cl->symbol();
keys.append(key, i18n("symbol \"%1\"").tqarg(sym.name()) + prettySymbol(sym));
keys.append(key, i18n("symbol \"%1\"").arg(sym.name()) + prettySymbol(sym));
} else keys.append(key, toHexLabel(cl->address(), nbCharsAddress));
}
}
@ -235,10 +235,10 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
}
TQString s = value.upper();
_device = Device::lister().data(s);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").tqarg(s), ARG_ERROR);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").arg(s), ARG_ERROR);
return OK;
}
return errorExit(i18n("Unknown property \"%1\".").tqarg(property), ARG_ERROR);
return errorExit(i18n("Unknown property \"%1\".").arg(property), ARG_ERROR);
}
TQString CLI::Main::executeGetCommand(const TQString &property)
@ -247,7 +247,7 @@ TQString CLI::Main::executeGetCommand(const TQString &property)
if ( _device==0 ) return i18n("<not set>");
return _device->name();
}
log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").tqarg(property));
log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").arg(property));
return TQString();
}

@ -115,7 +115,7 @@ CLI::ExitCode CLI::Main::executeCommand(const TQString &command)
if ( _device==0 ) return okExit(i18n("Hex file is valid."));
TQStringList warnings;
Device::Memory::WarningTypes wtypes = _memory->fromHexBuffer(_source1, warnings);
if ( wtypes==Device::Memory::NoWarning ) return okExit(i18n("Hex file is compatible with device \"%1\".").tqarg(_device->name()));
if ( wtypes==Device::Memory::NoWarning ) return okExit(i18n("Hex file is compatible with device \"%1\".").arg(_device->name()));
return errorExit(warnings.join("\n"), EXEC_ERROR);
}
if ( command=="info" ) {
@ -169,7 +169,7 @@ CLI::ExitCode CLI::Main::executeCommand(const TQString &command)
if ( firstInSecond && secondInFirst ) return okExit(i18n("The two hex files have the same content."));
if (firstInSecond) log(Log::LineType::Information, i18n("The first hex file is a subset of the second one."));
if (secondInFirst) log(Log::LineType::Information, i18n("The second hex file is a subset of the first one."));
return errorExit(i18n("The two hex files are different at address %1.").tqarg(toHexLabel(it.key(), 8)), EXEC_ERROR);
return errorExit(i18n("The two hex files are different at address %1.").arg(toHexLabel(it.key(), 8)), EXEC_ERROR);
}
if ( command=="checksum" ) {
TQStringList warnings;
@ -177,10 +177,10 @@ CLI::ExitCode CLI::Main::executeCommand(const TQString &command)
for (uint i=0; i<uint(warnings.count()); i++) log(Log::LineType::Warning, warnings[i]);
log(Log::LineType::Warning, i18n("Checksum computation is experimental and is not always correct!")); // #### REMOVE ME
BitValue cs = _memory->checksum();
log(Log::LineType::Normal, i18n("Checksum: %1").tqarg(toHexLabel(cs, 4)));
log(Log::LineType::Normal, i18n("Checksum: %1").arg(toHexLabel(cs, 4)));
if ( _device->group().name()=="pic" ) {
BitValue ucs = static_cast<Pic::Memory *>(_memory)->unprotectedChecksum();
if ( ucs!=cs ) log(Log::LineType::Information, i18n("Unprotected checksum: %1").tqarg(toHexLabel(ucs, 4)));
if ( ucs!=cs ) log(Log::LineType::Information, i18n("Unprotected checksum: %1").arg(toHexLabel(ucs, 4)));
}
return OK;
}
@ -220,7 +220,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
}
TQString s = value.upper();
_device = Device::lister().data(s);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").tqarg(s), ARG_ERROR);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").arg(s), ARG_ERROR);
return OK;
}
if ( property=="fill" ) {
@ -232,7 +232,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR);
return OK;
}
return errorExit(i18n("Unknown property \"%1\".").tqarg(property), ARG_ERROR);
return errorExit(i18n("Unknown property \"%1\".").arg(property), ARG_ERROR);
}
TQString CLI::Main::executeGetCommand(const TQString &property)
@ -245,7 +245,7 @@ TQString CLI::Main::executeGetCommand(const TQString &property)
if ( _fill.isEmpty() ) return i18n("<not set>");
return _fill;
}
log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").tqarg(property));
log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").arg(property));
return TQString();
}

@ -158,11 +158,11 @@ CLI::ExitCode CLI::Interactive::processLine(const TQString &s)
if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR);
PURL::Url dummy;
Breakpoint::Data data(dummy, address);
if ( Breakpoint::list().contains(data) ) return okExit(i18n("Breakpoint already set at %1.").tqarg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
if ( Breakpoint::list().contains(data) ) return okExit(i18n("Breakpoint already set at %1.").arg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
Breakpoint::list().append(data);
Breakpoint::list().setAddress(data, address);
Breakpoint::list().setState(data, Breakpoint::Active);
return okExit(i18n("Breakpoint set at %1.").tqarg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
return okExit(i18n("Breakpoint set at %1.").arg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
}
return errorExit(i18n("The first argument should be \"e\"."), ARG_ERROR);
}
@ -178,7 +178,7 @@ CLI::ExitCode CLI::Interactive::processLine(const TQString &s)
}
for (uint i=0; i<nb; i++) {
Address address = Breakpoint::list().address(Breakpoint::list().data(i));
log(Log::LineType::Normal, TQString(" #%1: %2").tqarg(i).tqarg(toHexLabel(address, nbc)));
log(Log::LineType::Normal, TQString(" #%1: %2").arg(i).arg(toHexLabel(address, nbc)));
}
return OK;
}
@ -198,7 +198,7 @@ CLI::ExitCode CLI::Interactive::processLine(const TQString &s)
Breakpoint::Data data = Breakpoint::list().data(i);
Address address = Breakpoint::list().address(data);
Breakpoint::list().remove(data);
return okExit(i18n("Breakpoint at %1 removed.").tqarg(toHexLabelAbs(address)));
return okExit(i18n("Breakpoint at %1 removed.").arg(toHexLabelAbs(address)));
}
if ( words[0]=="raw-com" ) {
if ( words.count()!=2 ) return errorExit(i18n("This command needs a commands filename."), ARG_ERROR);
@ -243,10 +243,10 @@ CLI::ExitCode CLI::Interactive::registerList()
const Pic::RegistersData &rdata = data.registersData();
log(Log::LineType::Normal, i18n("Special Function Registers:"));
TQValueVector<Pic::RegisterNameData> list = Pic::sfrList(data);
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").tqarg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).tqarg(list[i].label()));
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").arg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).arg(list[i].label()));
log(Log::LineType::Normal, i18n("General Purpose Registers:"));
list = Pic::gprList(data, coff);
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").tqarg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).tqarg(list[i].label()));
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").arg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).arg(list[i].label()));
return OK;
}
@ -260,7 +260,7 @@ CLI::ExitCode CLI::Interactive::variableList()
const Pic::RegistersData &rdata = data.registersData();
TQValueVector<Pic::RegisterNameData> list = Pic::variableList(data, *coff);
if ( list.count()==0 ) log(Log::LineType::Normal, i18n("No variable."));
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").tqarg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).tqarg(list[i].label()));
for (uint i=0; i<uint(list.count()); i++) log(Log::LineType::Normal, TQString(" %1: %2").arg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).arg(list[i].label()));
return OK;
}
@ -292,7 +292,7 @@ CLI::ExitCode CLI::Interactive::executeRegister(const TQString &name, const TQSt
bool ok;
ulong v = fromAnyLabel(value, &ok);
if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR);
if ( v>maxValue(NumberBase::Hex, nbChars) ) return errorExit(i18n("The given value is too large (max: %1).").tqarg(toHexLabel(maxValue(NumberBase::Hex, nbChars), nbChars)), ARG_ERROR);
if ( v>maxValue(NumberBase::Hex, nbChars) ) return errorExit(i18n("The given value is too large (max: %1).").arg(toHexLabel(maxValue(NumberBase::Hex, nbChars), nbChars)), ARG_ERROR);
Register::TypeData rtd;
if ( name.lower()=="w" || name.lower()=="wreg" )
rtd = static_cast<Debugger::PicBase *>(Debugger::manager->debugger())->deviceSpecific()->wregTypeData();
@ -305,7 +305,7 @@ CLI::ExitCode CLI::Interactive::executeRegister(const TQString &name, const TQSt
}
if ( value.isEmpty() ) {
if ( !Debugger::manager->readRegister(rtd) ) return ARG_ERROR;
return okExit(i18n("%1 = %2").tqarg(name.upper()).tqarg(toHexLabel(Register::list().value(rtd), nbChars)));
return okExit(i18n("%1 = %2").arg(name.upper()).arg(toHexLabel(Register::list().value(rtd), nbChars)));
}
return (Debugger::manager->writeRegister(rtd, v) ? OK : EXEC_ERROR);
}
@ -313,7 +313,7 @@ CLI::ExitCode CLI::Interactive::executeRegister(const TQString &name, const TQSt
CLI::ExitCode CLI::Interactive::executeRawCommands(const TQString &filename)
{
TQFile file(filename);
if ( !file.open(IO_ReadOnly) ) return errorExit(i18n("Could not open filename \"%1\".").tqarg(filename), ARG_ERROR);
if ( !file.open(IO_ReadOnly) ) return errorExit(i18n("Could not open filename \"%1\".").arg(filename), ARG_ERROR);
if ( Programmer::manager->programmer()==0 ) {
Programmer::manager->createProgrammer(_device);
if ( !Programmer::manager->programmer()->simpleConnectHardware() ) return EXEC_ERROR;
@ -330,7 +330,7 @@ CLI::ExitCode CLI::Interactive::executeRawCommands(const TQString &filename)
} else {
TQString rs;
if ( !programmer->hardware()->rawRead(s.length(), rs) ) return EXEC_ERROR;
if ( rs!=s ) log(Log::LineType::Warning, i18n("Read string is different than expected: %1 (%2).").tqarg(rs).tqarg(s));
if ( rs!=s ) log(Log::LineType::Warning, i18n("Read string is different than expected: %1 (%2).").arg(rs).arg(s));
}
}
return okExit(i18n("End of command file reached."));

@ -25,7 +25,7 @@ Port::Description Programmer::CliManager::portDescription() const
if ( CLI::_port=="usb" ) return Port::Description(PortType::USB, TQString());
PortType type = Port::findType(CLI::_port);
if ( type==PortType::Nb_Types ) {
log->log(Log::LineType::Warning, i18n("Could not find device \"%1\" as serial or parallel port. Will try to open as serial port.").tqarg(CLI::_port));
log->log(Log::LineType::Warning, i18n("Could not find device \"%1\" as serial or parallel port. Will try to open as serial port.").arg(CLI::_port));
type = PortType::Serial;
}
return Port::Description(type, CLI::_port);

@ -112,7 +112,7 @@ CLI::ExitCode CLI::Main::deviceList()
log(Log::LineType::Normal, i18n("Supported devices:"));
devices = Programmer::lister().supportedDevices();
} else {
log(Log::LineType::Normal, i18n("Supported devices for \"%1\":").tqarg(_progGroup->label()));
log(Log::LineType::Normal, i18n("Supported devices for \"%1\":").arg(_progGroup->label()));
devices = _progGroup->supportedDevices();
}
qHeapSort(devices);
@ -124,7 +124,7 @@ CLI::ExitCode CLI::Main::deviceList()
CLI::ExitCode CLI::Main::portList()
{
if (_progGroup) log(Log::LineType::Normal, i18n("Detected ports supported by \"%1\":").tqarg(_progGroup->label()));
if (_progGroup) log(Log::LineType::Normal, i18n("Detected ports supported by \"%1\":").arg(_progGroup->label()));
else log(Log::LineType::Normal, i18n("Detected ports:"));
FOR_EACH(PortType, type) {
if ( _progGroup && !_progGroup->isPortSupported(type) ) continue;
@ -146,7 +146,7 @@ CLI::ExitCode CLI::Main::portList()
CLI::ExitCode CLI::Main::rangeList()
{
log(Log::LineType::Normal, i18n("Memory ranges for PIC/dsPIC devices:"));
FOR_EACH(Pic::MemoryRangeType, type) log(Log::LineType::Normal, TQString(" %1").tqarg(type.key()));
FOR_EACH(Pic::MemoryRangeType, type) log(Log::LineType::Normal, TQString(" %1").arg(type.key()));
return OK;
}
@ -170,9 +170,9 @@ CLI::ExitCode CLI::Main::prepareCommand(const TQString &command)
TQStringList errors, warnings;
Device::Memory::WarningTypes warningTypes;
if ( !_memory->load(file.stream(), errors, warningTypes, warnings) )
return errorExit(i18n("Could not load hex file \"%1\".").tqarg(errors[0]), FILE_ERROR);
return errorExit(i18n("Could not load hex file \"%1\".").arg(errors[0]), FILE_ERROR);
if ( warningTypes!=Device::Memory::NoWarning )
log(Log::LineType::Warning, i18n("Hex file seems incompatible with device \"%1\".").tqarg(warnings.join(" ")));
log(Log::LineType::Warning, i18n("Hex file seems incompatible with device \"%1\".").arg(warnings.join(" ")));
}
} else if ( properties & OutputHex ) {
if ( !_force && _hexUrl.exists() ) return errorExit(i18n("Output hex filename already exists."), FILE_ERROR);
@ -299,7 +299,7 @@ CLI::ExitCode CLI::Main::executeCommand(const TQString &command)
PURL::File file(_hexUrl, *_view);
if ( !file.openForWrite() ) return FILE_ERROR;
if ( !_memory->save(file.stream(), _format) )
return errorExit(i18n("Error while writing file \"%1\".").tqarg(_hexUrl.pretty()), FILE_ERROR);
return errorExit(i18n("Error while writing file \"%1\".").arg(_hexUrl.pretty()), FILE_ERROR);
return OK;
}
if ( command=="erase" ) {
@ -328,13 +328,13 @@ CLI::ExitCode CLI::Main::checkProgrammer()
if ( _progGroup->isSoftware() && _progGroup->supportedDevices().isEmpty() )
return errorExit(i18n("Please check installation of selected software debugger."), NOT_SUPPORTED_ERROR);
if ( _device && !_progGroup->isSupported(_device->name()) )
return errorExit(i18n("The selected device \"%1\" is not supported by the selected programmer.").tqarg(_device->name()), NOT_SUPPORTED_ERROR);
return errorExit(i18n("The selected device \"%1\" is not supported by the selected programmer.").arg(_device->name()), NOT_SUPPORTED_ERROR);
if ( !_hardware.isEmpty() ) {
::Hardware::Config *config = _progGroup->hardwareConfig();
Port::Description pd = static_cast<Programmer::CliManager *>(Programmer::manager)->portDescription();
bool ok = (config==0 || config->hardwareNames(pd.type).contains(_hardware));
delete config;
if ( !ok ) return errorExit(i18n("The selected programmer does not supported the specified hardware configuration (\"%1\").").tqarg(_hardware), NOT_SUPPORTED_ERROR);
if ( !ok ) return errorExit(i18n("The selected programmer does not supported the specified hardware configuration (\"%1\").").arg(_hardware), NOT_SUPPORTED_ERROR);
}
return OK;
}
@ -346,7 +346,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
if ( value.isEmpty() ) return OK;
_progGroup = Programmer::lister().group(value.lower());
if (_progGroup) return checkProgrammer();
return errorExit(i18n("Unknown programmer \"%1\".").tqarg(value.lower()), ARG_ERROR);
return errorExit(i18n("Unknown programmer \"%1\".").arg(value.lower()), ARG_ERROR);
}
if ( property=="hardware" ) { _hardware = value; return OK; }
if ( property=="device" || property=="processor" ) {
@ -357,7 +357,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
TQString s = value.upper();
_device = Device::lister().data(s);
Debugger::manager->updateDevice();
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").tqarg(s), ARG_ERROR);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").arg(s), ARG_ERROR);
Debugger::manager->init();
return checkProgrammer();
}
@ -372,7 +372,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
_format = HexBuffer::Format(i);
return OK;
}
return errorExit(i18n("Unknown hex file format \"%1\".").tqarg(s), ARG_ERROR);
return errorExit(i18n("Unknown hex file format \"%1\".").arg(s), ARG_ERROR);
}
if ( property=="port" ) { _port = value; return OK; }
if ( property=="firmware-dir" ) { _firmwareDir = value; return OK; }
@ -390,7 +390,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
if ( _device && !Debugger::manager->init() ) return ARG_ERROR;
return OK;
}
return errorExit(i18n("Unknown property \"%1\"").tqarg(property), ARG_ERROR);
return errorExit(i18n("Unknown property \"%1\"").arg(property), ARG_ERROR);
}
TQString CLI::Main::executeGetCommand(const TQString &property)
@ -438,7 +438,7 @@ TQString CLI::Main::executeGetCommand(const TQString &property)
if ( !_coffUrl.isEmpty() ) return _coffUrl.pretty();
return i18n("<not set>");
}
log(Log::LineType::SoftError, i18n("Unknown property \"%1\"").tqarg(property));
log(Log::LineType::SoftError, i18n("Unknown property \"%1\"").arg(property));
return TQString();
}

@ -92,21 +92,21 @@ bool GeneratorCheck::execute(const Device::Data &data)
// run compiler
Process::State state = Process::runSynchronously(*_helper->_cprocess, Process::Start, 2000); // 2s timeout
if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running compilation")
if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in compilation for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).tqarg(TQString()))
if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in compilation for %1:\n%2%3").arg(data.name()).arg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).arg(TQString()))
// run linker
if (_helper->_lprocess) {
state = Process::runSynchronously(*_helper->_lprocess, Process::Start, 2000); // 2s timeout
if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running linking")
if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in linking for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).tqarg(TQString()))
if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in linking for %1:\n%2%3").arg(data.name()).arg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).arg(TQString()))
}
// load hex file
if ( !_fhex->openForRead() ) TEST_FAILED_RETURN("")
TQStringList errors, warnings;
Device::Memory::WarningTypes warningTypes;
if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex into memory: %1").tqarg(errors.join(" ")))
//if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(TQString("Warning loading hex into memory: %1").tqarg(warnings.join(" ")))
if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex into memory: %1").arg(errors.join(" ")))
//if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(TQString("Warning loading hex into memory: %1").arg(warnings.join(" ")))
TEST_PASSED
return true;
@ -172,8 +172,8 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data)
}
if ( name1==name2 ) continue;
TEST_FAILED_RETURN(TQString("Config bits are different in %1: set\"%2\"=(%3) != compiled=%4)")
.tqarg(cmask.name).tqarg(cmask.values[l2].name)
.tqarg(toHexLabel(word2.maskWith(cmask.value), nbChars)).tqarg(toHexLabel(word1.maskWith(cmask.value), nbChars)))
.arg(cmask.name).arg(cmask.values[l2].name)
.arg(toHexLabel(word2.maskWith(cmask.value), nbChars)).arg(toHexLabel(word1.maskWith(cmask.value), nbChars)))
}
}
}
@ -198,7 +198,7 @@ bool TemplateGeneratorCheck::init(const Device::Data &data)
PURL::ToolType ttype = sfamily.data().toolType;
SourceLine::List lines = _helper->generator()->templateSourceFile(ttype, data, ok);
_source = SourceLine::text(sfamily, lines, 2);
if (!ok) TEST_FAILED_RETURN(TQString("Incomplete template generator for %1").tqarg(data.name()))
if (!ok) TEST_FAILED_RETURN(TQString("Incomplete template generator for %1").arg(data.name()))
return true;
}

@ -50,7 +50,7 @@ void ChecksumCheck::setProtection(const Pic::Data &data, const Pic::Checksum::Da
bool ChecksumCheck::checkChecksum(BitValue checksum, const TQString &label)
{
BitValue c = _memory->checksum();
if ( c!=checksum ) TEST_FAILED_RETURN(TQString("%1 %2/%3").tqarg(label).tqarg(toHexLabel(c, 4)).tqarg(toHexLabel(checksum, 4)))
if ( c!=checksum ) TEST_FAILED_RETURN(TQString("%1 %2/%3").arg(label).arg(toHexLabel(c, 4)).arg(toHexLabel(checksum, 4)))
return true;
}

@ -52,7 +52,7 @@ bool SaveLoadMemoryCheck::execute(const Device::Data &data)
if ( !_fdest->openForRead() ) TEST_FAILED_RETURN("")
TQStringList errors, warnings;
Device::Memory::WarningTypes wtypes;
if ( !_memory2->load(_fdest->stream(), errors, wtypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex file into memory %1").tqarg(data.name()))
if ( !_memory2->load(_fdest->stream(), errors, wtypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex file into memory %1").arg(data.name()))
// compare checksums
if ( _memory1->checksum()!=_memory2->checksum() ) TEST_FAILED_RETURN("Memory saved and loaded is different")

@ -76,7 +76,7 @@ bool Debugger::Base::halt()
if ( !softHalt(success) ) return false;
if ( !success ) return hardHalt();
if ( !update() ) return false;
log(Log::LineType::Information, TQString("Halted at %1").tqarg(toHexLabel(pc(), _programmer.device()->nbCharsAddress())));
log(Log::LineType::Information, TQString("Halted at %1").arg(toHexLabel(pc(), _programmer.device()->nbCharsAddress())));
_programmer.setState(::Programmer::Halted);
return true;
}

@ -72,13 +72,13 @@ bool Programmer::Base::simpleConnectHardware()
if (_device) {
TQString label = _group.label();
if ( group().isSoftware() )
log(Log::LineType::Information, i18n("Connecting %1 with device %2...").tqarg(label).tqarg(_device->name()));
log(Log::LineType::Information, i18n("Connecting %1 with device %2...").arg(label).arg(_device->name()));
else {
if ( !_hardware->name().isEmpty() ) label += "[" + _hardware->name() + "]";
Port::Description pd = _hardware->portDescription();
TQString s = pd.type.label();
if (pd.type.data().withDevice) s += " (" + pd.device + ")";
log(Log::LineType::Information, i18n("Connecting %1 on %2 with device %3...").tqarg(label).tqarg(s).tqarg(_device->name()));
log(Log::LineType::Information, i18n("Connecting %1 on %2 with device %3...").arg(label).arg(s).arg(_device->name()));
}
}
return _hardware->connectHardware();
@ -98,7 +98,7 @@ bool Programmer::Base::connectHardware()
if ( !checkFirmwareVersion() ) return false;
if ( !setTargetPowerOn(false) ) return false;
if ( !setTarget() ) return false;
log(Log::LineType::Information, i18n(" Set target self powered: %1").tqarg(_targetSelfPowered ? "true" : "false"));
log(Log::LineType::Information, i18n(" Set target self powered: %1").arg(_targetSelfPowered ? "true" : "false"));
if ( !setTargetPowerOn(!_targetSelfPowered) ) return false;
if ( !internalSetupHardware() ) return false;
if ( !readVoltages() ) return false;
@ -133,30 +133,30 @@ bool Programmer::Base::checkFirmwareVersion()
{
if ( _mode==BootloadMode ) log(Log::LineType::Information, i18n("Programmer is in bootload mode."));
if ( !_firmwareVersion.isValid() ) return true;
log(Log::LineType::Information, i18n("Firmware version is %1").tqarg(_firmwareVersion.pretty()));
log(Log::LineType::Information, i18n("Firmware version is %1").arg(_firmwareVersion.pretty()));
VersionData vd = _firmwareVersion.toWithoutDot();
VersionData tmp = firmwareVersion(FirmwareVersionType::Max);
if ( tmp.isValid() && tmp.toWithoutDot()<vd ) {
VersionData mplab = mplabVersion(FirmwareVersionType::Max);
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").tqarg(mplab.prettyWithoutDot()) : TQString());
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").arg(mplab.prettyWithoutDot()) : TQString());
log(Log::LineType::Warning, i18n("The firmware version (%1) is higher than the version tested with piklab (%2%3).\n"
"You may experience problems.").tqarg(_firmwareVersion.pretty()).tqarg(tmp.pretty()).tqarg(s));
"You may experience problems.").arg(_firmwareVersion.pretty()).arg(tmp.pretty()).arg(s));
return true;
}
tmp = firmwareVersion(FirmwareVersionType::Min);
if ( tmp.isValid() && vd<tmp.toWithoutDot() ) {
VersionData mplab = mplabVersion(FirmwareVersionType::Min);
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").tqarg(mplab.prettyWithoutDot()) : TQString());
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").arg(mplab.prettyWithoutDot()) : TQString());
log(Log::LineType::Warning, i18n("The firmware version (%1) is lower than the version tested with piklab (%2%3).\n"
"You may experience problems.").tqarg(_firmwareVersion.pretty()).tqarg(tmp.pretty()).tqarg(s));
"You may experience problems.").arg(_firmwareVersion.pretty()).arg(tmp.pretty()).arg(s));
return true;
}
tmp = firmwareVersion(FirmwareVersionType::Recommended);
if ( tmp.isValid() && vd<tmp.toWithoutDot() ) {
VersionData mplab = mplabVersion(FirmwareVersionType::Recommended);
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").tqarg(mplab.prettyWithoutDot()) : TQString());
TQString s = (mplab.isValid() ? " " + i18n("MPLAB %1").arg(mplab.prettyWithoutDot()) : TQString());
log(Log::LineType::Warning, i18n("The firmware version (%1) is lower than the recommended version (%2%3).\n"
"It is recommended to upgrade the firmware.").tqarg(_firmwareVersion.pretty()).tqarg(tmp.pretty()).tqarg(s));
"It is recommended to upgrade the firmware.").arg(_firmwareVersion.pretty()).arg(tmp.pretty()).arg(s));
return true;
}
return true;
@ -243,11 +243,11 @@ void Programmer::Base::endProgramming()
bool Programmer::Base::uploadFirmware(const PURL::Url &url)
{
_progressMonitor.clear();
log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").tqarg(url.pretty()));
log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").arg(url.pretty()));
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
return false;
}
bool ok = doUploadFirmware(file);

@ -83,7 +83,7 @@ void Direct::Hardware::setPin(PinType type, bool on)
int pin = _data.pins[type];
if ( isGroundPin(pin) ) return;
uint p = (pin<0 ? -pin : pin)-1;
//log(Log::DebugLevel::Extra, TQString("Hardware::setPin %1 %2: %3 %4").tqarg(PIN_DATA[type].label).tqarg(pin).tqarg(on).tqarg(_data.clockDelay));
//log(Log::DebugLevel::Extra, TQString("Hardware::setPin %1 %2: %3 %4").arg(PIN_DATA[type].label).arg(pin).arg(on).arg(_data.clockDelay));
_port->setPinOn(p, on, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic));
if ( type==Clock ) Port::usleep(_data.clockDelay);
}
@ -95,7 +95,7 @@ bool Direct::Hardware::readBit()
uint p = (pin<0 ? -pin : pin)-1;
bool on;
_port->readPin(p, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic), on);
//log(Log::DebugLevel::Extra, TQString("Hardware::read DataIn %2: %3").tqarg(pin).tqarg(on));
//log(Log::DebugLevel::Extra, TQString("Hardware::read DataIn %2: %3").arg(pin).arg(on));
return on;
}
@ -107,7 +107,7 @@ uint Direct::Hardware::nbPins(Port::IODir dir) const
TQString Direct::Hardware::pinLabelForIndex(Port::IODir dir, uint i) const
{
Port::PinData pd = _port->pinData(dir)[i];
return TQString("%1 (%2)").tqarg(pd.pin+1).tqarg(pd.label);
return TQString("%1 (%2)").arg(pd.pin+1).arg(pd.label);
}
Port::IODir Direct::Hardware::ioTypeForPin(int pin) const

@ -105,7 +105,7 @@ bool Direct::pic16::doWrite(Pic::MemoryRangeType type, const Device::Array &data
gotoMemory(type);
for (uint i = 0; i<data.count(); ) {
if ( !writeWords(type, data, i, force) ) {
log(Log::LineType::Error, i18n("Error programming %1 at %2.").tqarg(type.label()).tqarg(toHexLabel(i, 8)));
log(Log::LineType::Error, i18n("Error programming %1 at %2.").arg(type.label()).arg(toHexLabel(i, 8)));
return false;
}
}
@ -134,7 +134,7 @@ bool Direct::pic16::writeWords(Pic::MemoryRangeType type, const Device::Array &d
}
}
startProg(type);
TQString cmd = TQString("w%1").tqarg(waitProgTime(type));
TQString cmd = TQString("w%1").arg(waitProgTime(type));
pulseEngine(cmd.latin1());
endProg(type);
return true;

@ -27,11 +27,11 @@ void Direct::P18F::program(Type type)
TQString cmd;
switch (type) {
case Code:
cmd = TQString("d,C,c,C,c,C,c,Cw%1cw%2X0000,").tqarg(programHighTime(Code)).tqarg(programLowTime());
cmd = TQString("d,C,c,C,c,C,c,Cw%1cw%2X0000,").arg(programHighTime(Code)).arg(programLowTime());
break;
case Erase:
pulseEngine("k0,X0000,"); // NOP
cmd = TQString("k0;w%1;w%2;X0000").tqarg(programHighTime(type)).tqarg(programLowTime());
cmd = TQString("k0;w%1;w%2;X0000").arg(programHighTime(type)).arg(programLowTime());
break;
case Eeprom:
for (;;) {
@ -41,7 +41,7 @@ void Direct::P18F::program(Type type)
BitValue b = get_byte();
if ( !b.bit(1) ) break; // WR bit clear
}
cmd = TQString("w%1").tqarg(programLowTime());
cmd = TQString("w%1").arg(programLowTime());
break;
}
pulseEngine(cmd);
@ -234,7 +234,7 @@ void Direct::P18F1220::program(Type type)
{
if ( type==Eeprom ) {
pulseEngine("k0,X0000,"); // NOP
TQString cmd = TQString("k0;w%1;w%2;X0000").tqarg(programHighTime(type)).tqarg(programLowTime());
TQString cmd = TQString("k0;w%1;w%2;X0000").arg(programHighTime(type)).arg(programLowTime());
pulseEngine(cmd);
} else P18F::program(type);
}

@ -68,18 +68,18 @@ uint Direct::Mem24DeviceSpecific::controlByte(uint address, Operation operation)
bool Direct::Mem24DeviceSpecific::setAddress(uint address)
{
log(Log::DebugLevel::Extra, TQString("set address %1").tqarg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
log(Log::DebugLevel::Extra, TQString("set address %1").arg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
if ( !start() ) return false;
uint bsize = device().nbBytes() / device().nbBlocks();
uint block = address / bsize;
log(Log::DebugLevel::Extra, TQString(" in block #%1/%2").tqarg(block).tqarg(device().nbBlocks()));
log(Log::DebugLevel::Extra, TQString(" in block #%1/%2").arg(block).arg(device().nbBlocks()));
uint cbyte = controlByte(address, Write);
log(Log::DebugLevel::Max, TQString(" control byte is %1").tqarg(toHexLabel(cbyte, 2)));
log(Log::DebugLevel::Max, TQString(" control byte is %1").arg(toHexLabel(cbyte, 2)));
if ( !writeByteAck(cbyte) ) return false;
uint nb = nbBytes(bsize-1);
for (int i=nb-1; i>=0; i--) {
uint add = (address >> 8*i) & 0xFF;
log(Log::DebugLevel::Max, TQString(" byte #%1: %2").tqarg(i).tqarg(toHexLabel(add, 2)));
log(Log::DebugLevel::Max, TQString(" byte #%1: %2").arg(i).arg(toHexLabel(add, 2)));
if ( !writeByteAck(add) ) return false;
}
return true;
@ -107,7 +107,7 @@ bool Direct::Mem24DeviceSpecific::doWrite(const Device::Array &data)
// page by page (page_size==1: byte by byte)
uint nbPages = device().nbBytes() / device().nbBytesPage();
for (uint i=0; i<nbPages; i++) {
log(Log::DebugLevel::Extra, TQString("write page #%1/%2").tqarg(i).tqarg(nbPages));
log(Log::DebugLevel::Extra, TQString("write page #%1/%2").arg(i).arg(nbPages));
uint address = i * device().nbBytesPage();
// write bytes
if ( !setAddress(address) ) return false;
@ -122,7 +122,7 @@ bool Direct::Mem24DeviceSpecific::doWrite(const Device::Array &data)
if ( !writeByte(controlByte(address, Write), acked) ) return false;
if (acked) break;
if ( time.elapsed()>200 ) { // 200 ms timeout
log(Log::LineType::Error, i18n("Timeout writing at address %1").tqarg(toHexLabel(address, nbChars(device().nbBytes()))));
log(Log::LineType::Error, i18n("Timeout writing at address %1").arg(toHexLabel(address, nbChars(device().nbBytes()))));
return false;
}
}

@ -19,7 +19,7 @@ Direct::PulseEngine::PulseEngine(::Programmer::Base &base)
BitValue Direct::PulseEngine::pulseEngine(const TQString &cmd, BitValue value)
{
_pbase.log(Log::DebugLevel::Extra, TQString("pulse engine: %1").tqarg(cmd));
_pbase.log(Log::DebugLevel::Extra, TQString("pulse engine: %1").arg(cmd));
TQByteArray a = toAscii(cmd);
BitValue res = 0;
for (const char *ptr=a.data(); (ptr-a.data())<int(a.count()); ++ptr)

@ -138,7 +138,7 @@ void GPSim::Hardware::internalDisconnectHardware()
bool GPSim::Hardware::execute(const TQString &command, bool synchronous, TQStringList *output)
{
log(Log::DebugLevel::Normal, TQString("command: %1").tqarg(command));
log(Log::DebugLevel::Normal, TQString("command: %1").arg(command));
if (output) output->clear();
if ( !_manager->sendCommand(command, synchronous) ) return false;
if (output) *output = _manager->process().sout();
@ -147,7 +147,7 @@ bool GPSim::Hardware::execute(const TQString &command, bool synchronous, TQStrin
bool GPSim::Hardware::signal(uint n, bool synchronous, TQStringList *output)
{
log(Log::DebugLevel::Normal, TQString("signal: %1").tqarg(n));
log(Log::DebugLevel::Normal, TQString("signal: %1").arg(n));
if (output) output->clear();
if ( !_manager->sendSignal(n, synchronous) ) return false;
if (output) *output = _manager->process().sout();

@ -104,7 +104,7 @@ bool GPSim::Debugger::readWreg(BitValue &value)
TQString w = (_coff->symbol("_WREG") ? "_WREG" : "W");
TQString s;
if ( !findRegExp(lines, "^\\s*[0-9A-Fa-f]+\\s+(\\w+)\\s*=\\s*([0-9A-Fa-f]+)", w, s) ) {
log(Log::LineType::Error, i18n("Error reading register \"%1\"").tqarg(w));
log(Log::LineType::Error, i18n("Error reading register \"%1\"").arg(w));
return false;
}
value = fromHex(s, 0);
@ -126,7 +126,7 @@ bool GPSim::Debugger::getRegister(const TQString &name, BitValue &value)
for (; i<uint(lines.count()); i++)
if ( r.exactMatch(lines[i]) ) break;
if ( i==uint(lines.count()) ) {
log(Log::LineType::Error, i18n("Error reading register \"%1\"").tqarg(name));
log(Log::LineType::Error, i18n("Error reading register \"%1\"").arg(name));
return false;
}
value = fromHex(r.cap(1), 0);
@ -138,7 +138,7 @@ bool GPSim::Debugger::getRegister(Address address, BitValue &value)
const Pic::RegistersData &rdata = device()->registersData();
TQString name = toHex(address, rdata.nbCharsAddress());
if ( hardware()->version()<VersionData(0, 22, 0) ) return getRegister("0x" + name, value);
return getRegister(TQString("ramData[$%1]").tqarg(name), value);
return getRegister(TQString("ramData[$%1]").arg(name), value);
}
bool GPSim::Debugger::readRegister(const Register::TypeData &data, BitValue &value)
@ -162,14 +162,14 @@ bool GPSim::Debugger::setRegister(const TQString &name, BitValue value)
return true;
}
const Pic::RegistersData &rdata = device()->registersData();
TQString s = TQString("%1 = %2").tqarg(name).tqarg(toHexLabel(value, rdata.nbChars()));
TQString s = TQString("%1 = %2").arg(name).arg(toHexLabel(value, rdata.nbChars()));
return hardware()->execute(s, true);
}
bool GPSim::Debugger::setRegister(Address address, BitValue value)
{
const Pic::RegistersData &rdata = device()->registersData();
TQString s = TQString("ramData[$%1]").tqarg(toHex(address, rdata.nbCharsAddress()));
TQString s = TQString("ramData[$%1]").arg(toHex(address, rdata.nbCharsAddress()));
return setRegister(s, value);
}
@ -204,7 +204,7 @@ bool GPSim::Debugger::updatePortStatus(uint index, TQMap<uint, Device::PortBitDa
if ( !hardware()->execute("symbol " + name, true, &lines) ) return false;
TQString pattern = "^(\\w+)=([^\\s])+\\s*", value;
if ( !findRegExp(lines, pattern, "bitState", value) || value.length()!=1 ) {
log(Log::LineType::Error, i18n("Error reading state of IO bit: %1").tqarg(name));
log(Log::LineType::Error, i18n("Error reading state of IO bit: %1").arg(name));
return false;
}
switch (value[0].latin1()) {
@ -218,24 +218,24 @@ bool GPSim::Debugger::updatePortStatus(uint index, TQMap<uint, Device::PortBitDa
case 'X': bits[i].state = Device::Unknown; break;
default:
bits[i].state = Device::Unknown;
log(Log::LineType::Warning, i18n("Unknown state for IO bit: %1 (%2)").tqarg(name).tqarg(value));
log(Log::LineType::Warning, i18n("Unknown state for IO bit: %1 (%2)").arg(name).arg(value));
break;
}
if ( !findRegExp(lines, pattern, "Driving", value) || value.length()!=1 ) {
log(Log::LineType::Error, i18n("Error reading driving state of IO bit: %1").tqarg(name));
log(Log::LineType::Error, i18n("Error reading driving state of IO bit: %1").arg(name));
return false;
}
bits[i].driving = ( value[0]=='1' );
if (bits[i].driving) {
if ( !findRegExp(lines, pattern, "drivingState", value) || value.length()!=1 ) {
log(Log::LineType::Error, i18n("Error reading driving state of IO bit: %1").tqarg(name));
log(Log::LineType::Error, i18n("Error reading driving state of IO bit: %1").arg(name));
return false;
}
bits[i].drivingState = (value[0]=='0' ? Device::IoLow : Device::IoHigh);
bits[i].drivenState = Device::IoUnknown;
} else {
if ( !findRegExp(lines, pattern, "drivenState", value) || value.length()!=1 ) {
log(Log::LineType::Error, i18n("Error reading driven state of IO bit: %1").tqarg(name));
log(Log::LineType::Error, i18n("Error reading driven state of IO bit: %1").arg(name));
return false;
}
bits[i].drivenState = (value[0]=='0' ? Device::IoLow : Device::IoHigh);

@ -32,7 +32,7 @@ void GPSim::ConfigWidget::updateStatus()
ProcessManager manager(0);
if ( !manager.start() ) _status->setText(i18n("Could not start \"gpsim\""));
else if ( !manager.getVersion(version) || !version.isValid() ) _status->setText(i18n("Could not detect \"gpsim\" version"));
else _status->setText(i18n("Found version \"%1\"").tqarg(version.pretty()));
else _status->setText(i18n("Found version \"%1\"").arg(version.pretty()));
}
//----------------------------------------------------------------------------

@ -47,7 +47,7 @@ Hardware::EditDialog::EditDialog(ConfigWidget *cwidget, const TQString &name, co
_name = new TQLineEdit(name, plainPage());
grid->addWidget(_name, 0, 1);
label = new TQLabel(i18n("%1 at %2:").tqarg(pd.type.label()).tqarg(pd.device), plainPage());
label = new TQLabel(i18n("%1 at %2:").arg(pd.type.label()).arg(pd.device), plainPage());
grid->addWidget(label, 1, 0);
label = new TQLabel(plainPage());
grid->addWidget(label, 1, 1);
@ -73,7 +73,7 @@ void Hardware::EditDialog::slotOk()
}
TQStringList names = _cwidget->_config->hardwareNames(PortType::Nb_Types); // all hardwares
if ( names.contains(_name->text()) ) {
if ( !MessageBox::askContinue(i18n("Do you want to overwrite this custom hardware \"%1\"?").tqarg(_name->text()),
if ( !MessageBox::askContinue(i18n("Do you want to overwrite this custom hardware \"%1\"?").arg(_name->text()),
KStdGuiItem::save()) ) return;
}
delete _oldData;
@ -174,7 +174,7 @@ void Hardware::ConfigWidget::updateList(PortType type)
_names = _config->hardwareNames(type);
for (uint i=0; i<_names.count(); i++) {
bool standard = _config->isStandardHardware(_names[i]);
TQString s = (standard ? _config->label(_names[i]) : i18n("%1 <custom>").tqarg(_names[i]));
TQString s = (standard ? _config->label(_names[i]) : i18n("%1 <custom>").arg(_names[i]));
_configCombo->insertItem(s);
}
}
@ -196,7 +196,7 @@ void Hardware::ConfigWidget::editClicked()
void Hardware::ConfigWidget::deleteClicked()
{
TQString name = _names[_configCombo->currentItem()];
if ( !MessageBox::askContinue(i18n("Do you want to delete custom hardware \"%1\"?").tqarg(name),
if ( !MessageBox::askContinue(i18n("Do you want to delete custom hardware \"%1\"?").arg(name),
KStdGuiItem::del()) ) return;
_config->deleteCustomHardware(name);
updateList(_hc->portDescription().type);

@ -85,7 +85,7 @@ void PortSelector::addPortType(const Port::Description &pd)
KTextBrowser *comment = new KTextBrowser(_main);
TQString text = (notAvailable ? notAvailableMessage : noDeviceMessage);
text += "<p>";
text += i18n("<a href=\"%1\">See Piklab homepage for help</a>.").tqarg(Piklab::URLS[Piklab::Support]);
text += i18n("<a href=\"%1\">See Piklab homepage for help</a>.").arg(Piklab::URLS[Piklab::Support]);
comment->setText(text);
_grid->addMultiCellWidget(comment, 3*(_bgroup->count()-1)+1,3*(_bgroup->count()-1)+1, 0,3);
}

@ -31,7 +31,7 @@ bool Icd1::Hardware::internalConnect(const TQString &mode)
Port::msleep(1);
port()->setPinOn(Port::Serial::RTS, true, Port::PositiveLogic);
if ( s.upper()!=mode ) {
log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").tqarg(mode));
log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").arg(mode));
return false;
}
return true;
@ -79,12 +79,12 @@ bool Icd1::Hardware::readVoltages(VoltagesData &voltages)
if ( !sendCommand(0x701C, &res) ) return false;
voltages[Pic::TargetVdd].value = (2.050 / 256) * res.toUInt(); // voltage at AN0 pin
voltages[Pic::TargetVdd].value /= (4.7 / 14.7); // voltage at Vcc
log(Log::DebugLevel::Max, TQString("Vdd: %1 %2").tqarg(toHexLabel(res, 4)).tqarg(voltages[Pic::TargetVdd].value));
log(Log::DebugLevel::Max, TQString("Vdd: %1 %2").arg(toHexLabel(res, 4)).arg(voltages[Pic::TargetVdd].value));
voltages[Pic::TargetVdd].error = false;
if ( !sendCommand(0x701D, &res) ) return false;
voltages[Pic::TargetVpp].value = (2.050 / 256) * res.byte(0); // voltage at AN1 pin
voltages[Pic::TargetVpp].value /= (10.0 / 110.0); // voltage at Vpp
log(Log::DebugLevel::Max, TQString("Vpp: %1 %2").tqarg(toHexLabel(res, 4)).tqarg(voltages[Pic::TargetVpp].value));
log(Log::DebugLevel::Max, TQString("Vpp: %1 %2").arg(toHexLabel(res, 4)).arg(voltages[Pic::TargetVpp].value));
voltages[Pic::TargetVpp].error = false;
return sendCommand(0x7001);
}
@ -106,7 +106,7 @@ bool Icd1::Hardware::selfTest()
BitValue res;
if ( !sendCommand(0x700B, &res, 5000) ) return false;
if ( res!=0 ) {
log(Log::LineType::Warning, i18n("Self-test failed (returned value is %1)").tqarg(toLabel(res)));
log(Log::LineType::Warning, i18n("Self-test failed (returned value is %1)").arg(toLabel(res)));
return false;
}
return true;
@ -152,7 +152,7 @@ bool Icd1::Hardware::eraseAll()
if ( !sendCommand(0x7007, &res) ) return false;
if ( !sendCommand(0x7001) ) return false; // disable Vpp
if ( res!=0x3FFF ) {
log(Log::LineType::Error, i18n("Erase failed (returned value is %1)").tqarg(toHexLabel(res, 4)));
log(Log::LineType::Error, i18n("Erase failed (returned value is %1)").arg(toHexLabel(res, 4)));
return false;
}
return true;

@ -61,7 +61,7 @@ bool Icd1::SerialPort::sendCommand(uint cmd)
synchronize();
char c[7] = "$XXXX\r";
TQString cs = toHex(cmd, 4);
log(Log::DebugLevel::Extra, TQString("Send command: %1").tqarg(toPrintable(cs, PrintAlphaNum)));
log(Log::DebugLevel::Extra, TQString("Send command: %1").arg(toPrintable(cs, PrintAlphaNum)));
c[1] = cs[0].latin1();
c[2] = cs[1].latin1();
c[3] = cs[2].latin1();

@ -38,8 +38,8 @@ Device::Array Icd::DeviceSpecific::prepareRange(Pic::MemoryRangeType type, const
uint end = (force ? data.count() : findNonMaskEnd(type, data));
nbWords = end - wordOffset + 1;
log(Log::DebugLevel::Normal, TQString(" start=%1 nbWords=%2 total=%3 force=%4")
.tqarg(toHexLabel(wordOffset, device().nbCharsAddress())).tqarg(toHexLabel(nbWords, device().nbCharsAddress()))
.tqarg(toHexLabel(data.count(), device().nbCharsAddress())).tqarg(force ? "true" : "false"));
.arg(toHexLabel(wordOffset, device().nbCharsAddress())).arg(toHexLabel(nbWords, device().nbCharsAddress()))
.arg(toHexLabel(data.count(), device().nbCharsAddress())).arg(force ? "true" : "false"));
}
_base.progressMonitor().addTaskProgress(data.count()-nbWords);
return data.mid(wordOffset, nbWords);

@ -170,14 +170,14 @@ bool Icd2::Hardware::setup()
TQString s;
if ( !_port->receive(2, s) ) return false;
if ( s!="02" ) {
log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").tqarg(s));
log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").arg(s));
return false;
}
// ??
if ( !command("08", 2) ) return false;
if ( _rx.mid(5, 2)!="00" ) {
log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").tqarg(_rx));
log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").arg(_rx));
return false;
}
@ -195,7 +195,7 @@ bool Icd2::Hardware::sendCommand(const TQString &s)
for (uint i=0; i<uint(s.length()); i++) chk += cs[i].latin1();
tx += toHex(chk, 2);
tx += '>';
log(Log::DebugLevel::Extra, TQString("send command: '%1'").tqarg(tx));
log(Log::DebugLevel::Extra, TQString("send command: '%1'").arg(tx));
TQByteArray a = toAscii(tx);
return _port->send(a.data(), a.count());
}
@ -207,7 +207,7 @@ bool Icd2::Hardware::receiveResponse(const TQString &command, uint responseSize,
if ( poll && _port->type()==PortType::USB ) {
if ( !static_cast<USBPort *>(_port)->poll(size, _rx) ) return false;
} else if ( !_port->receive(size, _rx, 180000) ) return false; // is 3 minutes enough ?? (we should really have an abort button here...)
log(Log::DebugLevel::Extra, TQString("received answer: '%1'").tqarg(_rx));
log(Log::DebugLevel::Extra, TQString("received answer: '%1'").arg(_rx));
if ( size!=fromHex(_rx.mid(1, 2), 0) ) {
log(Log::LineType::Error, i18n("Received length too short."));
return false;
@ -217,12 +217,12 @@ bool Icd2::Hardware::receiveResponse(const TQString &command, uint responseSize,
return false;
}
if ( _rx[0]!='[' || _rx[size-1]!=']' ) {
log(Log::LineType::Error, i18n("Malformed string received \"%1\"").tqarg(_rx));
log(Log::LineType::Error, i18n("Malformed string received \"%1\"").arg(_rx));
return false;
}
if ( command.mid(0, 2)!=_rx.mid(3, 2) ) {
log(Log::LineType::Error, i18n("Wrong return value (\"%1\"; was expecting \"%2\")")
.tqarg(_rx.mid(3, 2)).tqarg(command.mid(0, 2)));
.arg(_rx.mid(3, 2)).arg(command.mid(0, 2)));
return false;
}
// verify the checksum
@ -348,7 +348,7 @@ bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &da
TQString cs = s.mid(s.length()-3, 2);
if ( chk!=fromHex(cs, 0) ) {
log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").tqarg(cs).tqarg(toHex(chk, 2)));
log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").arg(cs).arg(toHex(chk, 2)));
return false;
}
return true;
@ -392,7 +392,7 @@ bool Icd2::Hardware::readMemory(Pic::MemoryRangeType type, uint wordOffset,
bool Icd2::Hardware::writeBlock(uint nbBytesWord, const Device::Array &data, uint wordIndex, uint nbWords)
{
log(Log::DebugLevel::Extra, TQString("writeBlock offset:%1 nbWords:%2 (size: %3)").tqarg(toHex(wordIndex, 8)).tqarg(toHex(nbWords, 8)).tqarg(toHex(data.size(), 8)));
log(Log::DebugLevel::Extra, TQString("writeBlock offset:%1 nbWords:%2 (size: %3)").arg(toHex(wordIndex, 8)).arg(toHex(nbWords, 8)).arg(toHex(data.size(), 8)));
Q_ASSERT( wordIndex+nbWords<=data.size() );
// prepare data
TQString s = "{";

@ -27,7 +27,7 @@ bool Icd2::Debugger::waitForTargetMode(Pic::TargetMode mode)
Port::msleep(200);
}
log(Log::LineType::Error, TQString("Timeout waiting for mode: %1 (target is in mode: %2).")
.tqarg(i18n(Pic::TARGET_MODE_LABELS[mode])).tqarg(i18n(Pic::TARGET_MODE_LABELS[rmode])));
.arg(i18n(Pic::TARGET_MODE_LABELS[mode])).arg(i18n(Pic::TARGET_MODE_LABELS[rmode])));
return false;
}
@ -59,7 +59,7 @@ bool Icd2::Debugger::setBreakpoints(const TQValueList<Address> &addresses)
{
if ( addresses.count()==0 ) return specific()->setBreakpoint(Address());
for (uint i=0; i<uint(addresses.count()); i++) {
log(Log::DebugLevel::Normal, TQString("Set breakpoint at %1").tqarg(toHexLabel(addresses[i], device()->nbCharsAddress())));
log(Log::DebugLevel::Normal, TQString("Set breakpoint at %1").arg(toHexLabel(addresses[i], device()->nbCharsAddress())));
if ( !specific()->setBreakpoint(addresses[i]) ) return false;
}
return true;
@ -147,25 +147,25 @@ bool Icd2::DebugProgrammer::internalSetupHardware()
if ( device()->is18Family() ) {
Debugger *debug = static_cast<Debugger *>(debugger());
reservedBank = static_cast<const P18FDebuggerSpecific *>(debug->specific())->reservedBank();
filename = TQString("de18F_BANK%1.hex").tqarg(TQString(toString(NumberBase::Dec, reservedBank, 2)));
} else filename = TQString("de%1.hex").tqarg(fdata.debugExec);
filename = TQString("de18F_BANK%1.hex").arg(TQString(toString(NumberBase::Dec, reservedBank, 2)));
} else filename = TQString("de%1.hex").arg(fdata.debugExec);
PURL::Url url = dir.findMatchingFilename(filename);
log(Log::DebugLevel::Normal, TQString(" Debug executive file: %1").tqarg(url.pretty()));
log(Log::DebugLevel::Normal, TQString(" Debug executive file: %1").arg(url.pretty()));
if ( !url.exists() ) {
log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").tqarg(url.pretty()));
log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").arg(url.pretty()));
return false;
}
// upload hex file
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
return false;
}
TQStringList errors;
HexBuffer hbuffer;
if ( !hbuffer.load(file.stream(), errors) ) {
log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").tqarg(url.pretty()).tqarg(errors[0]));
log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").arg(url.pretty()).arg(errors[0]));
return false;
}
uint nbWords = device()->nbWords(Pic::MemoryRangeType::Code);
@ -199,7 +199,7 @@ bool Icd2::DebugProgrammer::internalSetupHardware()
_deStart = specific()->findNonMaskStart(Pic::MemoryRangeType::Code, _deArray);
_deEnd = specific()->findNonMaskEnd(Pic::MemoryRangeType::Code, _deArray);
}
log(Log::DebugLevel::Extra, TQString("debug executive: \"%1\" %2:%3").tqarg(url.pretty()).tqarg(toHexLabel(_deStart, 4)).tqarg(toHexLabel(_deEnd, 4)));
log(Log::DebugLevel::Extra, TQString("debug executive: \"%1\" %2:%3").arg(url.pretty()).arg(toHexLabel(_deStart, 4)).arg(toHexLabel(_deEnd, 4)));
return Icd2::ProgrammerBase::internalSetupHardware();
}
@ -251,9 +251,9 @@ bool Icd2::DebugProgrammer::writeDebugExecutive()
uint inc = device()->addressIncrement(Pic::MemoryRangeType::Code);
Address address = device()->range(Pic::MemoryRangeType::Code).start + inc * (_deStart + i);
log(Log::LineType::Error, i18n("Device memory doesn't match debug executive (at address %1: reading %2 and expecting %3).")
.tqarg(toHexLabel(address, device()->nbCharsAddress()))
.tqarg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))
.tqarg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code))));
.arg(toHexLabel(address, device()->nbCharsAddress()))
.arg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))
.arg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code))));
return false;
}
return true;
@ -311,7 +311,7 @@ bool Icd2::DebugProgrammer::internalRead(Device::Memory *mem, const Device::Memo
bool Icd2::DebugProgrammer::readDebugExecutiveVersion()
{
if ( !hardware()->getDebugExecVersion(_debugExecutiveVersion) ) return false;
log(Log::LineType::Information, i18n(" Debug executive version: %1").tqarg(_debugExecutiveVersion.pretty()));
log(Log::LineType::Information, i18n(" Debug executive version: %1").arg(_debugExecutiveVersion.pretty()));
return true;
}

@ -50,7 +50,7 @@ bool Icd2::P16FDebuggerSpecific::beginInit(Device::Array *saved)
if ( !hardware()->setTargetReset(Pic::ResetHeld) ) return false;
double vdd;
if ( !hardware()->readVoltage(Pic::TargetVdd, vdd) ) return false;
log(Log::DebugLevel::Normal, TQString(" Target Vdd: %1 V").tqarg(vdd));
log(Log::DebugLevel::Normal, TQString(" Target Vdd: %1 V").arg(vdd));
if (saved) {
saved->resize(1);
@ -73,14 +73,14 @@ bool Icd2::P16FDebuggerSpecific::endInit(BitValue expectedPC)
//log(Log::LineType::Information, i18n("Detected custom ICD2"));
}
if ( value!=expectedPC ) {
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(value, 4)));
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(value, 4)));
return false;
}
if ( !setBreakpoint(0x0000) ) return false;
if ( !base().update() ) return false;
if ( base().pc()!=expectedPC ) {
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(base().pc(), 4)));
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(base().pc(), 4)));
return false;
}
return true;
@ -163,7 +163,7 @@ bool Icd2::P16F7X7DebuggerSpecific::init(bool last)
log(Log::DebugLevel::Normal, "Probably detected custom ICD2");
}
if ( value!=expectedPC )
log(Log::DebugLevel::Normal, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(value, 4)));
log(Log::DebugLevel::Normal, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(value, 4)));
if ( !setBreakpoint(0x0000) ) return false;
if ( !base().update() ) return false;
@ -241,7 +241,7 @@ bool Icd2::P18FDebuggerSpecific::reset()
log(Log::LineType::Information, i18n("Detected custom ICD2"));
}
if ( base().pc()!=expectedPC ) {
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(base().pc(), 4)));
log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(base().pc(), 4)));
return false;
}
return true;

@ -52,8 +52,8 @@ bool Icd2::ProgrammerBase::selfTest(bool ask)
if ( i!=0 ) s += "; ";
s += _testData.pretty(TestData::VoltageType(i));
}
log(Log::LineType::Warning, i18n("Self-test failed: %1").tqarg(s));
if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").tqarg(s)) ) {
log(Log::LineType::Warning, i18n("Self-test failed: %1").arg(s));
if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").arg(s)) ) {
logUserAbort();
return false;
}
@ -77,7 +77,7 @@ VersionData Icd2::ProgrammerBase::mplabVersion(::Programmer::FirmwareVersionType
bool Icd2::ProgrammerBase::setupFirmware()
{
const FamilyData &fdata = FAMILY_DATA[family(device()->name())];
log(Log::DebugLevel::Normal, TQString(" Firmware id is %1 and we want %2").tqarg(_firmwareId).tqarg(fdata.efid));
log(Log::DebugLevel::Normal, TQString(" Firmware id is %1 and we want %2").arg(_firmwareId).arg(fdata.efid));
if ( fdata.efid==_firmwareId ) return true;
log(Log::LineType::Information, i18n(" Incorrect firmware loaded."));
@ -87,17 +87,17 @@ bool Icd2::ProgrammerBase::setupFirmware()
TQString nameFilter = "ICD" + TQString::number(fdata.efid).rightJustify(2, '0') + "??????.hex";
TQStringList files = dir.files(nameFilter);
if ( files.isEmpty() ) {
log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").tqarg(nameFilter).tqarg(dir.path()));
log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").arg(nameFilter).arg(dir.path()));
return false;
}
// upload hex file
PURL::Url url(dir, files[files.count()-1]);
log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").tqarg(url.pretty()));
log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").arg(url.pretty()));
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
return false;
}
if ( !doUploadFirmware(file) ) return false;

@ -40,7 +40,7 @@ bool Icd2::SerialHardware::internalConnect(const TQString &mode)
if ( !_port->send(a.data(), a.count()) ) return false;
if ( !_port->receive(1, s) ) return false;
if ( s.upper()!=mode ) {
log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").tqarg(mode));
log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").arg(mode));
return false;
}
//log(Log::Debug, "set fast speed");

@ -128,7 +128,7 @@ bool Icd2::USBPort::poll(uint size, TQMemArray<uchar> &a)
if ( !doSequence(Poll, (char *)a.data(), size) ) return false;
if (_poll) break;
}
//log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").tqarg(toPrintable((const char *)a.data(), size)));
//log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").arg(toPrintable((const char *)a.data(), size)));
return true;
}
@ -152,7 +152,7 @@ Icd2::USBHardware::USBHardware(::Programmer::Base &base)
bool Icd2::USBHardware::internalConnect(const TQString &mode)
{
// load control messages for USB device if needed
log(Log::DebugLevel::Extra, TQString("need firmware ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0));
log(Log::DebugLevel::Extra, TQString("need firmware ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0));
if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE) ) {
USBPort port(ID_FIRMWARE, *this);
if ( !port.open() ) return false;
@ -163,7 +163,7 @@ bool Icd2::USBHardware::internalConnect(const TQString &mode)
}
port.close();
for (uint i=0; i<10; i++) {
log(Log::DebugLevel::Extra, TQString("client here ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0));
log(Log::DebugLevel::Extra, TQString("client here ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0));
if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_CLIENT) ) break;
Port::msleep(1000);
}

@ -19,7 +19,7 @@ bool Icd::ProgrammerBase::doUploadFirmware(PURL::File &file)
TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\": %2.").tqarg(file.url().pretty()).tqarg(errors[0]));
log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\": %2.").arg(file.url().pretty()).arg(errors[0]));
return false;
}
if ( warningTypes!=Pic::Memory::NoWarning ) {

@ -29,7 +29,7 @@ uint Icd2::XmlToData::familyIndex(const TQString &family) const
uint i = 0;
for (; Icd2::FAMILY_DATA[i].efid!=0; i++)
if ( family==Icd2::FAMILY_DATA[i].name ) break;
if ( Icd2::FAMILY_DATA[i].efid==0 ) qFatal(TQString("Family \"%1\" is unknown").tqarg(family));
if ( Icd2::FAMILY_DATA[i].efid==0 ) qFatal(TQString("Family \"%1\" is unknown").arg(family));
return i;
}

@ -81,7 +81,7 @@ bool Debugger::Manager::internalInit()
if ( !coffUrl().exists() ) return false;
Log::Base log;
log.setView(compileView());
log.log(Log::LineType::Information, i18n("Parsing COFF file: %1").tqarg(coffUrl().pretty()));
log.log(Log::LineType::Information, i18n("Parsing COFF file: %1").arg(coffUrl().pretty()));
_coff = new Coff::TextObject(_data, coffUrl());
if ( !_coff->parse(log) ) {
delete _coff;
@ -110,7 +110,7 @@ void Debugger::Manager::freeActiveBreakpoint()
uint max = programmerGroup()->maxNbBreakpoints(deviceData());
Q_ASSERT( nb<=max && max!=0 );
if ( nb==max ) {
log(Log::LineType::Warning, i18n("The number of active breakpoints is higher than the maximum for the current debugger (%1): disabling the last breakpoint.").tqarg(max));
log(Log::LineType::Warning, i18n("The number of active breakpoints is higher than the maximum for the current debugger (%1): disabling the last breakpoint.").arg(max));
Breakpoint::list().setState(last, Breakpoint::Disabled);
}
}
@ -384,7 +384,7 @@ bool Debugger::Manager::prepareDebugging()
break;
}
if ( i==Programmer::Nb_InputFileTypes ) {
log(Log::LineType::Error, i18n("Cannot start debugging session without input file (%1).").tqarg(first.pretty()));
log(Log::LineType::Error, i18n("Cannot start debugging session without input file (%1).").arg(first.pretty()));
return false;
}
}

@ -61,8 +61,8 @@ bool Programmer::Manager::internalInitProgramming(bool)
}
if ( !group().isSupported(device()->name()) ) {
if ( group().isSoftware() && group().supportedDevices().isEmpty() )
sorry(i18n("Could not detect supported devices for \"%1\". Please check installation.").tqarg(group().label()));
else sorry(i18n("The current programmer \"%1\" does not support device \"%2\".").tqarg(group().label()).tqarg(device()->name()));
sorry(i18n("Could not detect supported devices for \"%1\". Please check installation.").arg(group().label()));
else sorry(i18n("The current programmer \"%1\" does not support device \"%2\".").arg(group().label()).arg(device()->name()));
return false;
}
createProgrammer(device());

@ -42,13 +42,13 @@ bool PicdemBootloader::Port::receive(uint nb, TQMemArray<uchar> &data)
{
data.resize(nb);
if ( !read(0x81, (char *)data.data(), nb) ) return false;
log(Log::DebugLevel::Max, TQString("received: \"%1\"").tqarg(toPrintable(data, PrintEscapeAll)));
log(Log::DebugLevel::Max, TQString("received: \"%1\"").arg(toPrintable(data, PrintEscapeAll)));
return true;
}
bool PicdemBootloader::Port::send(const TQMemArray<uchar> &cmd)
{
log(Log::DebugLevel::Extra, TQString("send: \"%1\"").tqarg(toPrintable(cmd, PrintEscapeAll)));
log(Log::DebugLevel::Extra, TQString("send: \"%1\"").arg(toPrintable(cmd, PrintEscapeAll)));
return write(0x01, (const char *)cmd.data(), cmd.count());
}
@ -81,7 +81,7 @@ bool PicdemBootloader::Hardware::internalConnectHardware()
cmd.fill(0);
if ( !port().sendAndReceive(cmd, 4) ) return false;
VersionData version(cmd[3], cmd[2], 0);
log(Log::LineType::Information, i18n("Bootloader version %1 detected").tqarg(version.pretty()));
log(Log::LineType::Information, i18n("Bootloader version %1 detected").arg(version.pretty()));
if ( version.majorNum()!=1 ) {
log(Log::LineType::Error, i18n("Only bootloader version 1.x is supported"));
return false;
@ -108,7 +108,7 @@ bool PicdemBootloader::Hardware::write(Pic::MemoryRangeType type, const Device::
if ( i>=0x400 ) continue;
if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue;
uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i;
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress())));
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").arg(toHexLabel(address, device().nbCharsAddress())));
break;
}
}
@ -157,9 +157,9 @@ bool PicdemBootloader::Hardware::read(Pic::MemoryRangeType type, Device::Array &
if ( nbBytesWord==2 ) data[index] |= (cmd[5 + k+1] << 8);
if ( vdata && index>=0x0800 && data[index]!=varray[index] ) {
log(Log::LineType::Error, i18n("Device memory does not match hex file (at address 0x%2: reading 0x%3 and expecting 0x%4).")
.tqarg(TQString(toHex(index/2, device().nbCharsAddress())))
.tqarg(TQString(toHex(data[index], device().nbCharsWord(type))))
.tqarg(TQString(toHex(varray[index], device().nbCharsWord(type)))));
.arg(TQString(toHex(index/2, device().nbCharsAddress())))
.arg(TQString(toHex(data[index], device().nbCharsWord(type))))
.arg(TQString(toHex(varray[index], device().nbCharsWord(type)))));
return false;
}
}

@ -38,7 +38,7 @@ bool Pickit1::Baseline::incrementPC(uint nb)
Array cmd;
uint high = (nb >> 8) & 0xFF;
log(Log::DebugLevel::Extra, TQString("work around bug in firmware (nb_inc=%1 high=%2)")
.tqarg(toHexLabel(nb, 4)).tqarg(toHexLabel(high, 2)));
.arg(toHexLabel(nb, 4)).arg(toHexLabel(high, 2)));
if ( high==1 ) {
cmd[0] = 'I';
cmd[1] = 0x40;

@ -52,14 +52,14 @@ bool Pickit::USBPort::command(const char *s)
bool Pickit::USBPort::command(const Array &cmd)
{
log(Log::DebugLevel::Extra, TQString("send command: \"%1\"").tqarg(cmd.pretty()));
log(Log::DebugLevel::Extra, TQString("send command: \"%1\"").arg(cmd.pretty()));
return write(writeEndPoint(), (const char *)cmd._data.data(), cmd.length());
}
bool Pickit::USBPort::receive(Pickit::Array &array)
{
if ( !read(readEndPoint(), (char *)array._data.data(), array.length()) ) return false;
log(Log::DebugLevel::Max, TQString("received: \"%1\"").tqarg(array.pretty()));
log(Log::DebugLevel::Max, TQString("received: \"%1\"").arg(array.pretty()));
return true;
}
@ -80,7 +80,7 @@ bool Pickit::USBPort::getMode(VersionData &version, ::Programmer::Mode &mode)
bool Pickit::USBPort::receiveWords(uint nbBytesWord, uint nbRead, TQValueVector<uint> &words, uint offset)
{
log(Log::DebugLevel::Max, TQString("receive words nbBytesWord=%1 nbRead=%2 offset=%3").tqarg(nbBytesWord).tqarg(nbRead).tqarg(offset));
log(Log::DebugLevel::Max, TQString("receive words nbBytesWord=%1 nbRead=%2 offset=%3").arg(nbBytesWord).arg(nbRead).arg(offset));
Array a = array();
TQMemArray<uchar> data(nbRead*a.length());
uint l = 0;

@ -50,9 +50,9 @@ bool Pickit2::USBPort::readFirmwareCodeMemory(Device::Array &data, const Device:
data[index]= read[5 + 2*k] & 0xFF | (read[6 + 2*k] << 8);
if ( vdata && index>=0x1000 && index<0x3FF0 && data[index]!=(*vdata)[index] ) {
log(Log::LineType::Error, i18n("Firmware memory does not match hex file (at address 0x%2: reading 0x%3 and expecting 0x%4).")
.tqarg(TQString(toHex(index/2, device->nbCharsAddress())))
.tqarg(TQString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))
.tqarg(TQString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))));
.arg(TQString(toHex(index/2, device->nbCharsAddress())))
.arg(TQString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))
.arg(TQString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))));
return false;
}
}
@ -111,7 +111,7 @@ bool Pickit2::USBPort::uploadFirmware(const Pic::Memory &memory, ProgressMonitor
//-----------------------------------------------------------------------------
bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
{
log(Log::DebugLevel::Extra, TQString("readVoltages: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
log(Log::DebugLevel::Extra, TQString("readVoltages: Firmware is %1").arg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) {
log(Log::LineType::Warning, i18n("Cannot read voltages with this firmware version."));
return true;
@ -128,9 +128,9 @@ bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
bool Pickit2::Hardware::setVddVpp(double vdd, double vpp)
{
log(Log::DebugLevel::Extra, TQString("setVddVpp: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
log(Log::DebugLevel::Extra, TQString("setVddVpp: Firmware is %1").arg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) return true;
log(Log::DebugLevel::Normal, TQString(" set Vdd = %1 V and Vpp = %2 V").tqarg(vdd).tqarg(vpp));
log(Log::DebugLevel::Normal, TQString(" set Vdd = %1 V and Vpp = %2 V").arg(vdd).arg(vpp));
Array cmd;
cmd[0] = 's';
uint cvdd = uint(32.0 * vdd + 12.5);

@ -53,7 +53,7 @@ bool Pickit2::Base::doUploadFirmware(PURL::File &file)
TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\" (%2).").tqarg(file.url().pretty()).tqarg(errors[0]));
log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\" (%2).").arg(file.url().pretty()).arg(errors[0]));
return false;
}
if ( warningTypes!=Pic::Memory::NoWarning ) {

@ -28,22 +28,22 @@ bool Pickit::Base::readFirmwareVersion()
bool Pickit::Base::regenerateOsccal(const PURL::Url &url)
{
log(Log::DebugLevel::Normal, TQString(" Calibration firmware file: %1").tqarg(url.pretty()));
log(Log::DebugLevel::Normal, TQString(" Calibration firmware file: %1").arg(url.pretty()));
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
return false;
}
Pic::Memory memory(*device());
TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").tqarg(url.pretty()).tqarg(errors[0]));
log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").arg(url.pretty()).arg(errors[0]));
return false;
}
if ( warningTypes!=Pic::Memory::NoWarning ) {
log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").tqarg(device()->name()));
log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").arg(device()->name()));
return false;
}
if ( !askContinue(i18n("This will overwrite the device code memory. Continue anyway?")) ) return false;

@ -33,7 +33,7 @@ bool Pickit2Bootloader::Hardware::internalConnectHardware()
}
}
}
log(Log::LineType::Information, i18n("Bootloader version %1 detected.").tqarg(version.pretty()));
log(Log::LineType::Information, i18n("Bootloader version %1 detected.").arg(version.pretty()));
if ( version.majorNum()!=2 ) {
log(Log::LineType::Error, i18n("Only bootloader version 2.x is supported."));
return false;
@ -50,7 +50,7 @@ bool Pickit2Bootloader::Hardware::write(Pic::MemoryRangeType type, const Device:
if ( i>=0x1000 && i<0x3FF0 ) continue;
if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue;
uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i;
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress())));
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").arg(toHexLabel(address, device().nbCharsAddress())));
break;
}
return port().writeFirmwareCodeMemory(data, _base.progressMonitor());

@ -68,7 +68,7 @@ bool Pickit2V2::Hardware::executeScript(uint i)
{
Q_ASSERT( i!=0 );
const ScriptData &sdata = SCRIPT_DATA[i-1];
log(Log::DebugLevel::Extra, TQString("execute script #%1: %2").tqarg(i).tqarg(sdata.name));
log(Log::DebugLevel::Extra, TQString("execute script #%1: %2").arg(i).arg(sdata.name));
return sendScript(sdata.data, sdata.length);
}
@ -78,7 +78,7 @@ bool Pickit2V2::Hardware::getScriptBufferChecksum(uint &checksum)
Array array;
if ( !port().receive(array) ) return false;
checksum = (array[0] << 24) + (array[1] << 16) + (array[2] << 8) + array[3];
log(Log::DebugLevel::Extra, TQString("get script buffer checksum: %1").tqarg(toHexLabel(checksum, 8)));
log(Log::DebugLevel::Extra, TQString("get script buffer checksum: %1").arg(toHexLabel(checksum, 8)));
return true;
}
@ -87,7 +87,7 @@ bool Pickit2V2::Hardware::downloadScript(ScriptType type, uint i)
if (i==0 ) return true; // empty script
const ScriptData &sdata = SCRIPT_DATA[i-1];
log(Log::DebugLevel::Max, TQString(" download script #%1 (\"%2\") at position #%3")
.tqarg(i-1).tqarg(sdata.name).tqarg(toHexLabel(type, 2)));
.arg(i-1).arg(sdata.name).arg(toHexLabel(type, 2)));
Array cmd;
cmd[0] = DownloadScript;
cmd[1] = type;
@ -168,7 +168,7 @@ bool Pickit2V2::Hardware::setVppVoltage(double value, double threshold)
bool Pickit2V2::Hardware::setVddOn(bool on)
{
log(Log::DebugLevel::Extra, TQString("Vdd set to %1, self powered is %2").tqarg(on).tqarg(_base.isTargetSelfPowered()));
log(Log::DebugLevel::Extra, TQString("Vdd set to %1, self powered is %2").arg(on).arg(_base.isTargetSelfPowered()));
ushort script[2];
script[0] = (on ? VddGroundOff : VddOff);
if ( _base.isTargetSelfPowered() ) script[1] = (on ? VddOff : VddGroundOff);
@ -215,7 +215,7 @@ bool Pickit2V2::Hardware::readVoltages(VoltagesData &voltagesData)
bool Pickit2V2::Hardware::downloadAddress(Address address)
{
log(Log::DebugLevel::Max, TQString("download address %1").tqarg(toHexLabel(address, 6)));
log(Log::DebugLevel::Max, TQString("download address %1").arg(toHexLabel(address, 6)));
Array cmd;
cmd[0] = ClearDownloadBuffer;
cmd[1] = DownloadData;
@ -229,7 +229,7 @@ bool Pickit2V2::Hardware::downloadAddress(Address address)
bool Pickit2V2::Hardware::runScript(ScriptType stype, uint repetitions, uint nbNoLens)
{
log(Log::DebugLevel::Max, TQString("run script %1: repetitions=%2 nbNoLen=%3")
.tqarg(toHexLabel(stype, 2)).tqarg(repetitions).tqarg(nbNoLens));
.arg(toHexLabel(stype, 2)).arg(repetitions).arg(nbNoLens));
#if 0 // ALTERNATE METHOD
const Data &d = data(device().name());
for (uint i=0; i<repetitions; i++)
@ -283,7 +283,7 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
{
uint nbWords = device().nbWords(otype);
data.resize(nbWords);
log(Log::DebugLevel::Max, TQString("read %1 nbWords=%2").tqarg(otype.label()).tqarg(nbWords));
log(Log::DebugLevel::Max, TQString("read %1 nbWords=%2").arg(otype.label()).arg(nbWords));
uint nbBytesWord = device().nbBytesWord(otype);
// EEPROM is read like regular program memory in midrange
if ( !device().is18Family() && !device().is16bitFamily() && otype==Pic::MemoryRangeType::Eeprom ) nbBytesWord = 2;
@ -322,7 +322,7 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
if ( !runScript(stype, nbRuns, nbReceive) ) return false;
if ( !port().receiveWords(nbBytesWord, nbReceive, words) ) return false;
}
log(Log::DebugLevel::Max, TQString("nbRunWords=%1 readNbWords=%2 index=%3/%4").tqarg(nbRunWords).tqarg(words.count()).tqarg(i).tqarg(nbWords));
log(Log::DebugLevel::Max, TQString("nbRunWords=%1 readNbWords=%2 index=%3/%4").arg(nbRunWords).arg(words.count()).arg(i).arg(nbWords));
for (uint k=0; k<words.count(); k++) {
if ( i>=nbWords ) break;
data[i] = words[k];

@ -59,7 +59,7 @@ bool Pickit2V2::Base::identifyDevice()
if ( !hardware().executeScript(fdata.progExitScript) ) return false;
uint rawId = (data[2]<<8) + data[1];
if (fdata.progMemShift) rawId >>= 1;
log(Log::DebugLevel::Normal, TQString("Read id for family %1: %2").tqarg(fdata.architecture.key()).tqarg(toHexLabelAbs(rawId)));
log(Log::DebugLevel::Normal, TQString("Read id for family %1: %2").arg(fdata.architecture.key()).arg(toHexLabelAbs(rawId)));
TQMap<TQString, Device::IdData> ids;
::Group::Base::ConstIterator it;
for (it=group().begin(); it!=group().end(); ++it) {
@ -69,9 +69,9 @@ bool Pickit2V2::Base::identifyDevice()
if ( data->matchId(rawId, idata) ) ids[it.key()] = idata;
}
if ( ids.count()!=0 ) {
log(Log::LineType::Information, i18n("Read id: %1").tqarg(device()->idNames(ids).join("; ")));
log(Log::LineType::Information, i18n("Read id: %1").arg(device()->idNames(ids).join("; ")));
if ( ids.contains(device()->name()) ) return true;
message = i18n("Read id does not match the specified device name \"%1\".").tqarg(device()->name());
message = i18n("Read id does not match the specified device name \"%1\".").arg(device()->name());
break;
}
}
@ -79,7 +79,7 @@ bool Pickit2V2::Base::identifyDevice()
logUserAbort();
return false;
}
log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").tqarg(device()->name()));
log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").arg(device()->name()));
return true;
}
@ -97,8 +97,8 @@ bool Pickit2V2::Base::selfTest(bool ask)
if ( status & VppError ) error += i18n("Vpp voltage level error; ");
if ( status & VddError ) error += i18n("Vdd voltage level error; ");
if ( error.isEmpty() ) return true;
log(Log::LineType::Warning, i18n("Self-test failed: %1").tqarg(error));
if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").tqarg(error)) ) {
log(Log::LineType::Warning, i18n("Self-test failed: %1").arg(error));
if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").arg(error)) ) {
logUserAbort();
return false;
}

@ -281,8 +281,8 @@ bool Psp::Hardware::readMemory(Pic::MemoryRangeType type, Device::Array &data, c
for (uint i=0; i<data.count(); i++) {
if ( !port()->receive(2, a) ) return false;
data[i] = (a[0] << 8) + a[1];
// log(Log::DebugLevel::Max, TQString("code data %1: %2 (%3, %4)").tqarg(i).tqarg(toHexLabel(data[i], 4))
// .tqarg(toHexLabel(a[0], 2)).tqarg(toHexLabel(a[1], 2)));
// log(Log::DebugLevel::Max, TQString("code data %1: %2 (%3, %4)").arg(i).arg(toHexLabel(data[i], 4))
// .arg(toHexLabel(a[0], 2)).arg(toHexLabel(a[1], 2)));
}
if ( !port()->receiveEnd() ) return false;
break;

@ -48,7 +48,7 @@ bool Psp::SerialPort::reset()
bool Psp::SerialPort::command(uchar c, uint nbBytes, TQMemArray<uchar> &a)
{
log(Log::DebugLevel::Extra, TQString("Command %1").tqarg(toHexLabel(c, 2)));
log(Log::DebugLevel::Extra, TQString("Command %1").arg(toHexLabel(c, 2)));
if ( !sendChar(c) ) return false;
return receive(nbBytes, a);
}
@ -57,7 +57,7 @@ bool Psp::SerialPort::checkAck(uchar ec, uchar rc)
{
if ( ec==rc ) return true;
log(Log::LineType::Error, i18n("Incorrect ack: expecting %1, received %2")
.tqarg(TQString(toHex(ec, 2))).tqarg(TQString(toHex(rc, 2))));
.arg(TQString(toHex(ec, 2))).arg(TQString(toHex(rc, 2))));
return false;
}
@ -65,7 +65,7 @@ bool Psp::SerialPort::checkEnd(uchar c)
{
if ( c==0 ) return true;
log(Log::LineType::Error, i18n("Incorrect received data end: expecting 00, received %1")
.tqarg(TQString(toHex(c, 2))));
.arg(TQString(toHex(c, 2))));
return false;
}

@ -125,7 +125,7 @@ bool GPSim::Debugger::getRegister(const TQString &name, BitValue &value)
for (; i<uint(lines.count()); i++)
if ( r.exactMatch(lines[i]) ) break;
if ( i==uint(lines.count()) ) {
log(Log::Error, i18n("Error reading register \"%1\"").tqarg(name));
log(Log::Error, i18n("Error reading register \"%1\"").arg(name));
return false;
}
value = fromHex(r.cap(1), 0);
@ -137,7 +137,7 @@ bool GPSim::Debugger::getRegister(Address address, BitValue &value)
const Pic::RegistersData &rdata = device()->registersData();
TQString name = toHex(address, rdata.nbCharsAddress());
if ( hardware()->version()<VersionData(0, 22, 0) ) return getRegister("0x" + name, value);
return getRegister(TQString("ramData[$%1]").tqarg(name), value);
return getRegister(TQString("ramData[$%1]").arg(name), value);
}
bool GPSim::Debugger::readRegister(const Register::TypeData &data, BitValue &value)
@ -161,14 +161,14 @@ bool GPSim::Debugger::setRegister(const TQString &name, BitValue value)
return true;
}
const Pic::RegistersData &rdata = device()->registersData();
TQString s = TQString("%1 = %2").tqarg(name).tqarg(toHexLabel(value, rdata.nbChars()));
TQString s = TQString("%1 = %2").arg(name).arg(toHexLabel(value, rdata.nbChars()));
return hardware()->execute(s, true);
}
bool GPSim::Debugger::setRegister(Address address, BitValue value)
{
const Pic::RegistersData &rdata = device()->registersData();
TQString s = TQString("ramData[$%1]").tqarg(toHex(address, rdata.nbCharsAddress()));
TQString s = TQString("ramData[$%1]").arg(toHex(address, rdata.nbCharsAddress()));
return setRegister(s, value);
}
@ -203,7 +203,7 @@ bool GPSim::Debugger::updatePortStatus(uint index, TQMap<uint, Device::PortBitDa
if ( !hardware()->execute("symbol " + name, true, &lines) ) return false;
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").tqarg(name));
log(Log::Error, i18n("Error reading state of IO bit: %1").arg(name));
return false;
}
switch (value[0].latin1()) {
@ -217,24 +217,24 @@ bool GPSim::Debugger::updatePortStatus(uint index, TQMap<uint, Device::PortBitDa
case 'X': bits[i].state = Device::Unknown; break;
default:
bits[i].state = Device::Unknown;
log(Log::Warning, i18n("Unknown state for IO bit: %1 (%2)").tqarg(name).tqarg(value));
log(Log::Warning, i18n("Unknown state for IO bit: %1 (%2)").arg(name).arg(value));
break;
}
if ( !findRegExp(lines, pattern, "Driving", value) || value.length()!=1 ) {
log(Log::Error, i18n("Error reading driving state of IO bit: %1").tqarg(name));
log(Log::Error, i18n("Error reading driving state of IO bit: %1").arg(name));
return false;
}
bits[i].driving = ( value[0]=='1' );
if (bits[i].driving) {
if ( !findRegExp(lines, pattern, "drivingState", value) || value.length()!=1 ) {
log(Log::Error, i18n("Error reading driving state of IO bit: %1").tqarg(name));
log(Log::Error, i18n("Error reading driving state of IO bit: %1").arg(name));
return false;
}
bits[i].drivingState = (value[0]=='0' ? Device::IoLow : Device::IoHigh);
bits[i].drivenState = Device::IoUnknown;
} else {
if ( !findRegExp(lines, pattern, "drivenState", value) || value.length()!=1 ) {
log(Log::Error, i18n("Error reading driven state of IO bit: %1").tqarg(name));
log(Log::Error, i18n("Error reading driven state of IO bit: %1").arg(name));
return false;
}
bits[i].drivenState = (value[0]=='0' ? Device::IoLow : Device::IoHigh);

@ -81,12 +81,12 @@ bool TinyBootloader::Hardware::verifyDeviceId()
for (uint i=0; i<uint(list.count()); i++)
if ( _id==data(list[i]).id ) devices.append(list[i]);
if ( _id!=id ) {
if ( devices.count()==0 ) log(Log::LineType::Error, i18n("Unknown id returned by bootloader (%1 read and %2 expected).").tqarg(toHexLabel(_id, 2)).tqarg(toHexLabel(id, 2)));
else log(Log::LineType::Error, i18n("Id returned by bootloader corresponds to other devices: %1 (%2 read and %3 expected).").tqarg(devices.join(" ")).tqarg(toHexLabel(_id, 2)).tqarg(toHexLabel(id, 2)));
if ( devices.count()==0 ) log(Log::LineType::Error, i18n("Unknown id returned by bootloader (%1 read and %2 expected).").arg(toHexLabel(_id, 2)).arg(toHexLabel(id, 2)));
else log(Log::LineType::Error, i18n("Id returned by bootloader corresponds to other devices: %1 (%2 read and %3 expected).").arg(devices.join(" ")).arg(toHexLabel(_id, 2)).arg(toHexLabel(id, 2)));
// we can't ask for "continue anyway?" because bootloader can timeout...
return false;
}
log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").tqarg(devices.join(" ")));
log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").arg(devices.join(" ")));
return true;
}
@ -101,10 +101,10 @@ bool TinyBootloader::Hardware::waitReady(bool *checkCRC)
if (checkCRC) {
*checkCRC = false;
if ( c=='N' ) return true;
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").tqarg(toPrintable(c, PrintAlphaNum)));
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").arg(toPrintable(c, PrintAlphaNum)));
return true;
}
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").tqarg(toPrintable(c, PrintAlphaNum)));
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").arg(toPrintable(c, PrintAlphaNum)));
return false;
}
@ -160,7 +160,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase)
for (uint i=nb; i<data.size(); i++) {
if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue;
uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i;
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress())));
log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").arg(toHexLabel(address, device().nbCharsAddress())));
break;
}
@ -206,7 +206,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase)
if ( !sendCodeAddress(address, crc) ) return false;
uint nbw = device().nbBytesWord(Pic::MemoryRangeType::Code);
if ( !sendChar(nbw*nbWords, &crc) ) return false;
log(Log::DebugLevel::Normal, TQString("write code memory at %1: %2 bytes").tqarg(toHexLabel(address, 4)).tqarg(2*nbWords));
log(Log::DebugLevel::Normal, TQString("write code memory at %1: %2 bytes").arg(toHexLabel(address, 4)).arg(2*nbWords));
for(uint k=0; k<nbWords; k++) {
if ( !sendChar(wdata[i+k].byte(0), &crc) ) return false; // data low
if ( !sendChar(wdata[i+k].byte(1), &crc) ) return false; // data high

@ -125,9 +125,9 @@ bool Tool::Group::check(const TQString &device, Log::Generic *log) const
{
const_cast<Tool::Group *>(this)->checkInitSupported();
if ( hasCheckDevicesError() )
return (log ? log->askContinue(i18n("There were errors detecting supported devices for the selected toolchain (%1). Please check the toolchain configuration. Continue anyway?").tqarg(label())) : false);
return (log ? log->askContinue(i18n("There were errors detecting supported devices for the selected toolchain (%1). Please check the toolchain configuration. Continue anyway?").arg(label())) : false);
if ( !device.isEmpty() && device!=Device::AUTO_DATA.name && !isSupported(device) )
return (log ? log->askContinue(i18n("The selected toolchain (%1) does not support device %2. Continue anyway?").tqarg(label()).tqarg(device)) : false);
return (log ? log->askContinue(i18n("The selected toolchain (%1) does not support device %2. Continue anyway?").arg(label()).arg(device)) : false);
return true;
}

@ -19,7 +19,7 @@ bool Boost::CompilerBasic::checkExecutableResult(bool, TQStringList &lines) cons
//----------------------------------------------------------------------------
TQString Boost::GroupBasic::informationText() const
{
return i18n("<a href=\"%1\">BoostBasic Compiler</a> is a Basic compiler distributed by SourceBoost Technologies.").tqarg("http://www.sourceboost.com/Products/BoostBasic/Overview.html");
return i18n("<a href=\"%1\">BoostBasic Compiler</a> is a Basic compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostBasic/Overview.html");
}
Tool::SourceGenerator *Boost::GroupBasic::sourceGeneratorFactory() const

@ -19,7 +19,7 @@ bool Boost::CompilerC::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString Boost::GroupC::informationText() const
{
return i18n("<a href=\"%1\">BoostC Compiler</a> is a C compiler distributed by SourceBoost Technologies.").tqarg("http://www.sourceboost.com/Products/BoostC/Overview.html");
return i18n("<a href=\"%1\">BoostC Compiler</a> is a C compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostC/Overview.html");
}
Tool::SourceGenerator *Boost::GroupC::sourceGeneratorFactory() const

@ -20,7 +20,7 @@ bool Boost::CompilerCpp::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString Boost::GroupCpp::informationText() const
{
return i18n("<a href=\"%1\">BoostC++ Compiler</a> is a C compiler distributed by SourceBoost Technologies.").tqarg("http://www.sourceboost.com/Products/BoostCpp/Overview.html");
return i18n("<a href=\"%1\">BoostC++ Compiler</a> is a C compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostCpp/Overview.html");
}
Tool::SourceGenerator *Boost::GroupCpp::sourceGeneratorFactory() const

@ -82,5 +82,5 @@ Tool::Group::BaseData C18::Group::baseFactory(Tool::Category category) const
TQString C18::Group::informationText() const
{
return i18n("<qt><a href=\"%1\">C18</a> is a C compiler distributed by Microchip.</qt>").tqarg("http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010014&part=SW006011");
return i18n("<qt><a href=\"%1\">C18</a> is a C compiler distributed by Microchip.</qt>").arg("http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010014&part=SW006011");
}

@ -52,7 +52,7 @@ Compile::Config *CC5X::Group::configFactory(::Project *project) const
TQString CC5X::Group::informationText() const
{
return i18n("<a href=\"%1\">CC5X</a> is a C compiler distributed by B Knudsen Data.").tqarg("http://www.bknd.com/cc5x/index.shtml");
return i18n("<a href=\"%1\">CC5X</a> is a C compiler distributed by B Knudsen Data.").arg("http://www.bknd.com/cc5x/index.shtml");
}
Tool::Group::BaseData CC5X::Group::baseFactory(Tool::Category category) const

@ -87,7 +87,7 @@ Compile::Config *CCSC::Group::configFactory(::Project *project) const
TQString CCSC::Group::informationText() const
{
return i18n("<a href=\"%1\">CCS Compiler</a> is a C compiler distributed by CCS.").tqarg("http://www.ccsinfo.com/content.php?page=compilers");
return i18n("<a href=\"%1\">CCS Compiler</a> is a C compiler distributed by CCS.").arg("http://www.ccsinfo.com/content.php?page=compilers");
}
Tool::Group::BaseData CCSC::Group::baseFactory(Tool::Category category) const

@ -83,7 +83,7 @@ void CCSC::CompileFile::done(int code)
PURL::Url url = PURL::Url(directory(), inputFilepath(0)).toExtension("err");
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").tqarg(url.pretty()), TQString(), 0);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").arg(url.pretty()), TQString(), 0);
else {
TQStringList lines = file.readLines();
for (uint i=0; i<lines.count(); i++) parseLine(lines[i]);

@ -37,7 +37,7 @@ bool GPUtils::Base::checkExecutableResult(bool withWine, TQStringList &lines) co
//----------------------------------------------------------------------------
TQString GPUtils::Group::informationText() const
{
return i18n("<a href=\"%1\">GPUtils</a> is an open-source assembler and linker suite.<br>").tqarg("http://gputils.sourceforge.net");
return i18n("<a href=\"%1\">GPUtils</a> is an open-source assembler and linker suite.<br>").arg("http://gputils.sourceforge.net");
}
Tool::Group::BaseData GPUtils::Group::baseFactory(Tool::Category category) const

@ -77,8 +77,8 @@ SourceLine::List GPUtils::SourceGenerator::sourceFileContent(PURL::ToolType, con
if ( !hasShared ) {
for (uint i=1; i<rdata.nbBanks; i++) {
uint address = first + i*rdata.nbBytesPerBank();
lines.appendNotIndentedCode(TQString("INT_VAR%1 UDATA ").tqarg(i) + toHexLabel(address, rdata.nbCharsAddress()), i18n("variables used for context saving"));
lines.appendNotIndentedCode(TQString("w_saved%1 RES 1").tqarg(i), i18n("variable used for context saving"));
lines.appendNotIndentedCode(TQString("INT_VAR%1 UDATA ").arg(i) + toHexLabel(address, rdata.nbCharsAddress()), i18n("variables used for context saving"));
lines.appendNotIndentedCode(TQString("w_saved%1 RES 1").arg(i), i18n("variable used for context saving"));
}
}
lines.appendEmpty();

@ -162,8 +162,8 @@ void ToolchainConfigWidget::checkExecutableDone()
_data[i].checkLines = _data[i].process->sout() + _data[i].process->serr();
const Tool::Base *base = _group.base(i);
TQString exec = base->baseExecutable(withWine(), outputType());
if ( base->checkExecutableResult(withWine(), _data[i].checkLines) ) _data[i].label->setText(i18n("\"%1\" found").tqarg(exec));
else _data[i].label->setText(i18n("\"%1\" not recognized").tqarg(exec));
if ( base->checkExecutableResult(withWine(), _data[i].checkLines) ) _data[i].label->setText(i18n("\"%1\" found").arg(exec));
else _data[i].label->setText(i18n("\"%1\" not recognized").arg(exec));
break;
}
}
@ -185,7 +185,7 @@ void ToolchainConfigWidget::checkDevicesDone()
if ( !_devicesData[i].done ) return;
list += _group.getSupportedDevices(_devicesData[i].checkLines.join("\n"));
}
_devicesLabel->setText(i18n("Detected (%1)").tqarg(list.count()));
_devicesLabel->setText(i18n("Detected (%1)").arg(list.count()));
}
bool ToolchainConfigWidget::withWine() const
@ -229,13 +229,13 @@ void ToolchainConfigWidget::detect()
connect(_data[k].process, TQT_SIGNAL(done(int)), TQT_SLOT(checkExecutableDone()));
connect(_data[k].process, TQT_SIGNAL(timeout()), TQT_SLOT(checkExecutableDone()));
TQString exec = baseExecutable(k);
if ( !_data[k].process->start(10000) ) _data[k].label->setText(i18n("\"%1\" not found").tqarg(exec));
else _data[k].label->setText(i18n("Detecting \"%1\"...").tqarg(exec));
if ( !_data[k].process->start(10000) ) _data[k].label->setText(i18n("\"%1\" not found").arg(exec));
else _data[k].label->setText(i18n("Detecting \"%1\"...").arg(exec));
}
}
if ( _group.checkDevicesCategory()==Tool::Category::Nb_Types ) {
TQValueVector<TQString> supported = _group.supportedDevices();
_devicesLabel->setText(i18n("Hardcoded (%1)").tqarg(supported.count()));
_devicesLabel->setText(i18n("Hardcoded (%1)").arg(supported.count()));
} else {
for (uint i=0; i<_devicesData.count(); i++) {
delete _devicesData[i].process;
@ -265,8 +265,8 @@ void ToolchainConfigWidget::showDetails()
TQString s;
const Tool::Base *base = _group.base(k);
if ( base->checkExecutable() ) {
s += i18n("<qt><b>Command for executable detection:</b><br>%1<br>").tqarg(_data[k].command);
s += i18n("<b>Version string:</b><br>%1<br></qt>").tqarg(_data[k].checkLines.join("<br>"));
s += i18n("<qt><b>Command for executable detection:</b><br>%1<br>").arg(_data[k].command);
s += i18n("<b>Version string:</b><br>%1<br></qt>").arg(_data[k].checkLines.join("<br>"));
} else s += i18n("This tool cannot be automatically detected.");
MessageBox::text(s, Log::Show);
break;
@ -290,11 +290,11 @@ void ToolchainConfigWidget::showDeviceDetails()
} else {
uint nb = _group.nbCheckDevices();
for (uint i=0; i<nb; i++) {
if ( nb==1 ) s += i18n("<qt><b>Command for devices detection:</b><br>%1<br>").tqarg(_devicesData[i].command);
else s += i18n("<qt><b>Command #%1 for devices detection:</b><br>%2<br>").tqarg(i+1).tqarg(_devicesData[i].command);
if ( nb==1 ) s += i18n("<qt><b>Command for devices detection:</b><br>%1<br>").arg(_devicesData[i].command);
else s += i18n("<qt><b>Command #%1 for devices detection:</b><br>%2<br>").arg(i+1).arg(_devicesData[i].command);
TQString ss = _devicesData[i].checkLines.join("<br>");
if ( nb==1 ) s += i18n("<b>Device string:</b><br>%1<br>").tqarg(ss);
else s += i18n("<b>Device string #%1:</b><br>%2<br>").tqarg(i+1).tqarg(ss);
if ( nb==1 ) s += i18n("<b>Device string:</b><br>%1<br>").arg(ss);
else s += i18n("<b>Device string #%1:</b><br>%2<br>").arg(i+1).arg(ss);
}
}
MessageBox::text(s, Log::Show);

@ -28,7 +28,7 @@ bool JAL::Base::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString JAL::Group::informationText() const
{
return i18n("<a href=\"%1\">JAL</a> is a high-level language for PIC microcontrollers.").tqarg("http://jal.sourceforge.net");
return i18n("<a href=\"%1\">JAL</a> is a high-level language for PIC microcontrollers.").arg("http://jal.sourceforge.net");
}
Tool::Group::BaseData JAL::Group::baseFactory(Tool::Category category) const

@ -28,7 +28,7 @@ bool JALV2::Base::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString JALV2::Group::informationText() const
{
return i18n("<a href=\"%1\">JAL V2</a> is a new compiler for the high-level language JAL.").tqarg("http://www.casadeyork.com/jalv2");
return i18n("<a href=\"%1\">JAL V2</a> is a new compiler for the high-level language JAL.").arg("http://www.casadeyork.com/jalv2");
}
Tool::Group::BaseData JALV2::Group::baseFactory(Tool::Category category) const

@ -108,7 +108,7 @@ bool Compile::Manager::setupCompile()
if ( _operations!=Clean ) {
TQString e = PURL::extensions(type);
MessageBox::detailedSorry(i18n("The selected toolchain (%1) cannot compile file. It only supports files with extensions: %2")
.tqarg(Main::toolGroup().label()).tqarg(e), i18n("File: %1").tqarg(_items[i].url.pretty()), Log::Show);
.arg(Main::toolGroup().label()).arg(e), i18n("File: %1").arg(_items[i].url.pretty()), Log::Show);
Log::Base::log(Log::LineType::Error, i18n("*** Aborted ***"), Log::Delayed);
processFailed();
}
@ -133,7 +133,7 @@ bool Compile::Manager::setupAssemble()
if ( type==PURL::Nb_FileTypes ) type = Main::toolGroup().implementationType(PURL::ToolType::Compiler);
TQString e = PURL::extensions(type);
MessageBox::detailedSorry(i18n("The selected toolchain (%1) cannot assemble file. It only supports files with extensions: %2")
.tqarg(Main::toolGroup().label()).tqarg(e), i18n("File: %1").tqarg(_items[i].url.pretty()), Log::Show);
.arg(Main::toolGroup().label()).arg(e), i18n("File: %1").arg(_items[i].url.pretty()), Log::Show);
Log::Base::log(Log::LineType::Error, i18n("*** Aborted ***"), Log::Delayed);
processFailed();
}
@ -274,7 +274,7 @@ void Compile::Manager::startCustomCommand()
Compile::Data data(Tool::Category::Nb_Types, _todo, Main::device(), Main::project(), _type);
_base->init(data, this);
if ( !_base->start() ) {
Log::Base::log(Log::LineType::Error, i18n("Failed to execute custom command #%1.").tqarg(_customCommandIndex+1), Log::Delayed);
Log::Base::log(Log::LineType::Error, i18n("Failed to execute custom command #%1.").arg(_customCommandIndex+1), Log::Delayed);
processFailed();
}
}

@ -137,7 +137,7 @@ bool Compile::BaseProcess::start()
void Compile::BaseProcess::done(int code)
{
if ( code!=0 ) {
_manager->log(Log::LineType::Error, i18n("*** Exited with status: %1 ***").tqarg(code));
_manager->log(Log::LineType::Error, i18n("*** Exited with status: %1 ***").arg(code));
_manager->processFailed();
} else if ( _manager->hasError() ) {
_manager->log(Log::LineType::Error, i18n("*** Error ***"));

@ -47,7 +47,7 @@ Compile::Config *MPC::Group::configFactory(::Project *project) const
TQString MPC::Group::informationText() const
{
return i18n("<a href=\"%1\">MPC Compiler</a> is a C compiler distributed by Byte Craft.").tqarg("http://www.bytecraft.com/mpccaps.html");
return i18n("<a href=\"%1\">MPC Compiler</a> is a C compiler distributed by Byte Craft.").arg("http://www.bytecraft.com/mpccaps.html");
}
Tool::Group::BaseData MPC::Group::baseFactory(Tool::Category category) const

@ -37,7 +37,7 @@ void MPC::CompileFile::done(int code)
PURL::Url url = PURL::Url(directory(), inputFilepath(0)).toExtension("err");
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").tqarg(url.pretty()), TQString(), 0);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").arg(url.pretty()), TQString(), 0);
else {
TQStringList lines = file.readLines();
for (uint i=0; i<lines.count(); i++) parseLine(lines[i]);

@ -60,7 +60,7 @@ bool PIC30::Base::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString PIC30::Group::informationText() const
{
return i18n("The <a href=\"%1\">PIC30 ToolChain</a> is a toolsuite for 16-bit PICs available from Microchip. Most of it is available under the GNU Public License.").tqarg("http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012");
return i18n("The <a href=\"%1\">PIC30 ToolChain</a> is a toolsuite for 16-bit PICs available from Microchip. Most of it is available under the GNU Public License.").arg("http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012");
}
Tool::Group::BaseData PIC30::Group::baseFactory(Tool::Category category) const

@ -90,7 +90,7 @@ PURL::FileType PICC::Group::implementationType(PURL::ToolType type) const
//----------------------------------------------------------------------------
TQString PICC::PICCLiteGroup::informationText() const
{
return i18n("<a href=\"%1\">PICC-Lite</a> is a freeware C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
return i18n("<a href=\"%1\">PICC-Lite</a> is a freeware C compiler distributed by HTSoft.").arg("http://www.htsoft.com");
}
Tool::Group::BaseData PICC::PICCLiteGroup::baseFactory(Tool::Category category) const
@ -103,7 +103,7 @@ Tool::Group::BaseData PICC::PICCLiteGroup::baseFactory(Tool::Category category)
//----------------------------------------------------------------------------
TQString PICC::PICCGroup::informationText() const
{
return i18n("<a href=\"%1\">PICC</a> is a C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
return i18n("<a href=\"%1\">PICC</a> is a C compiler distributed by HTSoft.").arg("http://www.htsoft.com");
}
Tool::Group::BaseData PICC::PICCGroup::baseFactory(Tool::Category category) const
@ -116,7 +116,7 @@ Tool::Group::BaseData PICC::PICCGroup::baseFactory(Tool::Category category) cons
//----------------------------------------------------------------------------
TQString PICC::PICC18Group::informationText() const
{
return i18n("<a href=\"%1\">PICC 18</a> is a C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
return i18n("<a href=\"%1\">PICC 18</a> is a C compiler distributed by HTSoft.").arg("http://www.htsoft.com");
}
Tool::Group::BaseData PICC::PICC18Group::baseFactory(Tool::Category category) const

@ -25,7 +25,7 @@ bool SDCC::Base::checkExecutableResult(bool, TQStringList &lines) const
//----------------------------------------------------------------------------
TQString SDCC::Group::informationText() const
{
return i18n("The <a href=\"%1\">Small Devices C Compiler</a> is an open-source C compiler for several families of microcontrollers.").tqarg("http://sdcc.sourceforge.net");
return i18n("The <a href=\"%1\">Small Devices C Compiler</a> is an open-source C compiler for several families of microcontrollers.").arg("http://sdcc.sourceforge.net");
}
const ::Tool::Base *SDCC::Group::base(Tool::Category category) const

@ -84,7 +84,7 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
{
TQString name = device.attribute("name").upper();
if ( name.isEmpty() ) qFatal("Device has no name");
if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").tqarg(name));
if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").arg(name));
_data = createData();
_map[name] = _data;
_data->_name = name;
@ -119,26 +119,26 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
_data->_documents.datasheet = documents.attribute("datasheet");
TQRegExp rexp("\\d{5}");
if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified");
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").tqarg(_data->_documents.datasheet));
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet));
_data->_documents.progsheet = documents.attribute("progsheet");
if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified");
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").tqarg(_data->_documents.progsheet));
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet));
_data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas"));
for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) {
TQString errata = _data->_documents.erratas[i];
if ( !rexp.exactMatch(errata) ) {
TQRegExp rexp2("\\d{5}e\\d");
if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() )
qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").tqarg(errata));
qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").arg(errata));
}
}
}
if ( _data->_documents.webpage=="?" ) warning("No webpage specified");
else {
TQRegExp rexp("\\d{6}");
if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").tqarg(_data->_documents.webpage));
if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage));
if ( _documents.contains(_data->_documents.webpage) )
qFatal(TQString("webpage duplicated (already used for %1)").tqarg(_documents[_data->_documents.webpage]));
qFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage]));
_documents[_data->_documents.webpage] = name;
}
@ -194,21 +194,21 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
for (; Package::TYPE_DATA[i].name; i++) {
if ( types[k]!=Package::TYPE_DATA[i].name ) continue;
for (uint j=0; j<uint(package.types.count()); j++)
if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").tqarg(types[k]));
if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k]));
uint j = 0;
for (; j<Package::MAX_NB; j++)
if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break;
if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").tqarg(types[k]).tqarg(nb).tqarg(Package::TYPE_DATA[i].nbPins[0]));
if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").arg(types[k]).arg(nb).arg(Package::TYPE_DATA[i].nbPins[0]));
package.types.append(i);
break;
}
if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").tqarg(types[k]));
if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").arg(types[k]));
}
// pins
TQString name = Package::TYPE_DATA[package.types[0]].name;
if ( name=="sot23" ) {
if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package");
} else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").tqarg(name));
} else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name));
uint have_pins = false;
TQMemArray<bool> found(nb);
found.fill(false);
@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
child = child.nextSibling();
}
if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !!
else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").tqarg(i+1));
else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").arg(i+1));
return package;
}
@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse()
for (; ait!=_alternatives.end(); ++ait) {
TQStringList::const_iterator lit = ait.data().begin();
for (; lit!=ait.data().end(); ++lit)
if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").tqarg((*lit)).tqarg(ait.key()));
if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key()));
}
}

@ -68,12 +68,12 @@ void ExtXmlToData<Data>::parseDevice(TQDomElement element)
{
if ( element.nodeName()!="device" ) qFatal("Root node child should be named \"device\"");
_current = element.attribute("name").upper();
if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").tqarg(_current));
if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").tqarg(_current));
if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").arg(_current));
if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").arg(_current));
PData data;
if ( hasFamilies() ) {
TQString family = element.attribute("family");
if ( family.isEmpty() ) qFatal(TQString("Family is empty").tqarg(family));
if ( family.isEmpty() ) qFatal(TQString("Family is empty").arg(family));
if ( _families.find(family)==_families.end() ) _families.append(family);
data.family = familyIndex(family);
}
@ -88,7 +88,7 @@ void ExtXmlToData<Data>::parse()
TQDomDocument doc = parseFile(_basename + ".xml");
TQDomElement root = doc.documentElement();
if ( root.nodeName()!="type" ) qFatal("Root node should be \"type\"");
if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").tqarg(_basename));
if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").arg(_basename));
TQDomNode child = root.firstChild();
while ( !child.isNull() ) {
if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1());
@ -105,7 +105,7 @@ void ExtXmlToData<Data>::output()
{
// write .cpp file
TQFile file(_basename + "_data.cpp");
if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").tqarg(file.name()));
if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").arg(file.name()));
TQTextStream s(&file);
s << "// #### Do not edit: this file is autogenerated !!!" << endl << endl;
s << "#include \"devices/list/device_list.h\"" << endl;

@ -19,7 +19,7 @@ TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &t
while ( !child.isNull() ) {
if ( child.nodeName()==tag && child.isElement()
&& (attribute.isEmpty() || child.toElement().attribute(attribute)==value) ) {
if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").tqarg(tag).tqarg(value));
if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").arg(tag).arg(value));
element = child.toElement();
}
child = child.nextSibling();
@ -34,7 +34,7 @@ void XmlToData::checkTagNames(TQDomElement element, const TQString &tag,
for (uint i=0; i<uint(list.count()); i++) {
if ( !list.item(i).isElement() ) continue;
TQString name = list.item(i).toElement().attribute("name");
if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").tqarg(name).tqarg(tag));
if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").arg(name).arg(tag));
}
}
@ -47,7 +47,7 @@ TQDomDocument XmlToData::parseFile(const TQString &filename) const
TQString error;
int errorLine, errorColumn;
if ( !doc.setContent(&file, false, &error, &errorLine, &errorColumn) )
qFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").tqarg(error).tqarg(errorLine).tqarg(errorColumn));
qFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").arg(error).arg(errorLine).arg(errorColumn));
return doc;
}

Loading…
Cancel
Save