Revert "Rename a number of old tq methods that are no longer tq specific"

This reverts commit 9d6927a7d6.
r14.0.x
Timothy Pearson 13 years ago
parent 9d6927a7d6
commit ad1fc5fc8e

@ -101,7 +101,7 @@ CDB::Object::~Object()
void CDB::Object::log(Log::LineType type, const TQString &message) void CDB::Object::log(Log::LineType type, const TQString &message)
{ {
_log.log(type, message + " " + i18n("at line #%1, column #%2").arg(_line+1).arg(_col+1)); _log.log(type, message + " " + i18n("at line #%1, column #%2").tqarg(_line+1).tqarg(_col+1));
} }
void CDB::Object::logMalformed(const TQString &detail) void CDB::Object::logMalformed(const TQString &detail)
@ -125,7 +125,7 @@ bool CDB::Object::readAndCheckChar(char c)
char r; char r;
if ( !readChar(r) ) return false; if ( !readChar(r) ) return false;
if ( r!=c ) { if ( r!=c ) {
logMalformed(i18n("was expecting '%1'").arg(c)); logMalformed(i18n("was expecting '%1'").tqarg(c));
return false; return false;
} }
return true; return true;
@ -197,7 +197,7 @@ bool CDB::Object::readBool(bool &b)
if ( c=='0' ) b = false; if ( c=='0' ) b = false;
else if ( c=='1' ) b = true; else if ( c=='1' ) b = true;
else { else {
logMalformed(i18n("was expecting a bool ('%1')").arg(c)); logMalformed(i18n("was expecting a bool ('%1')").tqarg(c));
return false; return false;
} }
return true; 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; if ( !getULong(data, offset, 2, log, magic) ) return CoffType::Nb_Types;
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").arg(toHexLabel(magic, 4))); log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").tqarg(toHexLabel(magic, 4)));
format = Format::Nb_Types; format = Format::Nb_Types;
FOR_EACH(Format, f) if ( magic==f.data().magic ) format = f; FOR_EACH(Format, f) if ( magic==f.data().magic ) format = f;
return CoffType::Object; return CoffType::Object;
@ -64,7 +64,7 @@ bool Coff::getULong(const TQByteArray &data, uint &offset, uint nbBytes, Log::Ba
bool ok; bool ok;
v = ::getULong(data, offset, nbBytes, &ok); v = ::getULong(data, offset, nbBytes, &ok);
if ( !ok ) { if ( !ok ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbBytes).arg(data.count())); log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbBytes).tqarg(data.count()));
return false; return false;
} }
offset += nbBytes; 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) bool Coff::getString(const TQByteArray &data, uint &offset, uint nbChars, Log::Base &log, TQString &name)
{ {
if ( !checkAvailable(data, offset, nbChars) ) { if ( !checkAvailable(data, offset, nbChars) ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbChars).arg(data.count())); log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").tqarg(offset).tqarg(nbChars).tqarg(data.count()));
return false; return false;
} }
name = TQString::fromAscii(data.data()+offset, nbChars); 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(); data = file.readAll();
if ( log.hasError() ) return false; if ( log.hasError() ) return false;
if ( identify(data, offset, log, _format, _magic)!=type ) { if ( identify(data, offset, log, _format, _magic)!=type ) {
log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").arg(toHexLabel(_magic, 4))); log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").tqarg(toHexLabel(_magic, 4)));
return false; return false;
} }
return true; 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; if ( !getString(data, offset, 256, log, s) ) return;
int i = s.find('/'); int i = s.find('/');
if ( i==-1 ) { if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("Member name not terminated by '/' (\"%1\").").arg(s)); log.log(Log::LineType::Error, i18n("Member name not terminated by '/' (\"%1\").").tqarg(s));
return; return;
} }
_name = s.mid(0, i); _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; if ( !getString(data, offset, 10, log, s) ) return;
i = s.find('l'); i = s.find('l');
if ( i==-1 ) { if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("File size not terminated by 'l' (\"%1\").").arg(s)); log.log(Log::LineType::Error, i18n("File size not terminated by 'l' (\"%1\").").tqarg(s));
return; return;
} }
bool ok; bool ok;
_nbBytes = s.mid(0, i).toUInt(&ok); _nbBytes = s.mid(0, i).toUInt(&ok);
if ( !ok ) { if ( !ok ) {
log.log(Log::LineType::Error, i18n("Wrong format for file size \"%1\".").arg(s)); log.log(Log::LineType::Error, i18n("Wrong format for file size \"%1\".").tqarg(s));
return; return;
} }
TQ_UINT32 v; TQ_UINT32 v;
if ( !getULong(data, offset, 2, log, v) ) return; if ( !getULong(data, offset, 2, log, v) ) return;
log.log(Log::DebugLevel::Extra, i18n("Magic number: %1").arg(toHexLabel(v, 4))); log.log(Log::DebugLevel::Extra, i18n("Magic number: %1").tqarg(toHexLabel(v, 4)));
// if ( v!=0x600A ) { // if ( v!=0x600A ) {
// log.log(Log::LineType::Error, i18n("Wrong magic for Microchip archive (\"%1\").").arg(toHexLabel(v, 4))); // log.log(Log::LineType::Error, i18n("Wrong magic for Microchip archive (\"%1\").").tqarg(toHexLabel(v, 4)));
// return; // return;
// } // }
offset += _nbBytes; offset += _nbBytes;
@ -89,7 +89,7 @@ bool Coff::Archive::readSymbols(const TQByteArray &data, uint offset, Log::Base
TQ_UINT32 start; TQ_UINT32 start;
if ( !getULong(data, offset, 4, log, start) ) return false; if ( !getULong(data, offset, 4, log, start) ) return false;
if ( !_offsets.contains(start) ) { if ( !_offsets.contains(start) ) {
log.log(Log::LineType::Error, i18n("Unknown file member offset: %1").arg(toHexLabel(start, 8))); log.log(Log::LineType::Error, i18n("Unknown file member offset: %1").tqarg(toHexLabel(start, 8)));
return false; return false;
} }
members[i] = _offsets[start]; members[i] = _offsets[start];
@ -115,7 +115,7 @@ Log::KeyList Coff::Archive::membersInformation() const
Log::KeyList keys(i18n("File Members:")); Log::KeyList keys(i18n("File Members:"));
TQMap<TQString, Member *>::const_iterator it; TQMap<TQString, Member *>::const_iterator it;
for (it=members().begin(); it!=members().end(); ++it) for (it=members().begin(); it!=members().end(); ++it)
keys.append(it.key(), i18n("size: %1 bytes").arg(it.data()->nbBytes())); keys.append(it.key(), i18n("size: %1 bytes").tqarg(it.data()->nbBytes()));
return keys; 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 ( _name==".ident" ) auxType = AuxSymbolType::Identifier;
else if ( _sclass==SymbolClass::Filename ) auxType = AuxSymbolType::File; else if ( _sclass==SymbolClass::Filename ) auxType = AuxSymbolType::File;
else if ( _sclass==SymbolClass::Section ) auxType = AuxSymbolType::Section; 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)").arg(auxType.type())); if ( auxType!=AuxSymbolType::Nb_Types && nbAux==0 ) log.log(Log::LineType::Warning, i18n("Symbol without needed auxilliary symbol (type=%1)").tqarg(auxType.type()));
Q_ASSERT( (offset-start)==object.size(SymbolSize) ); Q_ASSERT( (offset-start)==object.size(SymbolSize) );
_aux.resize(nbAux); _aux.resize(nbAux);
for (uint i=0; i<nbAux; i++) { for (uint i=0; i<nbAux; i++) {
@ -245,14 +245,14 @@ Coff::Relocation::Relocation(const Object &object, const Section &section,
TQ_UINT32 v; TQ_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return; if ( !getULong(data, offset, 4, log, v) ) return;
_address = v; _address = v;
if ( _address>section.size() ) log.log(Log::LineType::Warning, i18n("Relocation address beyong section size: %1/%2").arg(v).arg(section.size())); if ( _address>section.size() ) log.log(Log::LineType::Warning, i18n("Relocation address beyong section size: %1/%2").tqarg(v).tqarg(section.size()));
if ( !getULong(data, offset, 4, log, v) ) return; if ( !getULong(data, offset, 4, log, v) ) return;
if ( v>=object.nbSymbols() ) { if ( v>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Relocation has unknown symbol: %1").arg(v)); log.log(Log::LineType::Error, i18n("Relocation has unknown symbol: %1").tqarg(v));
return; return;
} }
if ( object.symbol(v)->isAuxSymbol() ) { if ( object.symbol(v)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Relocation is an auxiliary symbol: %1").arg(v)); log.log(Log::LineType::Error, i18n("Relocation is an auxiliary symbol: %1").tqarg(v));
return; return;
} }
_symbol = static_cast<const Symbol *>(object.symbol(v)); _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()); //qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1());
} else { } else {
if ( tmp>=object.nbSymbols() ) { if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp)); log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").tqarg(tmp));
return; return;
} }
if ( object.symbol(tmp)->isAuxSymbol() ) { if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp)); log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").tqarg(tmp));
return; return;
} }
_symbol = static_cast<const Symbol *>(object.symbol(tmp)); _symbol = static_cast<const Symbol *>(object.symbol(tmp));
@ -296,11 +296,11 @@ Coff::CodeLine::CodeLine(const Object &object, const Section &section,
} }
} else { } else {
if ( tmp>=object.nbSymbols() ) { if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp)); log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").tqarg(tmp));
return; return;
} }
if ( object.symbol(tmp)->isAuxSymbol() ) { if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp)); log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").tqarg(tmp));
return; return;
} }
_symbol = static_cast<const Symbol *>(object.symbol(tmp)); _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 ) // if ( _symbol && _symbol->_class!=Symbol::CFile )
// log.log(Log::LineType::Warning, i18n("Line without file symbol associated (%1:%2 %3).") // log.log(Log::LineType::Warning, i18n("Line without file symbol associated (%1:%2 %3).")
// .arg(_section._name).arg(toHexLabel(_address, nbChars(_address))).arg(_symbol->_class)); // .tqarg(_section._name).tqarg(toHexLabel(_address, nbChars(_address))).tqarg(_symbol->_class));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -343,7 +343,7 @@ Coff::Section::Section(const Device::Data &device, const Object &object,
_address = v; _address = v;
if ( !getULong(data, offset, 4, log, v) ) return; 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.") //if ( _address!=v ) log.log(Log::LineType::Warning, i18n("Virtual address (%1) does not match physical address (%2) in %3.")
// .arg(toHexLabel(v, 4)).arg(toHexLabel(_address, 4)).arg(_name)); // .tqarg(toHexLabel(v, 4)).tqarg(toHexLabel(_address, 4)).tqarg(_name));
if ( !getULong(data, offset, 4, log, v) ) return; if ( !getULong(data, offset, 4, log, v) ) return;
_size = v; _size = v;
if ( !getULong(data, offset, 4, log, v) ) return; if ( !getULong(data, offset, 4, log, v) ) return;
@ -451,25 +451,25 @@ bool Coff::Object::parse(Log::Base &log)
uint offset = 0; uint offset = 0;
if ( !initParse(CoffType::Object, data, offset, log) ) return false; if ( !initParse(CoffType::Object, data, offset, log) ) return false;
if ( _format==Format::Nb_Types ) { if ( _format==Format::Nb_Types ) {
log.log(Log::LineType::Error, i18n("COFF format not supported: magic number is %1.").arg(toHexLabel(_magic, 4))); log.log(Log::LineType::Error, i18n("COFF format not supported: magic number is %1.").tqarg(toHexLabel(_magic, 4)));
return false; return false;
} }
log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").arg(toHexLabel(_magic, 4))); log.log(Log::DebugLevel::Extra, TQString("COFF format: %1").tqarg(toHexLabel(_magic, 4)));
if ( !parseHeader(data, offset, log) ) return false; if ( !parseHeader(data, offset, log) ) return false;
// optionnal header // optionnal header
Q_ASSERT( offset==size(HeaderSize) ); Q_ASSERT( offset==size(HeaderSize) );
if ( !getULong(data, offset, 2, log, _optHeaderMagic) ) return false; if ( !getULong(data, offset, 2, log, _optHeaderMagic) ) return false;
log.log(Log::DebugLevel::Extra, TQString("COFF optionnal header format: %1").arg(toHexLabel(_optHeaderMagic, 4))); log.log(Log::DebugLevel::Extra, TQString("COFF optionnal header format: %1").tqarg(toHexLabel(_optHeaderMagic, 4)));
_optHeaderFormat = OptHeaderFormat::Nb_Types; _optHeaderFormat = OptHeaderFormat::Nb_Types;
uint i = 0; uint i = 0;
for (; OPT_HEADER_DATA[i].optHeaderFormat!=OptHeaderFormat::Nb_Types; i++) if ( _optHeaderMagic==OPT_HEADER_DATA[i].magic ) break; for (; OPT_HEADER_DATA[i].optHeaderFormat!=OptHeaderFormat::Nb_Types; i++) if ( _optHeaderMagic==OPT_HEADER_DATA[i].magic ) break;
_optHeaderFormat = OPT_HEADER_DATA[i].optHeaderFormat; _optHeaderFormat = OPT_HEADER_DATA[i].optHeaderFormat;
if ( _optHeaderFormat==OptHeaderFormat::Nb_Types ) { if ( _optHeaderFormat==OptHeaderFormat::Nb_Types ) {
log.log(Log::LineType::Warning, i18n("Optional header format not supported: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4))); log.log(Log::LineType::Warning, i18n("Optional header format not supported: magic number is %1.").tqarg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2; offset += size(OptHeaderSize)-2;
} else if ( !OPT_HEADER_DATA[i].parsed ) { } else if ( !OPT_HEADER_DATA[i].parsed ) {
log.log(Log::DebugLevel::Normal, TQString("Optional header not parsed: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4))); log.log(Log::DebugLevel::Normal, TQString("Optional header not parsed: magic number is %1.").tqarg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2; offset += size(OptHeaderSize)-2;
} else if ( !parseOptionnalHeader(data, offset, log) ) return false; } 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; _nbSymbols = v;
if ( !getULong(data, offset, 2, log, v) ) return false; if ( !getULong(data, offset, 2, log, v) ) return false;
if ( v!=size(OptHeaderSize) ) { if ( v!=size(OptHeaderSize) ) {
log.log(Log::LineType::Error, i18n("Optionnal header size is not %1: %2").arg(size(OptHeaderSize)).arg(v)); log.log(Log::LineType::Error, i18n("Optionnal header size is not %1: %2").tqarg(size(OptHeaderSize)).tqarg(v));
return false; return false;
} }
if ( !getULong(data, offset, 2, log, 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 // #### 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... // the pic type will be 18C452 in non-extended mode and 18F4620 for extended mode...
TQString name = Coff::findId(v); TQString name = Coff::findId(v);
log.log(Log::DebugLevel::Normal, TQString("Device name: \"%1\"").arg(name)); log.log(Log::DebugLevel::Normal, TQString("Device name: \"%1\"").tqarg(name));
if ( name.isEmpty() ) { if ( name.isEmpty() ) {
log.log(Log::DebugLevel::Normal, TQString("Unknown processor type: %1").arg(toHexLabel(v, 4))); 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).").arg(toHexLabel(v, 4))); log.log(Log::LineType::Error, i18n("Could not determine processor (%1).").tqarg(toHexLabel(v, 4)));
return false; return false;
} else if ( _device==0 ) _device = Device::lister().data(name); } else if ( _device==0 ) _device = Device::lister().data(name);
else if ( name!=_device->name() ) log.log(Log::DebugLevel::Normal, TQString("Different processor name: %1").arg(name)); else if ( name!=_device->name() ) log.log(Log::DebugLevel::Normal, TQString("Different processor name: %1").tqarg(name));
if ( !getULong(data, offset, 4, log, v) ) return false; if ( !getULong(data, offset, 4, log, v) ) return false;
const Pic::Data *pdata = static_cast<const Pic::Data *>(_device); const Pic::Data *pdata = static_cast<const Pic::Data *>(_device);
if (pdata) { if (pdata) {
uint nbBits = pdata->nbBitsWord(Pic::MemoryRangeType::Code) / pdata->addressIncrement(Pic::MemoryRangeType::Code); 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").arg(nbBits).arg(v)); if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Rom width is not %1: %2").tqarg(nbBits).tqarg(v));
} }
if ( !getULong(data, offset, 4, log, v) ) return false; if ( !getULong(data, offset, 4, log, v) ) return false;
if (pdata) { if (pdata) {
uint nbBits = pdata->registersData().nbBits(); uint nbBits = pdata->registersData().nbBits();
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Ram width is not %1: %2").arg(nbBits).arg(v)); if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, TQString("Ram width is not %1: %2").tqarg(nbBits).tqarg(v));
} }
} }
return true; return true;

@ -249,12 +249,12 @@ TQString Coff::TextObject::disassembly() const
Log::KeyList Coff::TextObject::information() const Log::KeyList Coff::TextObject::information() const
{ {
Log::KeyList keys; Log::KeyList keys;
keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").arg(format().label()).arg(toHexLabel(format().data().magic, 4))); keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").tqarg(format().label()).tqarg(toHexLabel(format().data().magic, 4)));
TQString name = (format()==Format::PIC30 || device()==0 ? "?" : device()->name()); TQString name = (format()==Format::PIC30 || device()==0 ? "?" : device()->name());
keys.append(i18n("Device:"), name); keys.append(i18n("Device:"), name);
OptHeaderFormat ohf = optHeaderFormat(); OptHeaderFormat ohf = optHeaderFormat();
TQString label = (ohf==OptHeaderFormat::Nb_Types ? i18n("Unknown") : ohf.label()); TQString label = (ohf==OptHeaderFormat::Nb_Types ? i18n("Unknown") : ohf.label());
keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").arg(label).arg(toHexLabel(optHeaderMagic(), 4))); keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").tqarg(label).tqarg(toHexLabel(optHeaderMagic(), 4)));
keys.append(i18n("No. of sections:"), TQString::number(nbSections())); keys.append(i18n("No. of sections:"), TQString::number(nbSections()));
keys.append(i18n("No. of symbols:"), TQString::number(nbSymbols())); keys.append(i18n("No. of symbols:"), TQString::number(nbSymbols()));
keys.append(i18n("No. of variables:"), TQString::number(variables().count())); 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); if ( s.isEmpty() ) return errorExit(i18n("No command specified"), ARG_ERROR);
const CommandData *data = findCommandData(s); const CommandData *data = findCommandData(s);
if ( data==0 ) return errorExit(i18n("Unknown command: %1").arg(s), ARG_ERROR); if ( data==0 ) return errorExit(i18n("Unknown command: %1").tqarg(s), ARG_ERROR);
return OK; return OK;
} }
@ -182,7 +182,7 @@ CLI::ExitCode CLI::MainBase::doRun()
TQString option = _args->getOption(PROPERTY_DATA[i].name); TQString option = _args->getOption(PROPERTY_DATA[i].name);
ExitCode code = executeSetCommand(PROPERTY_DATA[i].name, option); ExitCode code = executeSetCommand(PROPERTY_DATA[i].name, option);
if ( code!=OK ) return code; if ( code!=OK ) return code;
log(Log::LineType::Information, TQString("%1: %2").arg(PROPERTY_DATA[i].name).arg(executeGetCommand(PROPERTY_DATA[i].name))); log(Log::LineType::Information, TQString("%1: %2").tqarg(PROPERTY_DATA[i].name).tqarg(executeGetCommand(PROPERTY_DATA[i].name)));
} }
// process default lists // process default lists

@ -17,7 +17,7 @@ bool PURL::File::openForWrite()
_file->setName(url().filepath()); _file->setName(url().filepath());
if ( !_file->open(IO_WriteOnly) ) { if ( !_file->open(IO_WriteOnly) ) {
_error = i18n("Could not open file for writing."); _error = i18n("Could not open file for writing.");
_log.sorry(_error, i18n("File: %1").arg(_file->name())); _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
return false; return false;
} }
return true; return true;
@ -35,7 +35,7 @@ bool PURL::File::openForRead()
_file->setName(_url.filepath()); _file->setName(_url.filepath());
if ( !_file->open(IO_ReadOnly) ) { if ( !_file->open(IO_ReadOnly) ) {
_error = i18n("Could not open file for reading."); _error = i18n("Could not open file for reading.");
_log.sorry(_error, i18n("File: %1").arg(_file->name())); _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
return false; return false;
} }
return true; return true;

@ -10,7 +10,7 @@
#define STREAMER_H #define STREAMER_H
#include <tqdatastream.h> #include <tqdatastream.h>
#include <textstream.h> #include <tqtextstream.h>
#include "common/global/global.h" #include "common/global/global.h"
#include "common/common/number.h" #include "common/common/number.h"

@ -9,7 +9,7 @@
#ifndef PFILE_H #ifndef PFILE_H
#define PFILE_H #define PFILE_H
#include <textstream.h> #include <tqtextstream.h>
#include "purl.h" #include "purl.h"
namespace PURL namespace PURL

@ -146,13 +146,13 @@ bool Process::Base::isFilteredLine(const TQString &line)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void Process::StringOutput::receivedStdout(KProcess*, char *data, int len) void Process::StringOutput::receivedStdout(KProcess*, char *data, int len)
{ {
_stdout += TQString::fromLatin1(data, len); _stdout += TQString::tqfromLatin1(data, len);
emit stdoutDataReceived(); emit stdoutDataReceived();
} }
void Process::StringOutput::receivedStderr(KProcess*, char *data, int len) void Process::StringOutput::receivedStderr(KProcess*, char *data, int len)
{ {
_stderr += TQString::fromLatin1(data, len); _stderr += TQString::tqfromLatin1(data, len);
emit stderrDataReceived(); emit stderrDataReceived();
} }
@ -164,7 +164,7 @@ void Process::LineBase::receivedStdout(KProcess*, char *data, int len)
if ( data[i]=='\n' ) { if ( data[i]=='\n' ) {
if ( !isFilteredLine(_stdout) ) addStdoutLine(_stdout); if ( !isFilteredLine(_stdout) ) addStdoutLine(_stdout);
_stdout = TQString(); _stdout = TQString();
} else _stdout += TQString::fromLatin1(data + i, 1); } else _stdout += TQString::tqfromLatin1(data + i, 1);
} }
if ( !_process->isRunning() && !isFilteredLine(_stdout) ) addStdoutLine(_stdout); if ( !_process->isRunning() && !isFilteredLine(_stdout) ) addStdoutLine(_stdout);
emit stdoutDataReceived(); emit stdoutDataReceived();
@ -177,7 +177,7 @@ void Process::LineBase::receivedStderr(KProcess*, char *data, int len)
if ( data[i]=='\n' ) { if ( data[i]=='\n' ) {
if ( !isFilteredLine(_stderr) ) addStderrLine(_stderr); if ( !isFilteredLine(_stderr) ) addStderrLine(_stderr);
_stderr = TQString(); _stderr = TQString();
} else _stderr += TQString::fromLatin1(data + i, 1); } else _stderr += TQString::tqfromLatin1(data + i, 1);
} }
if ( !_process->isRunning() && !isFilteredLine(_stderr) ) addStderrLine(_stderr); if ( !_process->isRunning() && !isFilteredLine(_stderr) ) addStderrLine(_stderr);
emit stderrDataReceived(); emit stderrDataReceived();

@ -69,7 +69,7 @@ TQString PURL::Private::getWindowsDrivePath(char drive)
} }
return _winDrives[drive]; return _winDrives[drive];
#else #else
return TQString("%1:\\").arg(drive); return TQString("%1:\\").tqarg(drive);
#endif #endif
} }

@ -26,7 +26,7 @@ bool XmlDataFile::load(TQString &error)
Log::StringView sview; Log::StringView sview;
PURL::File file(_url, sview); PURL::File file(_url, sview);
if ( !file.openForRead() ) { if ( !file.openForRead() ) {
error = i18n("Error opening file: %1").arg(sview.string()); error = i18n("Error opening file: %1").tqarg(sview.string());
return false; return false;
} }
if ( !_document.setContent(file.qfile(), false, &error) ) return false; if ( !_document.setContent(file.qfile(), false, &error) ) return false;
@ -48,7 +48,7 @@ bool XmlDataFile::save(TQString &error) const
file.appendText(s); file.appendText(s);
ok = file.close(); ok = file.close();
} }
if ( !ok ) error = i18n("Error saving file: %1").arg(sview.string()); if ( !ok ) error = i18n("Error saving file: %1").tqarg(sview.string());
return ok; return ok;
} }

@ -55,19 +55,19 @@ void Container::initLayout()
setFrame(_type); setFrame(_type);
} }
void Container::addWidget(TQWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int alignment) void Container::addWidget(TQWidget *w, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment)
{ {
Q_ASSERT( startRow<=endRow ); Q_ASSERT( startRow<=endRow );
Q_ASSERT( startCol<=endCol ); Q_ASSERT( startCol<=endCol );
w->show(); w->show();
_gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, alignment); _gridLayout->addMultiCellWidget(w, startRow, endRow, startCol, endCol, tqalignment);
} }
void Container::addLayout(TQLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int alignment) void Container::addLayout(TQLayout *l, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment)
{ {
Q_ASSERT( startRow<=endRow ); Q_ASSERT( startRow<=endRow );
Q_ASSERT( startCol<=endCol ); Q_ASSERT( startCol<=endCol );
_gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, alignment); _gridLayout->addMultiCellLayout(l, startRow, endRow, startCol, endCol, tqalignment);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

@ -12,7 +12,7 @@
#include <tqframe.h> #include <tqframe.h>
#include <tqwidgetstack.h> #include <tqwidgetstack.h>
#include <tqtabwidget.h> #include <tqtabwidget.h>
#include <layout.h> #include <tqlayout.h>
class PopupButton; class PopupButton;
@ -26,8 +26,8 @@ public:
Container(TQWidget *parent = 0, Type type = Flat); Container(TQWidget *parent = 0, Type type = Flat);
Container(TQWidgetStack *stack, uint index, Type type = Flat); Container(TQWidgetStack *stack, uint index, Type type = Flat);
Container(TQTabWidget *tabw, const TQString &title, 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 alignment = 0); void addWidget(TQWidget *widget, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0);
void addLayout(TQLayout *layout, uint startRow, uint endRow, uint startCol, uint endCol, int alignment = 0); void addLayout(TQLayout *tqlayout, uint startRow, uint endRow, uint startCol, uint endCol, int tqalignment = 0);
uint numRows() const { return _gridLayout->numRows(); } uint numRows() const { return _gridLayout->numRows(); }
uint numCols() const { return _gridLayout->numCols(); } uint numCols() const { return _gridLayout->numCols(); }
void setFrame(Type type); void setFrame(Type type);

@ -9,7 +9,7 @@
#ifndef DIALOG_H #ifndef DIALOG_H
#define DIALOG_H #define DIALOG_H
#include <layout.h> #include <tqlayout.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include <klistview.h> #include <klistview.h>

@ -53,7 +53,7 @@ void EditListBox::init(uint nbColumns, TQWidget *view)
_moveDownButton = 0; _moveDownButton = 0;
_removeAllButton = 0; _removeAllButton = 0;
_resetButton = 0; _resetButton = 0;
setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding)); tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
TQGridLayout *grid = new TQGridLayout(this, 1, 1, 0, KDialog::spacingHint()); TQGridLayout *grid = new TQGridLayout(this, 1, 1, 0, KDialog::spacingHint());
uint row = 0; uint row = 0;

@ -19,7 +19,7 @@
#ifndef EDITLISTBOX_H #ifndef EDITLISTBOX_H
#define EDITLISTBOX_H #define EDITLISTBOX_H
#include <layout.h> #include <tqlayout.h>
#include <klineedit.h> #include <klineedit.h>
#include <kpushbutton.h> #include <kpushbutton.h>
#include <klistview.h> #include <klistview.h>

@ -125,12 +125,12 @@ bool GenericHexWordEditor::event(TQEvent *e)
return TQLineEdit::event(e); return TQLineEdit::event(e);
} }
TQSize GenericHexWordEditor::sizeHint() const TQSize GenericHexWordEditor::tqsizeHint() const
{ {
return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height());
} }
TQSize GenericHexWordEditor::minimumSizeHint() const TQSize GenericHexWordEditor::tqminimumSizeHint() const
{ {
return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height()); return TQSize(maxCharWidth(NumberBase::Hex, font()) * (_nbChars+1), fontMetrics().height());
} }

@ -35,8 +35,8 @@ Q_OBJECT
TQ_OBJECT TQ_OBJECT
public: public:
GenericHexWordEditor(uint nbChars, bool hasBlankValue, TQWidget *parent); GenericHexWordEditor(uint nbChars, bool hasBlankValue, TQWidget *parent);
virtual TQSize sizeHint() const; virtual TQSize tqsizeHint() const;
virtual TQSize minimumSizeHint() const; virtual TQSize tqminimumSizeHint() const;
signals: signals:
void modified(); void modified();

@ -77,7 +77,7 @@ public:
ParentType::_widget->clear(); ParentType::_widget->clear();
} }
void fixMinimumWidth() { void fixMinimumWidth() {
ParentType::_widget->setMinimumWidth(ParentType::_widget->sizeHint().width()); ParentType::_widget->setMinimumWidth(ParentType::_widget->tqsizeHint().width());
} }
protected: protected:

@ -62,8 +62,8 @@ bool ListView::eventFilter(TQObject *o, TQEvent *e)
break; break;
} }
case TQEvent::FocusOut: { case TQEvent::FocusOut: {
//qDebug("focus out %i %i=%i", tqApp->focusWidget(), focusWidget(), (*it)->_editWidgets[i]); //qDebug("focus out %i %i=%i", tqApp->tqfocusWidget(), tqfocusWidget(), (*it)->_editWidgets[i]);
if ( tqApp->focusWidget() && focusWidget()==(*it)->_editWidgets[i] ) break; if ( tqApp->tqfocusWidget() && tqfocusWidget()==(*it)->_editWidgets[i] ) break;
//qDebug("ext"); //qDebug("ext");
TQCustomEvent *e = new TQCustomEvent(9999); TQCustomEvent *e = new TQCustomEvent(9999);
TQApplication::postEvent(o, e); TQApplication::postEvent(o, e);
@ -95,7 +95,7 @@ void ListViewToolTip::maybeTip(const TQPoint &p)
if ( _listView==0 ) return; if ( _listView==0 ) return;
const TQListViewItem* item = _listView->itemAt(p); const TQListViewItem* item = _listView->itemAt(p);
if ( item==0 ) return; if ( item==0 ) return;
TQRect rect = _listView->itemRect(item); TQRect rect = _listView->tqitemRect(item);
if ( !rect.isValid() ) return; if ( !rect.isValid() ) return;
int col = _listView->header()->sectionAt(p.x()); int col = _listView->header()->sectionAt(p.x());
TQString text = _listView->tooltip(*item, col); TQString text = _listView->tooltip(*item, col);
@ -149,7 +149,7 @@ void EditListViewItem::startRename()
_renaming = true; _renaming = true;
_editWidgets.resize(lv->columns()); _editWidgets.resize(lv->columns());
for (uint i=0; i<_editWidgets.count(); i++) { for (uint i=0; i<_editWidgets.count(); i++) {
TQRect r = lv->itemRect(this); TQRect r = lv->tqitemRect(this);
r = TQRect(lv->viewportToContents(r.topLeft()), r.size()); r = TQRect(lv->viewportToContents(r.topLeft()), r.size());
r.setLeft(lv->header()->sectionPos(i)); r.setLeft(lv->header()->sectionPos(i));
r.setWidth(lv->header()->sectionSize(i) - 1); r.setWidth(lv->header()->sectionSize(i) - 1);
@ -162,7 +162,7 @@ void EditListViewItem::startRename()
if ( _editWidgets[i]==0 ) continue; if ( _editWidgets[i]==0 ) continue;
_editWidgets[i]->installEventFilter(lv); _editWidgets[i]->installEventFilter(lv);
lv->addChild(_editWidgets[i], r.x(), r.y()); lv->addChild(_editWidgets[i], r.x(), r.y());
uint w = TQMIN(r.width(), _editWidgets[i]->sizeHint().width()); uint w = TQMIN(r.width(), _editWidgets[i]->tqsizeHint().width());
_editWidgets[i]->resize(w, r.height()); _editWidgets[i]->resize(w, r.height());
lv->viewport()->setFocusProxy(_editWidgets[i]); lv->viewport()->setFocusProxy(_editWidgets[i]);
_editWidgets[i]->setFocus(); _editWidgets[i]->setFocus();
@ -191,9 +191,9 @@ void EditListViewItem::removeEditBox()
void EditListViewItem::editDone(int col, const TQWidget *edit) void EditListViewItem::editDone(int col, const TQWidget *edit)
{ {
if ( edit->metaObject()->findProperty("text", true)!=-1 ) if ( edit->tqmetaObject()->findProperty("text", true)!=-1 )
emit listView()->itemRenamed(this, col, edit->property("text").toString()); emit listView()->itemRenamed(this, col, edit->property("text").toString());
else if ( edit->metaObject()->findProperty("currentText", true)!=-1 ) else if ( edit->tqmetaObject()->findProperty("currentText", true)!=-1 )
emit listView()->itemRenamed(this, col, edit->property("currentText").toString()); emit listView()->itemRenamed(this, col, edit->property("currentText").toString());
} }
@ -215,7 +215,7 @@ int EditListViewItem::width(const TQFontMetrics &fm, const TQListView *lv, int c
int w = KListViewItem::width(fm, lv, col); int w = KListViewItem::width(fm, lv, col);
TQWidget *edit = editWidgetFactory(col); TQWidget *edit = editWidgetFactory(col);
if ( edit==0 ) return w; if ( edit==0 ) return w;
w = TQMAX(w, edit->sizeHint().width()); w = TQMAX(w, edit->tqsizeHint().width());
delete edit; delete edit;
return w; return w;
} }

@ -9,7 +9,7 @@
#ifndef MISC_GUI_H #ifndef MISC_GUI_H
#define MISC_GUI_H #define MISC_GUI_H
#include <layout.h> #include <tqlayout.h>
#include <tqsplitter.h> #include <tqsplitter.h>
#include <tqvaluevector.h> #include <tqvaluevector.h>
#include <tqvalidator.h> #include <tqvalidator.h>

@ -22,7 +22,7 @@ bool PURL::File::openForWrite()
_tmp->setAutoDelete(true); _tmp->setAutoDelete(true);
if ( _tmp->status()!=0 ) { if ( _tmp->status()!=0 ) {
_error = i18n("Could not create temporary file."); _error = i18n("Could not create temporary file.");
_log.sorry(_error, i18n("File: %1").arg(_tmp->name())); _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
return false; return false;
} }
return true; return true;
@ -61,7 +61,7 @@ bool PURL::File::openForRead()
_file->setName(tmp); _file->setName(tmp);
if ( !_file->open(IO_ReadOnly) ) { if ( !_file->open(IO_ReadOnly) ) {
_error = i18n("Could not open temporary file."); _error = i18n("Could not open temporary file.");
_log.sorry(_error, i18n("File: %1").arg(_file->name())); _log.sorry(_error, i18n("File: %1").tqarg(_file->name()));
return false; return false;
} }
return true; return true;
@ -92,7 +92,7 @@ bool PURL::TempFile::close()
_tmp->close(); _tmp->close();
if ( _tmp->status()!=IO_Ok ) { if ( _tmp->status()!=IO_Ok ) {
_error = i18n("Could not write to temporary file."); _error = i18n("Could not write to temporary file.");
_log.sorry(_error, i18n("File: %1").arg(_tmp->name())); _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
return false; return false;
} }
} }
@ -107,7 +107,7 @@ bool PURL::TempFile::openForWrite()
_tmp->setAutoDelete(true); _tmp->setAutoDelete(true);
if ( _tmp->status()!=0 ) { if ( _tmp->status()!=0 ) {
_error = i18n("Could not create temporary file."); _error = i18n("Could not create temporary file.");
_log.sorry(_error, i18n("File: %1").arg(_tmp->name())); _log.sorry(_error, i18n("File: %1").tqarg(_tmp->name()));
return false; return false;
} }
return true; return true;

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "purl_gui.h" #include "purl_gui.h"
#include <layout.h> #include <tqlayout.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kpushbutton.h> #include <kpushbutton.h>
#include <krun.h> #include <krun.h>
@ -40,7 +40,7 @@ PURL::Url PURL::getSaveUrl(const TQString &startDir, const TQString &filter,
case NoSaveAction: break; case NoSaveAction: break;
case AskOverwrite: case AskOverwrite:
if ( url.exists() ) { if ( url.exists() ) {
if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").arg(url.pretty())) ) return Url(); if ( !MessageBox::askContinue(i18n("File \"%1\" already exists. Overwrite ?").tqarg(url.pretty())) ) return Url();
} }
break; break;
case CancelIfExists: case CancelIfExists:

@ -25,7 +25,7 @@
#include "nokde_kaboutdata.h" #include "nokde_kaboutdata.h"
//#include <kstandarddirs.h> //#include <kstandarddirs.h>
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
#include <tqstringlist.h> #include <tqstringlist.h>
TQString TQString
@ -271,7 +271,7 @@ KAboutData::setProgramLogo(const TQImage& image)
TQString TQString
KAboutData::version() const KAboutData::version() const
{ {
return TQString::fromLatin1(mVersion); return TQString::tqfromLatin1(mVersion);
} }
TQString TQString
@ -286,13 +286,13 @@ KAboutData::shortDescription() const
TQString TQString
KAboutData::homepage() const KAboutData::homepage() const
{ {
return TQString::fromLatin1(mHomepageAddress); return TQString::tqfromLatin1(mHomepageAddress);
} }
TQString TQString
KAboutData::bugAddress() const KAboutData::bugAddress() const
{ {
return TQString::fromLatin1(mBugEmailAddress); return TQString::tqfromLatin1(mBugEmailAddress);
} }
const TQValueList<KAboutPerson> const TQValueList<KAboutPerson>
@ -434,7 +434,7 @@ KAboutData::license() const
} }
if (!l.isEmpty()) if (!l.isEmpty())
result += i18n("This program is distributed under the terms of the %1.").arg( l ); result += i18n("This program is distributed under the terms of the %1.").tqarg( l );
if (!f.isEmpty()) if (!f.isEmpty())
{ {

@ -518,7 +518,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (ignoreUnknown) if (ignoreUnknown)
return; return;
enable_i18n(); enable_i18n();
usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); usage( i18n("Unknown option '%1'.").tqarg(TQString::fromLocal8Bit(_opt)));
} }
if ((result & 4) != 0) if ((result & 4) != 0)
@ -534,7 +534,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (ignoreUnknown) if (ignoreUnknown)
return; return;
enable_i18n(); enable_i18n();
usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); usage( i18n("Unknown option '%1'.").tqarg(TQString::fromLocal8Bit(_opt)));
} }
if (argument.isEmpty()) if (argument.isEmpty())
{ {
@ -542,7 +542,7 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
if (i >= argc) if (i >= argc)
{ {
enable_i18n(); enable_i18n();
usage( i18n("'%1' missing.").arg( opt_name)); usage( i18n("'%1' missing.").tqarg( opt_name));
} }
argument = argv[i]; argument = argv[i];
} }
@ -618,10 +618,10 @@ KCmdLineArgs::parseAllArgs()
else if ( (::qstrcmp(option, "version") == 0) || else if ( (::qstrcmp(option, "version") == 0) ||
(::qstrcmp(option, "v") == 0)) (::qstrcmp(option, "v") == 0))
{ {
printQ( TQString("TQt: %1\n").arg(qVersion())); printQ( TQString("TQt: %1\n").tqarg(qVersion()));
// printQ( TQString("KDE: %1\n").arg(TDE_VERSION_STRING)); // printQ( TQString("KDE: %1\n").tqarg(TDE_VERSION_STRING));
printQ( TQString("%1: %2\n"). printQ( TQString("%1: %2\n").
arg(about->programName()).arg(about->version())); arg(about->programName()).tqarg(about->version()));
exit(0); exit(0);
} else if ( (::qstrcmp(option, "license") == 0) ) } else if ( (::qstrcmp(option, "license") == 0) )
{ {
@ -641,17 +641,17 @@ KCmdLineArgs::parseAllArgs()
email = " <" + (*it).emailAddress() + ">"; email = " <" + (*it).emailAddress() + ">";
authorlist += TQString(" ") + (*it).name() + email + "\n"; 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()) ).arg( 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()) ).tqarg( authorlist ) );
} }
} else { } else {
printQ( i18n("%1 was written by somebody who wants to remain anonymous.").arg(about->programName()) ); printQ( i18n("%1 was written by somebody who wants to remain anonymous.").tqarg(about->programName()) );
} }
if (!about->bugAddress().isEmpty()) if (!about->bugAddress().isEmpty())
{ {
if (about->bugAddress() == "submit@bugs.kde.org") 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" ) ); printQ( i18n( "Please use http://bugs.kde.org to report bugs, do not mail the authors directly.\n" ) );
else else
printQ( i18n( "Please use %1 to report bugs, do not mail the authors directly.\n" ).arg(about->bugAddress()) ); printQ( i18n( "Please use %1 to report bugs, do not mail the authors directly.\n" ).tqarg(about->bugAddress()) );
} }
exit(0); exit(0);
} else { } else {
@ -671,7 +671,7 @@ KCmdLineArgs::parseAllArgs()
if (ignoreUnknown) if (ignoreUnknown)
continue; continue;
enable_i18n(); enable_i18n();
usage( i18n("Unexpected argument '%1'.").arg(TQString::fromLocal8Bit(argv[i]))); usage( i18n("Unexpected argument '%1'.").tqarg(TQString::fromLocal8Bit(argv[i])));
} }
else else
{ {
@ -815,7 +815,7 @@ KCmdLineArgs::usage(const char *id)
{ {
if (args->name) if (args->name)
{ {
usage = i18n("[%1-options]").arg(args->name)+" "+usage; usage = i18n("[%1-options]").tqarg(args->name)+" "+usage;
} }
args = argsList->prev(); args = argsList->prev();
} }
@ -835,30 +835,30 @@ KCmdLineArgs::usage(const char *id)
} }
} }
printQ(i18n("Usage: %1 %2\n").arg(argv[0]).arg(usage)); printQ(i18n("Usage: %1 %2\n").tqarg(argv[0]).tqarg(usage));
printQ("\n"+about->shortDescription()+"\n"); printQ("\n"+about->shortDescription()+"\n");
printQ(optionHeaderString.arg(i18n("Generic options"))); printQ(optionHeaderString.tqarg(i18n("Generic options")));
printQ(optionFormatString.arg("--help", -25).arg(i18n("Show help about options"))); printQ(optionFormatString.tqarg("--help", -25).tqarg(i18n("Show help about options")));
args = argsList->first(); args = argsList->first();
while(args) while(args)
{ {
if (args->name && args->id) if (args->name && args->id)
{ {
TQString option = TQString("--help-%1").arg(args->id); TQString option = TQString("--help-%1").tqarg(args->id);
TQString desc = i18n("Show %1 specific options").arg(args->name); TQString desc = i18n("Show %1 specific options").tqarg(args->name);
printQ(optionFormatString.arg(option, -25).arg(desc)); printQ(optionFormatString.tqarg(option, -25).tqarg(desc));
} }
args = argsList->next(); args = argsList->next();
} }
printQ(optionFormatString.arg("--help-all",-25).arg(i18n("Show all options"))); printQ(optionFormatString.tqarg("--help-all",-25).tqarg(i18n("Show all options")));
printQ(optionFormatString.arg("--author",-25).arg(i18n("Show author information"))); printQ(optionFormatString.tqarg("--author",-25).tqarg(i18n("Show author information")));
printQ(optionFormatString.arg("-v, --version",-25).arg(i18n("Show version information"))); printQ(optionFormatString.tqarg("-v, --version",-25).tqarg(i18n("Show version information")));
printQ(optionFormatString.arg("--license",-25).arg(i18n("Show license information"))); printQ(optionFormatString.tqarg("--license",-25).tqarg(i18n("Show license information")));
printQ(optionFormatString.arg("--", -25).arg(i18n("End of options"))); printQ(optionFormatString.tqarg("--", -25).tqarg(i18n("End of options")));
args = argsList->first(); // Sets current to 1st. args = argsList->first(); // Sets current to 1st.
@ -880,7 +880,7 @@ KCmdLineArgs::usage(const char *id)
bool hasOptions = false; bool hasOptions = false;
TQString optionsHeader; TQString optionsHeader;
if (args->name) if (args->name)
optionsHeader = optionHeaderString.arg(i18n("%1 options").arg(TQString::fromLatin1(args->name))); optionsHeader = optionHeaderString.tqarg(i18n("%1 options").tqarg(TQString::tqfromLatin1(args->name)));
else else
optionsHeader = i18n("\nOptions:\n"); optionsHeader = i18n("\nOptions:\n");
@ -950,8 +950,8 @@ KCmdLineArgs::usage(const char *id)
name = name.mid(1); name = name.mid(1);
if ((name[0] == '[') && (name[name.length()-1] == ']')) if ((name[0] == '[') && (name[name.length()-1] == ']'))
name = name.mid(1, name.length()-2); name = name.mid(1, name.length()-2);
printQ(optionFormatString.arg(TQString(name), -25) printQ(optionFormatString.tqarg(TQString(name), -25)
.arg(description)); .tqarg(description));
} }
else else
{ {
@ -974,13 +974,13 @@ KCmdLineArgs::usage(const char *id)
opt = opt + name; opt = opt + name;
if (!option->def) if (!option->def)
{ {
printQ(optionFormatString.arg(TQString(opt), -25) printQ(optionFormatString.tqarg(TQString(opt), -25)
.arg(description)); .tqarg(description));
} }
else else
{ {
printQ(optionFormatStringDef.arg(TQString(opt), -25) printQ(optionFormatStringDef.tqarg(TQString(opt), -25)
.arg(description).arg(option->def)); .tqarg(description).tqarg(option->def));
} }
opt = ""; opt = "";
} }
@ -989,7 +989,7 @@ KCmdLineArgs::usage(const char *id)
it != dl.end(); it != dl.end();
++it) ++it)
{ {
printQ(optionFormatString.arg("", -25).arg(*it)); printQ(optionFormatString.tqarg("", -25).tqarg(*it));
} }
option++; option++;

@ -59,12 +59,12 @@ TQStringList Port::Parallel::deviceList()
TQStringList list; TQStringList list;
#if defined(HAVE_PPDEV) #if defined(HAVE_PPDEV)
// standard parport in user space // standard parport in user space
for(int i = 0; i<8; ++i) list.append(TQString("/dev/parport%1").arg(i)); for(int i = 0; i<8; ++i) list.append(TQString("/dev/parport%1").tqarg(i));
// new devfs parport flavour // new devfs parport flavour
for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").arg(i)); for(int i = 0; i<8; ++i) list.append(TQString("/dev/parports/%1").tqarg(i));
#elif defined(HAVE_PPBUS) #elif defined(HAVE_PPBUS)
// FreeBSD // FreeBSD
for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").arg(i)); for(int i = 0; i<8; ++i) list.append(TQString("/dev/ppi%1").tqarg(i));
#endif #endif
return list; return list;
} }
@ -100,12 +100,12 @@ const Port::Parallel::PPinData Port::Parallel::PIN_DATA[Nb_Pins] = {
{ Data, 0x20, Out, "D5" }, // data 5 { Data, 0x20, Out, "D5" }, // data 5
{ Data, 0x40, Out, "D6" }, // data 6 { Data, 0x40, Out, "D6" }, // data 6
{ Data, 0x80, Out, "D7" }, // data 7 { Data, 0x80, Out, "D7" }, // data 7
{ Status, 0x40, In, "/ACK" }, // !ack { tqStatus, 0x40, In, "/ACK" }, // !ack
{ Status, 0x80, In, "BUSY" }, // busy { tqStatus, 0x80, In, "BUSY" }, // busy
{ Status, 0x20, In, "PAPER" }, // pout { tqStatus, 0x20, In, "PAPER" }, // pout
{ Status, 0x10, In, "SELin" }, // select { tqStatus, 0x10, In, "SELin" }, // select
{ Control, 0x02, Out, "LF" }, // !feed { Control, 0x02, Out, "LF" }, // !feed
{ Status, 0x08, In, "/ERROR" }, // !error { tqStatus, 0x08, In, "/ERROR" }, // !error
{ Control, 0x04, Out, "PRIME" }, // !init { Control, 0x04, Out, "PRIME" }, // !init
{ Control, 0x08, Out, "SELout" }, // !si { Control, 0x08, Out, "SELout" }, // !si
{ Nb_RequestTypes, 0x00, NoIO, "GND" }, // GND { Nb_RequestTypes, 0x00, NoIO, "GND" }, // GND
@ -166,17 +166,17 @@ bool Port::Parallel::internalOpen()
#if defined(HAVE_PPDEV) #if defined(HAVE_PPDEV)
_fd = ::open(_device.latin1(), O_RDWR); _fd = ::open(_device.latin1(), O_RDWR);
if ( _fd<0 ) { if ( _fd<0 ) {
setSystemError(i18n("Could not open device \"%1\"").arg(_device)); setSystemError(i18n("Could not open device \"%1\"").tqarg(_device));
return false; return false;
} }
if ( ioctl(_fd, PPCLAIM)<0 ) { if ( ioctl(_fd, PPCLAIM)<0 ) {
setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").arg(_device)); setSystemError(i18n("Could not claim device \"%1\": check it is read/write enabled").tqarg(_device));
return false; return false;
} }
#elif defined(HAVE_PPBUS) #elif defined(HAVE_PPBUS)
_fd = ::open(_device.latin1(), O_RDWR); _fd = ::open(_device.latin1(), O_RDWR);
if ( _fd<0 ) { if ( _fd<0 ) {
setSystemError(i18n("Could not open device \"%1\"").arg(_device)); setSystemError(i18n("Could not open device \"%1\"").tqarg(_device));
return false; return false;
} }
#endif #endif
@ -208,7 +208,7 @@ bool Port::Parallel::setPinOn(uint pin, bool on, LogicType type)
int request = REQUEST_DATA[rtype].write; int request = REQUEST_DATA[rtype].write;
Q_ASSERT( request!=0 ); Q_ASSERT( request!=0 );
if ( ioctl(_fd, request, &c)<0 ) { if ( ioctl(_fd, request, &c)<0 ) {
setSystemError(i18n("Error setting pin %1 to %2").arg(PIN_DATA[pin].label).arg(on)); setSystemError(i18n("Error setting pin %1 to %2").tqarg(PIN_DATA[pin].label).tqarg(on));
return false; return false;
} }
_images[rtype] = c; _images[rtype] = c;
@ -228,7 +228,7 @@ bool Port::Parallel::readPin(uint pin, LogicType type, bool &value)
Q_ASSERT( request!=0 ); Q_ASSERT( request!=0 );
uchar c = 0; uchar c = 0;
if ( ioctl(_fd, request, &c)<0 ) { if ( ioctl(_fd, request, &c)<0 ) {
setSystemError(i18n("Error reading bit on pin %1").arg(PIN_DATA[pin].label)); setSystemError(i18n("Error reading bit on pin %1").tqarg(PIN_DATA[pin].label));
return false; return false;
} }
_images[rtype] = c; _images[rtype] = c;
@ -240,7 +240,7 @@ bool Port::Parallel::readPin(uint pin, LogicType type, bool &value)
void Port::Parallel::setSystemError(const TQString &message) void Port::Parallel::setSystemError(const TQString &message)
{ {
#if defined(HAVE_PPDEV) || defined(HAVE_PPBUS) #if defined(HAVE_PPDEV) || defined(HAVE_PPBUS)
log(Log::LineType::Error, message + TQString(" (errno=%1).").arg(strerror(errno))); log(Log::LineType::Error, message + TQString(" (errno=%1).").tqarg(strerror(errno)));
#else #else
Q_UNUSED(message); Q_UNUSED(message);
#endif #endif

@ -33,7 +33,7 @@ public:
enum Pin { DS = 0, D0, D1, D2, D3, D4, D5, D6, D7, ACK, BUSY, PAPER, SELin, enum Pin { DS = 0, D0, D1, D2, D3, D4, D5, D6, D7, ACK, BUSY, PAPER, SELin,
LF, ERROR, PRIME, SELout, P18, P19, P20, P21, P22, P23, P24, P25, LF, ERROR, PRIME, SELout, P18, P19, P20, P21, P22, P23, P24, P25,
Nb_Pins }; Nb_Pins };
enum RequestType { Control = 0, Status, Data, Nb_RequestTypes }; enum RequestType { Control = 0, tqStatus, Data, Nb_RequestTypes };
struct PPinData { struct PPinData {
RequestType rType; RequestType rType;
uchar mask; uchar mask;

@ -28,7 +28,7 @@ void Port::Base::close()
bool Port::Base::send(const char *data, uint size, uint timeout) bool Port::Base::send(const char *data, uint size, uint timeout)
{ {
log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").arg(toPrintable(data, size, PrintAlphaNum))); log(Log::DebugLevel::LowLevel, TQString("Sending: \"%1\"").tqarg(toPrintable(data, size, PrintAlphaNum)));
return internalSend(data, size, timeout); return internalSend(data, size, timeout);
} }
@ -45,14 +45,14 @@ bool Port::Base::receive(uint size, TQMemArray<uchar> &a, uint timeout)
{ {
a.resize(size); a.resize(size);
bool ok = internalReceive(size, (char *)a.data(), timeout); bool ok = internalReceive(size, (char *)a.data(), timeout);
if (ok) log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").arg(toPrintable(a, PrintAlphaNum))); if (ok) log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").tqarg(toPrintable(a, PrintAlphaNum)));
return ok; return ok;
} }
bool Port::Base::receiveChar(char &c, uint timeout) bool Port::Base::receiveChar(char &c, uint timeout)
{ {
if ( !internalReceive(1, &c, timeout) ) return false; if ( !internalReceive(1, &c, timeout) ) return false;
log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").arg(toPrintable(c, PrintAlphaNum))); log(Log::DebugLevel::LowLevel, TQString("Received: \"%1\"").tqarg(toPrintable(c, PrintAlphaNum)));
return true; return true;
} }

@ -73,21 +73,21 @@ TQStringList Port::Serial::deviceList()
TQStringList list; TQStringList list;
#if defined(Q_OS_UNIX) #if defined(Q_OS_UNIX)
// standard serport in user space // standard serport in user space
for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").tqarg(i));
// new devfs serport flavour // new devfs serport flavour
for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").tqarg(i));
// standard USB serport in user space // standard USB serport in user space
for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").tqarg(i));
// new devfs USB serport flavour // new devfs USB serport flavour
for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").tqarg(i));
// FreeBSD // FreeBSD
for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").tqarg(i));
// Slackware 11 devfs USB Serial port support. // Slackware 11 devfs USB Serial port support.
for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").arg(i)); for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").tqarg(i));
// MacOSX devfs USB Serial port support. // MacOSX devfs USB Serial port support.
list.append("/dev/tty.usbserial"); list.append("/dev/tty.usbserial");
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
for (uint i=1; i<10; i++) list.append(TQString("COM%1").arg(i)); for (uint i=1; i<10; i++) list.append(TQString("COM%1").tqarg(i));
#endif #endif
return list; return list;
} }
@ -187,7 +187,7 @@ bool Port::Serial::internalOpen()
{ {
_fd = openHandle(_device, In | Out); _fd = openHandle(_device, In | Out);
if ( _fd==INVALID_HANDLE ) { if ( _fd==INVALID_HANDLE ) {
setSystemError(i18n("Could not open device \"%1\" read-write").arg(_device)); setSystemError(i18n("Could not open device \"%1\" read-write").tqarg(_device));
return false; return false;
} }
if ( !getParameters(_oldParameters) ) return false; // save configuration 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; if ( res>0 ) todo -= res;
else { else {
if ( uint(time.elapsed())>timeout ) { if ( uint(time.elapsed())>timeout ) {
log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").arg(size-todo).arg(size)); log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").tqarg(size-todo).tqarg(size));
return false; return false;
} }
msleep(1); msleep(1);
@ -277,7 +277,7 @@ bool Port::Serial::internalReceive(uint size, char *data, uint timeout)
if ( res>0 ) todo -= res; if ( res>0 ) todo -= res;
else { else {
if ( uint(time.elapsed())>timeout ) { if ( uint(time.elapsed())>timeout ) {
log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").arg(size-todo).arg(size)); log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").tqarg(size-todo).tqarg(size));
return false; return false;
} }
msleep(1); msleep(1);
@ -303,7 +303,7 @@ bool Port::Serial::drain(uint timeout)
if ( nb==0 ) break; if ( nb==0 ) break;
if ( uint(time.elapsed())>timeout ) { if ( uint(time.elapsed())>timeout ) {
_fd = INVALID_HANDLE; // otherwise close blocks... _fd = INVALID_HANDLE; // otherwise close blocks...
log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").arg(nb)); log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").tqarg(nb));
return false; return false;
} }
} }
@ -364,7 +364,7 @@ bool Port::Serial::setPinOn(uint pin, bool on, LogicType type)
Q_ASSERT( pin<Nb_Pins ); Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==Out ); Q_ASSERT( PIN_DATA[pin].dir==Out );
if ( !internalSetPinOn(Pin(pin), on) ) { if ( !internalSetPinOn(Pin(pin), on) ) {
setSystemError(i18n("Error setting bit %1 of serial port to %2").arg(PIN_DATA[pin].label).arg(on)); setSystemError(i18n("Error setting bit %1 of serial port to %2").tqarg(PIN_DATA[pin].label).tqarg(on));
return false; return false;
} }
return true; return true;
@ -387,7 +387,7 @@ bool Port::Serial::internalReadPin(Pin pin, LogicType type, bool &value)
return true; return true;
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
DWORD status; DWORD status;
if ( GetCommModemStatus(_fd, &status)==0 ) return false; if ( GetCommModemtqStatus(_fd, &status)==0 ) return false;
switch (pin) { switch (pin) {
case DCD: value = (status & MS_RLSD_ON); break; case DCD: value = (status & MS_RLSD_ON); break;
case DSR: value = (status & MS_DSR_ON); break; case DSR: value = (status & MS_DSR_ON); break;
@ -406,7 +406,7 @@ bool Port::Serial::internalReadPin(Pin pin, LogicType type, bool &value)
Q_ASSERT( pin<Nb_Pins ); Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==In ); Q_ASSERT( PIN_DATA[pin].dir==In );
if ( !internalReadPin(Pin(pin), type, value) ) { if ( !internalReadPin(Pin(pin), type, value) ) {
setSystemError(i18n("Error reading serial pin %1").arg(PIN_DATA[pin].label)); setSystemError(i18n("Error reading serial pin %1").tqarg(PIN_DATA[pin].label));
return false; return false;
} }
return true; return true;
@ -513,11 +513,11 @@ bool Port::Serial::setHardwareFlowControl(bool on)
void Port::Serial::setSystemError(const TQString &message) void Port::Serial::setSystemError(const TQString &message)
{ {
#if defined(Q_OS_UNIX) #if defined(Q_OS_UNIX)
log(Log::LineType::Error, message + TQString(" (errno=%1)").arg(strerror(errno))); log(Log::LineType::Error, message + TQString(" (errno=%1)").tqarg(strerror(errno)));
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
LPVOID lpMsgBuf; 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); 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)").arg(GetLastError()).arg((const char *)(LPCTSTR)lpMsgBuf)); log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").tqarg(GetLastError()).tqarg((const char *)(LPCTSTR)lpMsgBuf));
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
#endif #endif
} }

@ -38,7 +38,7 @@ void Port::USB::initialize()
#ifdef HAVE_USB #ifdef HAVE_USB
usb_init(); usb_init();
VersionData vd = VersionData::fromString(LIBUSB_VERSION); VersionData vd = VersionData::fromString(LIBUSB_VERSION);
TQString s = TQString("libusb %1").arg(vd.pretty()); TQString s = TQString("libusb %1").tqarg(vd.pretty());
if ( vd<VersionData(0, 1, 8) ) qWarning("%s: may be too old (you need at least version 0.1.8)", s.latin1()); if ( vd<VersionData(0, 1, 8) ) qWarning("%s: may be too old (you need at least version 0.1.8)", s.latin1());
#endif #endif
} }
@ -132,7 +132,7 @@ TQStringList Port::USB::probedDeviceList()
for (struct usb_device *dev=bus->devices; dev; dev=dev->next) { for (struct usb_device *dev=bus->devices; dev; dev=dev->next) {
if ( dev->descriptor.idVendor==0 ) continue; // controller if ( dev->descriptor.idVendor==0 ) continue; // controller
list.append(TQString("Vendor Id: %1 - Product Id: %2") list.append(TQString("Vendor Id: %1 - Product Id: %2")
.arg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).arg(toLabel(NumberBase::Hex, dev->descriptor.idProduct, 4))); .tqarg(toLabel(NumberBase::Hex, dev->descriptor.idVendor, 4)).tqarg(toLabel(NumberBase::Hex, dev->descriptor.idProduct, 4)));
} }
} }
#endif #endif
@ -179,7 +179,7 @@ Port::USB::~USB()
void Port::USB::setSystemError(const TQString &message) void Port::USB::setSystemError(const TQString &message)
{ {
#ifdef HAVE_USB #ifdef HAVE_USB
log(Log::LineType::Error, message + TQString(" (err=%1).").arg(usb_strerror())); log(Log::LineType::Error, message + TQString(" (err=%1).").tqarg(usb_strerror()));
#else #else
log(Log::LineType::Error, message); log(Log::LineType::Error, message);
#endif #endif
@ -192,7 +192,7 @@ void Port::USB::tryToDetachDriver()
log(Log::DebugLevel::Extra, "find if there is already an installed driver"); log(Log::DebugLevel::Extra, "find if there is already an installed driver");
char dname[256] = ""; char dname[256] = "";
if ( usb_get_driver_np(_handle, _interface, dname, 255)<0 ) return; if ( usb_get_driver_np(_handle, _interface, dname, 255)<0 ) return;
log(Log::DebugLevel::Normal, TQString(" a driver \"%1\" is already installed...").arg(dname)); log(Log::DebugLevel::Normal, TQString(" a driver \"%1\" is already installed...").tqarg(dname));
# if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP) && LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP # if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP) && LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
usb_detach_kernel_driver_np(_handle, _interface); usb_detach_kernel_driver_np(_handle, _interface);
log(Log::DebugLevel::Normal, " try to detach it..."); log(Log::DebugLevel::Normal, " try to detach it...");
@ -208,10 +208,10 @@ bool Port::USB::internalOpen()
_device = findDevice(_vendorId, _productId); _device = findDevice(_vendorId, _productId);
if ( _device==0 ) { if ( _device==0 ) {
log(Log::LineType::Error, i18n("Could not find USB device (vendor=%1 product=%2).") log(Log::LineType::Error, i18n("Could not find USB device (vendor=%1 product=%2).")
.arg(toLabel(NumberBase::Hex, _vendorId, 4)).arg(toLabel(NumberBase::Hex, _productId, 4))); .tqarg(toLabel(NumberBase::Hex, _vendorId, 4)).tqarg(toLabel(NumberBase::Hex, _productId, 4)));
return false; return false;
} }
log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").arg(_device->filename).arg(_device->bus->dirname)); log(Log::DebugLevel::Extra, TQString("found USB device as \"%1\" on bus \"%2\"").tqarg(_device->filename).tqarg(_device->bus->dirname));
_handle = usb_open(_device); _handle = usb_open(_device);
if ( _handle==0 ) { if ( _handle==0 ) {
setSystemError(i18n("Error opening USB device.")); setSystemError(i18n("Error opening USB device."));
@ -239,11 +239,11 @@ bool Port::USB::internalOpen()
uint old = _config; uint old = _config;
i = 0; i = 0;
_config = _device->config[i].bConfigurationValue; _config = _device->config[i].bConfigurationValue;
log(Log::LineType::Warning, i18n("Configuration %1 not present: using %2").arg(old).arg(_config)); log(Log::LineType::Warning, i18n("Configuration %1 not present: using %2").tqarg(old).tqarg(_config));
} }
const usb_config_descriptor &configd = _device->config[i]; const usb_config_descriptor &configd = _device->config[i];
if ( usb_set_configuration(_handle, _config)<0 ) { if ( usb_set_configuration(_handle, _config)<0 ) {
setSystemError(i18n("Error setting USB configuration %1.").arg(_config)); setSystemError(i18n("Error setting USB configuration %1.").tqarg(_config));
return false; return false;
} }
for (i=0; i<configd.bNumInterfaces; i++) for (i=0; i<configd.bNumInterfaces; i++)
@ -252,15 +252,15 @@ bool Port::USB::internalOpen()
uint old = _interface; uint old = _interface;
i = 0; i = 0;
_interface = configd.interface[i].altsetting[0].bInterfaceNumber; _interface = configd.interface[i].altsetting[0].bInterfaceNumber;
log(Log::LineType::Warning, i18n("Interface %1 not present: using %2").arg(old).arg(_interface)); log(Log::LineType::Warning, i18n("Interface %1 not present: using %2").tqarg(old).tqarg(_interface));
} }
_private->_interface = &(configd.interface[i].altsetting[0]); _private->_interface = &(configd.interface[i].altsetting[0]);
if ( usb_claim_interface(_handle, _interface)<0 ) { if ( usb_claim_interface(_handle, _interface)<0 ) {
setSystemError(i18n("Could not claim USB interface %1").arg(_interface)); setSystemError(i18n("Could not claim USB interface %1").tqarg(_interface));
return false; return false;
} }
log(Log::DebugLevel::Max, TQString("alternate setting is %1").arg(_private->_interface->bAlternateSetting)); log(Log::DebugLevel::Max, TQString("alternate setting is %1").tqarg(_private->_interface->bAlternateSetting));
log(Log::DebugLevel::Max, TQString("USB bcdDevice: %1").arg(toHexLabel(_device->descriptor.bcdDevice, 4))); log(Log::DebugLevel::Max, TQString("USB bcdDevice: %1").tqarg(toHexLabel(_device->descriptor.bcdDevice, 4)));
return true; return true;
#else #else
log(Log::LineType::Error, i18n("USB support disabled")); 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); IODir dir = endpointDir(ep);
EndpointMode mode = endpointMode(ep); EndpointMode mode = endpointMode(ep);
log(Log::DebugLevel::LowLevel, TQString("write to endpoint %1 (%2 - %3) %4 chars: \"%5\"") log(Log::DebugLevel::LowLevel, TQString("write to endpoint %1 (%2 - %3) %4 chars: \"%5\"")
.arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(size).arg(toPrintable(data, size, PrintEscapeAll))); .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size).tqarg(toPrintable(data, size, PrintEscapeAll)));
Q_ASSERT( dir==Out ); Q_ASSERT( dir==Out );
TQTime time; TQTime time;
time.start(); time.start();
@ -356,8 +356,8 @@ bool Port::USB::write(uint ep, const char *data, uint size)
//qDebug("res: %i", res); //qDebug("res: %i", res);
if ( res==todo ) break; if ( res==todo ) break;
if ( uint(time.elapsed())>3000 ) { // 3 s if ( uint(time.elapsed())>3000 ) { // 3 s
if ( res<0 ) setSystemError(i18n("Error sending data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); 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).").arg(size-todo).arg(size)); else log(Log::LineType::Error, i18n("Timeout: only some data sent (%1/%2 bytes).").tqarg(size-todo).tqarg(size));
return false; return false;
} }
if ( res==0 ) log(Log::DebugLevel::Normal, i18n("Nothing sent: retrying...")); 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); IODir dir = endpointDir(ep);
EndpointMode mode = endpointMode(ep); EndpointMode mode = endpointMode(ep);
log(Log::DebugLevel::LowLevel, TQString("read from endpoint %1 (%2 - %3) %4 chars") log(Log::DebugLevel::LowLevel, TQString("read from endpoint %1 (%2 - %3) %4 chars")
.arg(toHexLabel(ep, 2)).arg(ENDPOINT_MODE_NAMES[mode]).arg(IO_DIR_NAMES[dir]).arg(size)); .tqarg(toHexLabel(ep, 2)).tqarg(ENDPOINT_MODE_NAMES[mode]).tqarg(IO_DIR_NAMES[dir]).tqarg(size));
Q_ASSERT( dir==In ); Q_ASSERT( dir==In );
TQTime time; TQTime time;
time.start(); time.start();
@ -390,8 +390,8 @@ bool Port::USB::read(uint ep, char *data, uint size, bool *poll)
//qDebug("res: %i", res); //qDebug("res: %i", res);
if ( res==todo ) break; if ( res==todo ) break;
if ( uint(time.elapsed())>3000 ) { // 3 s: seems to help icd2 in some case (?) if ( uint(time.elapsed())>3000 ) { // 3 s: seems to help icd2 in some case (?)
if ( res<0 ) setSystemError(i18n("Error receiving data (ep=%1 res=%2)").arg(toHexLabel(ep, 2)).arg(res)); 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).").arg(size-todo).arg(size)); else log(Log::LineType::Error, i18n("Timeout: only some data received (%1/%2 bytes).").tqarg(size-todo).tqarg(size));
return false; return false;
} }
if ( res==0 ) { if ( res==0 ) {

@ -11,7 +11,7 @@
// the original syntax file was created by Alain Gibaud // the original syntax file was created by Alain Gibaud
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
const char * const DIRECTIVES[] = { const char * const DIRECTIVES[] = {
"__badram", "__config", "__idlocs", "__maxram", "__badram", "__config", "__idlocs", "__maxram",

@ -12,16 +12,16 @@
# include <tqpainter.h> # include <tqpainter.h>
# include <kglobal.h> # include <kglobal.h>
TQColor Device::statusColor(Status status) TQColor Device::statusColor(tqStatus status)
{ {
switch (status.type()) { switch (status.type()) {
case Status::Future: return TQt::blue; case tqStatus::Future: return TQt::blue;
case Status::InProduction: return TQt::green; case tqStatus::InProduction: return TQt::green;
case Status::Mature: case tqStatus::Mature:
case Status::NotRecommended: return TQColor("orange"); case tqStatus::NotRecommended: return TQColor("orange");
case Status::EOL: return TQt::red; case tqStatus::EOL: return TQt::red;
case Status::Unknown: case tqStatus::Unknown:
case Status::Nb_Types: break; case tqStatus::Nb_Types: break;
} }
return TQt::black; return TQt::black;
} }
@ -232,8 +232,8 @@ TQString Device::htmlInfo(const Device::Data &data, const TQString &deviceHref,
if ( i!=0 ) s += ", "; if ( i!=0 ) s += ", ";
if ( deviceHref.isEmpty() ) s += data.alternatives()[i].upper(); if ( deviceHref.isEmpty() ) s += data.alternatives()[i].upper();
else { else {
TQString href = deviceHref.arg(data.alternatives()[i].upper()); TQString href = deviceHref.tqarg(data.alternatives()[i].upper());
s += TQString("<a href=\"%1\">%2</a>").arg(href).arg(data.alternatives()[i].upper()); s += TQString("<a href=\"%1\">%2</a>").tqarg(href).tqarg(data.alternatives()[i].upper());
} }
} }
doc += htmlTableRow(i18n("Alternatives"), s); doc += htmlTableRow(i18n("Alternatives"), s);
@ -247,7 +247,7 @@ TQString Device::htmlInfo(const Device::Data &data, const TQString &deviceHref,
TQString s; TQString s;
for (uint i=0; i<data.packages().count(); i++) for (uint i=0; i<data.packages().count(); i++)
for (uint k=0; k<data.packages()[i].types.count(); k++) for (uint k=0; k<data.packages()[i].types.count(); k++)
s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + TQString("[%1] ").arg(data.packages()[i].pins.count()); s += i18n(Package::TYPE_DATA[data.packages()[i].types[k]].label) + TQString("[%1] ").tqarg(data.packages()[i].pins.count());
doc += htmlTableRow(i18n("Packaging"), s); doc += htmlTableRow(i18n("Packaging"), s);
doc += "</table>"; doc += "</table>";
@ -260,7 +260,7 @@ TQString Device::htmlPinDiagrams(const Device::Data &data, const TQString &image
// pins // pins
const Package *package = 0; const Package *package = 0;
for (uint i=0; Package::TYPE_DATA[i].name; i++) { for (uint i=0; Package::TYPE_DATA[i].name; i++) {
if ( Package::TYPE_DATA[i].shape!=Package::Bar ) continue; if ( Package::TYPE_DATA[i].tqshape!=Package::Bar ) continue;
package = barPackage(Package::TYPE_DATA[i].name, data); package = barPackage(Package::TYPE_DATA[i].name, data);
if (package) break; if (package) break;
} }

@ -61,7 +61,7 @@ protected:
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#if !defined(NO_KDE) #if !defined(NO_KDE)
extern TQColor statusColor(Status status); extern TQColor statusColor(tqStatus status);
extern TQPixmap vddGraph(const TQString &xLabel, const TQString &yLabel, const TQValueVector<RangeBox> &boxes); extern TQPixmap vddGraph(const TQString &xLabel, const TQString &yLabel, const TQValueVector<RangeBox> &boxes);
extern const Package *barPackage(const char *name, const Data &data); extern const Package *barPackage(const char *name, const Data &data);
extern TQPixmap pinsGraph(const Package &package); extern TQPixmap pinsGraph(const Package &package);

@ -13,7 +13,7 @@
#include "register.h" #include "register.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
const Device::Status::Data Device::Status::DATA[Nb_Types] = { const Device::tqStatus::Data Device::tqStatus::DATA[Nb_Types] = {
{ "IP", I18N_NOOP("In Production") }, { "IP", I18N_NOOP("In Production") },
{ "Future", I18N_NOOP("Future Product") }, { "Future", I18N_NOOP("Future Product") },
{ "NR", I18N_NOOP("Not Recommended for New Design") }, { "NR", I18N_NOOP("Not Recommended for New Design") },

@ -19,9 +19,9 @@
namespace Device namespace Device
{ {
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
BEGIN_DECLARE_ENUM(Status) BEGIN_DECLARE_ENUM(tqStatus)
InProduction = 0, Future, NotRecommended, EOL, Unknown, Mature InProduction = 0, Future, NotRecommended, EOL, Unknown, Mature
END_DECLARE_ENUM_STD(Status) END_DECLARE_ENUM_STD(tqStatus)
BEGIN_DECLARE_ENUM(MemoryTechnology) BEGIN_DECLARE_ENUM(MemoryTechnology)
Flash = 0, Eprom, Rom, Romless Flash = 0, Eprom, Rom, Romless
@ -70,7 +70,7 @@ public:
enum { MAX_NB = 9 }; enum { MAX_NB = 9 };
struct TypeData { struct TypeData {
const char *name, *label; const char *name, *label;
Shape shape; Shape tqshape;
uint nbPins[MAX_NB]; uint nbPins[MAX_NB];
}; };
static const TypeData TYPE_DATA[]; static const TypeData TYPE_DATA[];
@ -121,7 +121,7 @@ public:
virtual TQString name() const { return _name; } virtual TQString name() const { return _name; }
virtual TQString fname(Special) const { return _name; } virtual TQString fname(Special) const { return _name; }
virtual TQString listViewGroup() const = 0; virtual TQString listViewGroup() const = 0;
Status status() const { return _status; } tqStatus status() const { return _status; }
const Documents &documents() const { return _documents; } const Documents &documents() const { return _documents; }
const TQStringList &alternatives() const { return _alternatives; } const TQStringList &alternatives() const { return _alternatives; }
MemoryTechnology memoryTechnology() const { return _memoryTechnology; } MemoryTechnology memoryTechnology() const { return _memoryTechnology; }
@ -141,7 +141,7 @@ protected:
TQString _name; TQString _name;
Documents _documents; Documents _documents;
TQStringList _alternatives; TQStringList _alternatives;
Status _status; tqStatus _status;
TQValueVector<FrequencyRange> _frequencyRanges; TQValueVector<FrequencyRange> _frequencyRanges;
MemoryTechnology _memoryTechnology; MemoryTechnology _memoryTechnology;
RegistersData *_registersData; RegistersData *_registersData;

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

@ -9,7 +9,7 @@
***************************************************************************/ ***************************************************************************/
#include "hex_buffer.h" #include "hex_buffer.h"
#include <textstream.h> #include <tqtextstream.h>
#include "devices/base/generic_device.h" #include "devices/base/generic_device.h"
@ -136,10 +136,10 @@ bool HexBuffer::fetchNextBlock(const_iterator& it, const const_iterator &end, in
TQString HexBuffer::ErrorData::message() const TQString HexBuffer::ErrorData::message() const
{ {
switch (type) { switch (type) {
case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").arg(line); case UnrecognizedFormat: return i18n("Unrecognized format (line %1).").tqarg(line);
case UnexpectedEOF: return i18n("Unexpected end-of-file."); case UnexpectedEOF: return i18n("Unexpected end-of-file.");
case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").arg(line); case UnexpectedEOL: return i18n("Unexpected end-of-line (line %1).").tqarg(line);
case WrongCRC: return i18n("CRC mismatch (line %1).").arg(line); case WrongCRC: return i18n("CRC mismatch (line %1).").tqarg(line);
} }
Q_ASSERT(false); Q_ASSERT(false);
return TQString(); return TQString();

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

@ -11,7 +11,7 @@
#include <tqlabel.h> #include <tqlabel.h>
#include <tqscrollbar.h> #include <tqscrollbar.h>
#include <layout.h> #include <tqlayout.h>
#include <tqgrid.h> #include <tqgrid.h>
#include <tqtimer.h> #include <tqtimer.h>
#include <tqpopupmenu.h> #include <tqpopupmenu.h>

@ -43,7 +43,7 @@ void Register::PortBitListViewItem::updateView()
else text += (pdata[_bit].drivenState==Device::IoHigh ? "1" : "0"); else text += (pdata[_bit].drivenState==Device::IoHigh ? "1" : "0");
} }
setText(2, text); setText(2, text);
repaint(); tqrepaint();
} }
void Register::PortBitListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) 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()) + ":"); if ( _data.type()!=Special ) setText(0, toHexLabel(_data.address(), nbCharsAddress()) + ":");
setText(1, label()); setText(1, label());
setText(2, text()); setText(2, text());
repaint(); tqrepaint();
for (uint i=0; i<_items.count(); i++) _items[i]->updateView(); 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; if ( isprint(c) ) s = c + s;
else s = "." + s; else s = "." + s;
} }
return TQString("%1 - %2 - \"%3\"").arg(toHexLabel(value, _data.nbChars())) return TQString("%1 - %2 - \"%3\"").tqarg(toHexLabel(value, _data.nbChars()))
.arg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).arg(s); .tqarg(toLabel(NumberBase::Bin, value, 4*_data.nbChars())).tqarg(s);
} }
TQWidget *Register::ListViewItem::editWidgetFactory(int col) const TQWidget *Register::ListViewItem::editWidgetFactory(int col) const
@ -176,7 +176,7 @@ void Register::LineEdit::updateText()
setText(_value.isInitialized() ? toLabel(_base, _value, _nbChars) : "--"); setText(_value.isInitialized() ? toLabel(_base, _value, _nbChars) : "--");
uint w = 2*frameWidth() + maxLabelWidth(_base, _nbChars, font()); uint w = 2*frameWidth() + maxLabelWidth(_base, _nbChars, font());
setFixedWidth(w+5); setFixedWidth(w+5);
setFixedHeight(minimumSizeHint().height()); setFixedHeight(tqminimumSizeHint().height());
} }
void Register::LineEdit::setValue(NumberBase base, BitValue value, uint nbChars) void Register::LineEdit::setValue(NumberBase base, BitValue value, uint nbChars)

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "mem24_hex_view.h" #include "mem24_hex_view.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <klocale.h> #include <klocale.h>

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "mem24_memory_editor.h" #include "mem24_memory_editor.h"
#include <layout.h> #include <tqlayout.h>
#include <klocale.h> #include <klocale.h>
#include <kpushbutton.h> #include <kpushbutton.h>

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

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

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

@ -7,7 +7,7 @@
* (at your option) any later version. * * (at your option) any later version. *
***************************************************************************/ ***************************************************************************/
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
#include "xml_to_data/device_xml_to_data.h" #include "xml_to_data/device_xml_to_data.h"
#include "common/common/misc.h" #include "common/common/misc.h"
@ -49,7 +49,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const
if ( !pinLabels.contains("VSS") ) qFatal("No VSS pin specified"); if ( !pinLabels.contains("VSS") ) qFatal("No VSS pin specified");
TQMap<TQString, uint>::const_iterator it; TQMap<TQString, uint>::const_iterator it;
for (it=pinLabels.begin(); it!=pinLabels.end(); ++it) for (it=pinLabels.begin(); it!=pinLabels.end(); ++it)
if ( it.data()!=1 ) qFatal(TQString("Duplicated pin %1").arg(it.key())); if ( it.data()!=1 ) qFatal(TQString("Duplicated pin %1").tqarg(it.key()));
} }
}; // class }; // class

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

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

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

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

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "pic_config_editor.h" #include "pic_config_editor.h"
#include <layout.h> #include <tqlayout.h>
#include <tqvgroupbox.h> #include <tqvgroupbox.h>
#include <tqapplication.h> #include <tqapplication.h>

@ -10,7 +10,7 @@
#include "pic_config_word_editor.h" #include "pic_config_word_editor.h"
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <klocale.h> #include <klocale.h>
@ -114,7 +114,7 @@ Pic::ConfigWordEditor::ConfigWordEditor(Memory &memory, uint ci, bool withWordEd
connect(_mdb, TQT_SIGNAL(modified()), TQT_SLOT(updateDisplay())); connect(_mdb, TQT_SIGNAL(modified()), TQT_SLOT(updateDisplay()));
hbox->addWidget(_mdb); hbox->addWidget(_mdb);
KPushButton *button = new KPushButton(i18n("Details..."), this); KPushButton *button = new KPushButton(i18n("Details..."), this);
button->setFixedHeight(button->sizeHint().height()); button->setFixedHeight(button->tqsizeHint().height());
connect(button, TQT_SIGNAL(clicked()), TQT_SLOT(showDialog())); connect(button, TQT_SIGNAL(clicked()), TQT_SLOT(showDialog()));
hbox->addWidget(button); hbox->addWidget(button);
hbox->addStretch(1); hbox->addStretch(1);

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

@ -9,7 +9,7 @@
***************************************************************************/ ***************************************************************************/
#include "pic_hex_view.h" #include "pic_hex_view.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <klocale.h> #include <klocale.h>

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

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

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "pic_register_view.h" #include "pic_register_view.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <tqcheckbox.h> #include <tqcheckbox.h>
@ -46,20 +46,20 @@ Pic::BankWidget::BankWidget(uint i, TQWidget *parent)
if ( (i/2)==0 ) { if ( (i/2)==0 ) {
TQString title = ((i%2)==0 ? i18n("Access Bank (low)") : i18n("Access Bank (high)")); TQString title = ((i%2)==0 ? i18n("Access Bank (low)") : i18n("Access Bank (high)"));
TQLabel *label = new TQLabel(title, this); TQLabel *label = new TQLabel(title, this);
label->setAlignment(AlignCenter); label->tqsetAlignment(AlignCenter);
top->addMultiCellWidget(label, row,row, 0,6, AlignHCenter); top->addMultiCellWidget(label, row,row, 0,6, AlignHCenter);
} else { } else {
_bankCombo = new TQComboBox(this); _bankCombo = new TQComboBox(this);
for (uint k=1; k<2*rdata.nbBanks-1; k++) { for (uint k=1; k<2*rdata.nbBanks-1; k++) {
_bankCombo->insertItem((k%2)==0 ? i18n("Bank %1 (low)").arg(k/2) : i18n("Bank %1 (high)").arg(k/2)); _bankCombo->insertItem((k%2)==0 ? i18n("Bank %1 (low)").tqarg(k/2) : i18n("Bank %1 (high)").tqarg(k/2));
} }
if ( _bindex==3 ) _bankCombo->setCurrentItem(1); if ( _bindex==3 ) _bankCombo->setCurrentItem(1);
connect(_bankCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(bankChanged())); connect(_bankCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(bankChanged()));
top->addMultiCellWidget(_bankCombo, row,row, 0,6, AlignHCenter); top->addMultiCellWidget(_bankCombo, row,row, 0,6, AlignHCenter);
} }
} else { } else {
TQLabel *label = new TQLabel(i18n("Bank %1").arg(i), this); TQLabel *label = new TQLabel(i18n("Bank %1").tqarg(i), this);
label->setAlignment(AlignCenter); label->tqsetAlignment(AlignCenter);
top->addMultiCellWidget(label, row,row, 0,6, AlignHCenter); top->addMultiCellWidget(label, row,row, 0,6, AlignHCenter);
} }
row++; row++;

@ -27,14 +27,14 @@ TQString Pic::Group::informationHtml(const Device::Data &data) const
TQString s = htmlTableRow(i18n("Memory Type"), data.memoryTechnology().label()); TQString s = htmlTableRow(i18n("Memory Type"), data.memoryTechnology().label());
if ( pdata.isPresent(MemoryRangeType::Code) ) { if ( pdata.isPresent(MemoryRangeType::Code) ) {
uint nbw = pdata.nbWords(MemoryRangeType::Code); uint nbw = pdata.nbWords(MemoryRangeType::Code);
TQString tmp = i18n("%1 words").arg(formatNumber(nbw)); TQString tmp = i18n("%1 words").tqarg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").arg(pdata.nbBitsWord(MemoryRangeType::Code)); tmp += i18n(" (%2 bits)").tqarg(pdata.nbBitsWord(MemoryRangeType::Code));
s += htmlTableRow(MemoryRangeType(MemoryRangeType::Code).label(), tmp); s += htmlTableRow(MemoryRangeType(MemoryRangeType::Code).label(), tmp);
} }
if ( pdata.isPresent(MemoryRangeType::Eeprom) ) { if ( pdata.isPresent(MemoryRangeType::Eeprom) ) {
uint nbw = pdata.nbWords(MemoryRangeType::Eeprom); uint nbw = pdata.nbWords(MemoryRangeType::Eeprom);
TQString tmp = i18n("%1 bytes").arg(formatNumber(nbw)); TQString tmp = i18n("%1 bytes").tqarg(formatNumber(nbw));
tmp += i18n(" (%2 bits)").arg(pdata.nbBitsWord(MemoryRangeType::Eeprom)); tmp += i18n(" (%2 bits)").tqarg(pdata.nbBitsWord(MemoryRangeType::Eeprom));
if ( !(pdata.range(MemoryRangeType::Eeprom).properties & Programmable) ) tmp += i18n(" (not programmable)"); if ( !(pdata.range(MemoryRangeType::Eeprom).properties & Programmable) ) tmp += i18n(" (not programmable)");
s += htmlTableRow(MemoryRangeType(MemoryRangeType::Eeprom).label(), tmp); 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] ) { if ( !(result & ValueTooLarge) && _ranges[type][wOffset].maskWith(mask)!=_ranges[type][wOffset] ) {
result |= ValueTooLarge; result |= ValueTooLarge;
warnings += i18n("At least one word (at offset %1) is larger (%2) than the corresponding mask (%3).") warnings += i18n("At least one word (at offset %1) is larger (%2) than the corresponding mask (%3).")
.arg(toHexLabel(offset, 8)).arg(toHexLabel(_ranges[type][wOffset], 8)).arg(toHexLabel(mask, 8)); .tqarg(toHexLabel(offset, 8)).tqarg(toHexLabel(_ranges[type][wOffset], 8)).tqarg(toHexLabel(mask, 8));
} }
_ranges[type][wOffset] = _ranges[type][wOffset].maskWith(mask); _ranges[type][wOffset] = _ranges[type][wOffset].maskWith(mask);
} }

@ -20,7 +20,7 @@ Register::TypeData Debugger::PicBase::registerTypeData(const TQString &name) con
return Register::TypeData(rdata.sfrs[name].address, rdata.nbChars()); return Register::TypeData(rdata.sfrs[name].address, rdata.nbChars());
} }
bool Debugger::PicBase::updatePortStatus(uint index, TQMap<uint, Device::PortBitData> &bits) bool Debugger::PicBase::updatePorttqStatus(uint index, TQMap<uint, Device::PortBitData> &bits)
{ {
const Pic::RegistersData &rdata = device()->registersData(); const Pic::RegistersData &rdata = device()->registersData();
BitValue tris; BitValue tris;
@ -65,7 +65,7 @@ const Debugger::PicBase &Debugger::PicSpecific::base() const
return static_cast<PicBase &>(_base); return static_cast<PicBase &>(_base);
} }
bool Debugger::PicSpecific::updateStatus() bool Debugger::PicSpecific::updatetqStatus()
{ {
if ( !Debugger::manager->readRegister(base().pcTypeData()) ) return false; if ( !Debugger::manager->readRegister(base().pcTypeData()) ) return false;
if ( !Debugger::manager->readRegister(base().registerTypeData("STATUS")) ) return false; if ( !Debugger::manager->readRegister(base().registerTypeData("STATUS")) ) return false;
@ -86,15 +86,15 @@ TQString Debugger::P16FSpecific::statusString() const
uint bank = (status.bit(5) ? 1 : 0) + (status.bit(6) ? 2 : 0); uint bank = (status.bit(5) ? 1 : 0) + (status.bit(6) ? 2 : 0);
BitValue wreg = Register::list().value(wregTypeData()); BitValue wreg = Register::list().value(wregTypeData());
return TQString("W:%1 %2 %3 %4 PC:%5 Bank:%6") return TQString("W:%1 %2 %3 %4 PC:%5 Bank:%6")
.arg(toHexLabel(wreg, rdata.nbChars())).arg(status.bit(2) ? "Z" : "z") .tqarg(toHexLabel(wreg, rdata.nbChars())).tqarg(status.bit(2) ? "Z" : "z")
.arg(status.bit(1) ? "DC" : "dc").arg(status.bit(0) ? "C" : "c") .tqarg(status.bit(1) ? "DC" : "dc").tqarg(status.bit(0) ? "C" : "c")
.arg(toHexLabel(_base.pc(), device().nbCharsAddress())).arg(bank); .tqarg(toHexLabel(_base.pc(), device().nbCharsAddress())).tqarg(bank);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool Debugger::P18FSpecific::updateStatus() bool Debugger::P18FSpecific::updatetqStatus()
{ {
if ( !PicSpecific::updateStatus() ) return false; if ( !PicSpecific::updatetqStatus() ) return false;
if ( !Debugger::manager->readRegister(base().registerTypeData("BSR")) ) return false; if ( !Debugger::manager->readRegister(base().registerTypeData("BSR")) ) return false;
return true; return true;
} }
@ -111,8 +111,8 @@ TQString Debugger::P18FSpecific::statusString() const
BitValue bsr = Register::list().value(base().registerTypeData("BSR")); BitValue bsr = Register::list().value(base().registerTypeData("BSR"));
BitValue wreg = Register::list().value(wregTypeData()); BitValue wreg = Register::list().value(wregTypeData());
return TQString("W:%1 %2 %3 %4 %5 %6 PC:%7 Bank:%8") return TQString("W:%1 %2 %3 %4 %5 %6 PC:%7 Bank:%8")
.arg(toHexLabel(wreg, rdata.nbChars())).arg(status.bit(4) ? "N" : "n") .tqarg(toHexLabel(wreg, rdata.nbChars())).tqarg(status.bit(4) ? "N" : "n")
.arg(status.bit(3) ? "OV" : "ov").arg(status.bit(2) ? "Z" : "z") .tqarg(status.bit(3) ? "OV" : "ov").tqarg(status.bit(2) ? "Z" : "z")
.arg(status.bit(1) ? "DC" : "dc").arg(status.bit(0) ? "C" : "c") .tqarg(status.bit(1) ? "DC" : "dc").tqarg(status.bit(0) ? "C" : "c")
.arg(toHexLabel(base().pc(), device().nbCharsAddress())).arg(toLabel(bsr)); .tqarg(toHexLabel(base().pc(), device().nbCharsAddress())).tqarg(toLabel(bsr));
} }

@ -25,7 +25,7 @@ public:
const Pic::Data &device() const { return static_cast<const Pic::Data &>(*_base.device()); } const Pic::Data &device() const { return static_cast<const Pic::Data &>(*_base.device()); }
PicBase &base(); PicBase &base();
const PicBase &base() const; const PicBase &base() const;
virtual bool updateStatus(); virtual bool updatetqStatus();
virtual Register::TypeData wregTypeData() const = 0; virtual Register::TypeData wregTypeData() const = 0;
}; };
@ -44,7 +44,7 @@ class P18FSpecific : public PicSpecific
public: public:
P18FSpecific(Debugger::Base &base) : PicSpecific(base) {} P18FSpecific(Debugger::Base &base) : PicSpecific(base) {}
virtual TQString statusString() const; virtual TQString statusString() const;
virtual bool updateStatus(); virtual bool updatetqStatus();
virtual Register::TypeData wregTypeData() const; virtual Register::TypeData wregTypeData() const;
}; };
@ -57,7 +57,7 @@ public:
const PicSpecific *deviceSpecific() const { return static_cast<const PicSpecific *>(_deviceSpecific); } const PicSpecific *deviceSpecific() const { return static_cast<const PicSpecific *>(_deviceSpecific); }
const Pic::Data *device() const { return static_cast<const Pic::Data *>(Debugger::Base::device()); } const Pic::Data *device() const { return static_cast<const Pic::Data *>(Debugger::Base::device()); }
Register::TypeData registerTypeData(const TQString &name) const; Register::TypeData registerTypeData(const TQString &name) const;
virtual bool updatePortStatus(uint index, TQMap<uint, Device::PortBitData> &bits); virtual bool updatePorttqStatus(uint index, TQMap<uint, Device::PortBitData> &bits);
}; };
} // namespace } // namespace

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

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

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

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "breakpoint_view.h" #include "breakpoint_view.h"
#include <layout.h> #include <tqlayout.h>
#include <klocale.h> #include <klocale.h>
#include <tqpopupmenu.h> #include <tqpopupmenu.h>

@ -10,7 +10,7 @@
#include "config_center.h" #include "config_center.h"
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <tqtooltip.h> #include <tqtooltip.h>
#include <tqgroupbox.h> #include <tqgroupbox.h>
#include <tqtabwidget.h> #include <tqtabwidget.h>

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "config_gen.h" #include "config_gen.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <klocale.h> #include <klocale.h>

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "console.h" #include "console.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqdir.h> #include <tqdir.h>
#include <klibloader.h> #include <klibloader.h>

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

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "device_gui.h" #include "device_gui.h"
#include <layout.h> #include <tqlayout.h>
#include <tqpainter.h> #include <tqpainter.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <tqlabel.h> #include <tqlabel.h>
@ -147,7 +147,7 @@ DeviceChooser::Dialog::Dialog(const TQString &device, Type type, TQWidget *paren
shbox = new TQHBoxLayout(vbox); shbox = new TQHBoxLayout(vbox);
// status filter // status filter
_statusCombo = new EnumComboBox<Device::Status>(i18n("<Status>"), "status", frame); _statusCombo = new EnumComboBox<Device::tqStatus>(i18n("<Status>"), "status", frame);
connect(_statusCombo->combo(), TQT_SIGNAL(activated(int)), TQT_SLOT(updateList())); connect(_statusCombo->combo(), TQT_SIGNAL(activated(int)), TQT_SLOT(updateList()));
shbox->addWidget(_statusCombo->combo()); shbox->addWidget(_statusCombo->combo());
@ -260,12 +260,12 @@ void DeviceChooser::Dialog::updateList(const TQString &device)
TQListViewItem *selected = 0; TQListViewItem *selected = 0;
const Programmer::Group *pgroup = programmerGroup(); const Programmer::Group *pgroup = programmerGroup();
if ( pgroup && pgroup->supportedDevices().isEmpty() && pgroup->isSoftware() ) { if ( pgroup && pgroup->supportedDevices().isEmpty() && pgroup->isSoftware() ) {
_deviceView->setText(i18n("Could not detect supported devices for \"%1\". Please check installation.").arg(pgroup->label())); _deviceView->setText(i18n("Could not detect supported devices for \"%1\". Please check installation.").tqarg(pgroup->label()));
return; return;
} }
const Tool::Group *tgroup = toolGroup(); const Tool::Group *tgroup = toolGroup();
if ( tgroup && tgroup->supportedDevices().isEmpty() ) { if ( tgroup && tgroup->supportedDevices().isEmpty() ) {
_deviceView->setText(i18n("Could not detect supported devices for toolchain \"%1\". Please check installation.").arg(tgroup->label())); _deviceView->setText(i18n("Could not detect supported devices for toolchain \"%1\". Please check installation.").tqarg(tgroup->label()));
return; return;
} }
for (int i=list.count()-1; i>=0; i--) { for (int i=list.count()-1; i>=0; i--) {
@ -274,7 +274,7 @@ void DeviceChooser::Dialog::updateList(const TQString &device)
const Device::Data *data = Device::lister().data(list[i]); const Device::Data *data = Device::lister().data(list[i]);
Q_ASSERT(data); Q_ASSERT(data);
if ( _memoryCombo->value()!=Device::MemoryTechnology::Nb_Types && data->memoryTechnology()!=_memoryCombo->value() ) continue; if ( _memoryCombo->value()!=Device::MemoryTechnology::Nb_Types && data->memoryTechnology()!=_memoryCombo->value() ) continue;
if ( _statusCombo->value()!=Device::Status::Nb_Types && data->status()!=_statusCombo->value() ) continue; if ( _statusCombo->value()!=Device::tqStatus::Nb_Types && data->status()!=_statusCombo->value() ) continue;
if ( _featureCombo->value()!=Pic::Feature::Nb_Types ) { if ( _featureCombo->value()!=Pic::Feature::Nb_Types ) {
if ( data->group().name()!="pic" ) continue; if ( data->group().name()!="pic" ) continue;
if ( !static_cast<const Pic::Data *>(data)->hasFeature(_featureCombo->value()) ) continue; if ( !static_cast<const Pic::Data *>(data)->hasFeature(_featureCombo->value()) ) continue;

@ -10,7 +10,7 @@
#define DEVICE_GUI_H #define DEVICE_GUI_H
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <layout.h> #include <tqlayout.h>
#include <tqcombobox.h> #include <tqcombobox.h>
class TQListViewItem; class TQListViewItem;
class TQCheckBox; class TQCheckBox;
@ -105,7 +105,7 @@ private:
KeyComboBox<TQString> *_programmerCombo, *_toolCombo; KeyComboBox<TQString> *_programmerCombo, *_toolCombo;
EnumComboBox<ListType> *_listTypeCombo; EnumComboBox<ListType> *_listTypeCombo;
EnumComboBox<Device::MemoryTechnology> *_memoryCombo; EnumComboBox<Device::MemoryTechnology> *_memoryCombo;
EnumComboBox<Device::Status> *_statusCombo; EnumComboBox<Device::tqStatus> *_statusCombo;
EnumComboBox<Pic::Feature> *_featureCombo; EnumComboBox<Pic::Feature> *_featureCombo;
KListView *_listView; KListView *_listView;
View *_deviceView; View *_deviceView;

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

@ -10,7 +10,7 @@
#define EDITOR_H #define EDITOR_H
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <tqvaluevector.h> #include <tqvaluevector.h>
#include "common/common/qflags.h" #include "common/common/qflags.h"
#include <kstdaction.h> #include <kstdaction.h>

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

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

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

@ -26,12 +26,12 @@
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <layout.h> #include <tqlayout.h>
#include <tqtoolbutton.h> #include <tqtoolbutton.h>
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <tqpopupmenu.h> #include <tqpopupmenu.h>
#include <textedit.h> #include <tqtextedit.h>
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include <tqhttp.h> #include <tqhttp.h>
@ -55,7 +55,7 @@ LikeBack::LikeBack(Button buttons)
: TQWidget( 0, "LikeBack", TQt::WX11BypassWM | TQt::WStyle_NoBorder | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop | TQt::WStyle_NoBorder | TQt::TQt::WGroupLeader) : TQWidget( 0, "LikeBack", TQt::WX11BypassWM | TQt::WStyle_NoBorder | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop | TQt::WStyle_NoBorder | TQt::TQt::WGroupLeader)
, m_buttons(buttons) , m_buttons(buttons)
{ {
TQHBoxLayout *layout = new TQHBoxLayout(this); TQHBoxLayout *tqlayout = new TQHBoxLayout(this);
TQIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small); TQIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small);
TQIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small); TQIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small);
@ -67,21 +67,21 @@ LikeBack::LikeBack(Button buttons)
m_likeButton->setTextLabel(i18n("I Like...")); m_likeButton->setTextLabel(i18n("I Like..."));
m_likeButton->setAutoRaise(true); m_likeButton->setAutoRaise(true);
connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iLike()) ); connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iLike()) );
layout->add(m_likeButton); tqlayout->add(m_likeButton);
TQToolButton *m_dislikeButton = new TQToolButton(this, "idonotlike"); TQToolButton *m_dislikeButton = new TQToolButton(this, "idonotlike");
m_dislikeButton->setIconSet(dislikeIconSet); m_dislikeButton->setIconSet(dislikeIconSet);
m_dislikeButton->setTextLabel(i18n("I Do not Like...")); m_dislikeButton->setTextLabel(i18n("I Do not Like..."));
m_dislikeButton->setAutoRaise(true); m_dislikeButton->setAutoRaise(true);
connect( m_dislikeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iDoNotLike()) ); connect( m_dislikeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iDoNotLike()) );
layout->add(m_dislikeButton); tqlayout->add(m_dislikeButton);
TQToolButton *m_bugButton = new TQToolButton(this, "ifoundabug"); TQToolButton *m_bugButton = new TQToolButton(this, "ifoundabug");
m_bugButton->setIconSet(bugIconSet); m_bugButton->setIconSet(bugIconSet);
m_bugButton->setTextLabel(i18n("I Found a Bug...")); m_bugButton->setTextLabel(i18n("I Found a Bug..."));
m_bugButton->setAutoRaise(true); m_bugButton->setAutoRaise(true);
connect( m_bugButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iFoundABug()) ); connect( m_bugButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(iFoundABug()) );
layout->add(m_bugButton); tqlayout->add(m_bugButton);
m_configureButton = new TQToolButton(this, "configure"); m_configureButton = new TQToolButton(this, "configure");
TQIconSet helpIconSet = kapp->iconLoader()->loadIconSet("help", KIcon::Small); TQIconSet helpIconSet = kapp->iconLoader()->loadIconSet("help", KIcon::Small);
@ -89,7 +89,7 @@ LikeBack::LikeBack(Button buttons)
m_configureButton->setTextLabel(i18n("Configure...")); m_configureButton->setTextLabel(i18n("Configure..."));
m_configureButton->setAutoRaise(true); m_configureButton->setAutoRaise(true);
connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(configure()) ); connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(configure()) );
layout->add(m_configureButton); tqlayout->add(m_configureButton);
TQPopupMenu *configureMenu = new TQPopupMenu(this); TQPopupMenu *configureMenu = new TQPopupMenu(this);
configureMenu->insertItem(helpIconSet, i18n("What's &This?"), this , TQT_SLOT(showWhatsThisMessage()) ); configureMenu->insertItem(helpIconSet, i18n("What's &This?"), this , TQT_SLOT(showWhatsThisMessage()) );
@ -110,7 +110,7 @@ LikeBack::LikeBack(Button buttons)
// KMessageBox::saveDontShowAgainContinue(messageShown); // KMessageBox::saveDontShowAgainContinue(messageShown);
// } // }
resize(sizeHint()); resize(tqsizeHint());
connect( &m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoMove()) ); connect( &m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoMove()) );
m_timer.start(10); m_timer.start(10);
@ -171,7 +171,7 @@ void LikeBack::showInformationMessage()
TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon); TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon);
TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon); TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon);
KMessageBox::information(0, KMessageBox::information(0,
"<p><b>" + i18n("This is a quick feedback system for %1.").arg(s_about->programName()) + "</b></p>" "<p><b>" + i18n("This is a quick feedback system for %1.").tqarg(s_about->programName()) + "</b></p>"
"<p>" + i18n("To help us improve it, your comments are important.") + "</p>" "<p>" + i18n("To help us improve it, your comments are important.") + "</p>"
"<p>" + i18n("Each time you have a great or frustrating experience, " "<p>" + i18n("Each time you have a great or frustrating experience, "
"please click the appropriate hand below the window title-bar, " "please click the appropriate hand below the window title-bar, "
@ -452,7 +452,7 @@ void LikeBack::init(bool isDevelopmentVersion, Button buttons)
if (m_process) if (m_process)
return; return;
m_process = new KProcess(); m_process = new KProcess();
*m_process << TQString::fromLatin1("kcmshell") << TQString::fromLatin1("kcm_useraccount"); *m_process << TQString::tqfromLatin1("kcmshell") << TQString::tqfromLatin1("kcm_useraccount");
connect( m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(endFetchingEmailFrom()) ); connect( m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(endFetchingEmailFrom()) );
if (!m_process->start()) { if (!m_process->start()) {
kdDebug() << "Couldn't start kcmshell.." << endl; kdDebug() << "Couldn't start kcmshell.." << endl;
@ -473,23 +473,23 @@ void LikeBack::endFetchingEmailFrom()
// m_configureEmail->setEnabled(true); // m_configureEmail->setEnabled(true);
// ### KDE4: why oh why is KEmailSettings in kio? // ### KDE4: why oh why is KEmailSettings in kio?
KConfig emailConf( TQString::fromLatin1("emaildefaults") ); KConfig emailConf( TQString::tqfromLatin1("emaildefaults") );
// find out the default profile // find out the default profile
emailConf.setGroup(TQString::fromLatin1("Defaults")); emailConf.setGroup(TQString::tqfromLatin1("Defaults"));
TQString profile = TQString::fromLatin1("PROFILE_"); TQString profile = TQString::tqfromLatin1("PROFILE_");
profile += emailConf.readEntry(TQString::fromLatin1("Profile"), TQString::fromLatin1("Default")); profile += emailConf.readEntry(TQString::tqfromLatin1("Profile"), TQString::tqfromLatin1("Default"));
emailConf.setGroup(profile); emailConf.setGroup(profile);
TQString fromaddr = emailConf.readEntry(TQString::fromLatin1("EmailAddress")); TQString fromaddr = emailConf.readEntry(TQString::tqfromLatin1("EmailAddress"));
if (fromaddr.isEmpty()) { if (fromaddr.isEmpty()) {
struct passwd *p; struct passwd *p;
p = getpwuid(getuid()); p = getpwuid(getuid());
m_fetchedEmail = TQString::fromLatin1(p->pw_name); m_fetchedEmail = TQString::tqfromLatin1(p->pw_name);
} else { } else {
TQString name = emailConf.readEntry(TQString::fromLatin1("FullName")); TQString name = emailConf.readEntry(TQString::tqfromLatin1("FullName"));
if (!name.isEmpty()) if (!name.isEmpty())
m_fetchedEmail = /*name + TQString::fromLatin1(" <") +*/ fromaddr /*+ TQString::fromLatin1(">")*/; m_fetchedEmail = /*name + TQString::tqfromLatin1(" <") +*/ fromaddr /*+ TQString::tqfromLatin1(">")*/;
} }
// m_from->setText( fromaddr ); // m_from->setText( fromaddr );
} }
@ -580,7 +580,7 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, TQString windowName, TQS
m_comment = new TQTextEdit(coloredWidget); m_comment = new TQTextEdit(coloredWidget);
TQIconSet sendIconSet = kapp->iconLoader()->loadIconSet("mail_send", KIcon::Toolbar); TQIconSet sendIconSet = kapp->iconLoader()->loadIconSet("mail_send", KIcon::Toolbar);
m_sendButton = new TQPushButton(sendIconSet, i18n("Send"), coloredWidget); m_sendButton = new TQPushButton(sendIconSet, i18n("Send"), coloredWidget);
m_sendButton->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding); m_sendButton->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding);
m_sendButton->setEnabled(false); m_sendButton->setEnabled(false);
connect( m_sendButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(send()) ); connect( m_sendButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(send()) );
connect( m_comment, TQT_SIGNAL(textChanged()), this, TQT_SLOT(commentChanged()) ); connect( m_comment, TQT_SIGNAL(textChanged()), this, TQT_SLOT(commentChanged()) );
@ -607,7 +607,7 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, TQString windowName, TQS
resize(kapp->desktop()->width() / 2, kapp->desktop()->height() / 3); resize(kapp->desktop()->width() / 2, kapp->desktop()->height() / 3);
setCaption(kapp->makeStdCaption(i18n("Send a Comment"))); setCaption(kapp->makeStdCaption(i18n("Send a Comment")));
// setMinimumSize(mainLayout->sizeHint()); // FIXME: Doesn't work! // setMinimumSize(mainLayout->tqsizeHint()); // FIXME: Doesn't work!
} }
LikeBackDialog::~LikeBackDialog() LikeBackDialog::~LikeBackDialog()

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

@ -9,7 +9,7 @@
#ifndef LOG_VIEW_H #ifndef LOG_VIEW_H
#define LOG_VIEW_H #define LOG_VIEW_H
#include <textedit.h> #include <tqtextedit.h>
#include "common/global/log.h" #include "common/global/log.h"
namespace Log namespace Log

@ -14,7 +14,7 @@
#include <tqcheckbox.h> #include <tqcheckbox.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <kcombobox.h> #include <kcombobox.h>
#include "common/global/purl.h" #include "common/global/purl.h"

@ -123,7 +123,7 @@ bool DisassemblyEditor::open(const PURL::Url &url)
Device::Memory *memory = 0; Device::Memory *memory = 0;
if ( _editor==0 ) { if ( _editor==0 ) {
log(Log::LineType::Information, i18n("Disassembling hex file: %1").arg(_source.pretty())); log(Log::LineType::Information, i18n("Disassembling hex file: %1").tqarg(_source.pretty()));
PURL::File file(_source, Main::compileLog()); PURL::File file(_source, Main::compileLog());
if ( !file.openForRead() ) return false; if ( !file.openForRead() ) return false;
memory = _device.group().createMemory(_device); 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.fileType()==PURL::Project ) return XmlDataFile::load(error);
if ( !_url.exists() ) { if ( !_url.exists() ) {
error = i18n("Project file %1 does not exist.").arg(_url.pretty()); error = i18n("Project file %1 does not exist.").tqarg(_url.pretty());
return false; return false;
} }
PURL::Url tmp = _url; PURL::Url tmp = _url;

@ -10,7 +10,7 @@
#include "project_editor.h" #include "project_editor.h"
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <klocale.h> #include <klocale.h>
#include "project.h" #include "project.h"

@ -17,7 +17,7 @@
#ifndef PROJECT_EDITOR_H #ifndef PROJECT_EDITOR_H
#define PROJECT_EDITOR_H #define PROJECT_EDITOR_H
#include <textedit.h> #include <tqtextedit.h>
#include <tqlineedit.h> #include <tqlineedit.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <tqwidgetstack.h> #include <tqwidgetstack.h>

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

@ -36,7 +36,7 @@ FileListItem::FileListItem(KListView *view)
void FileListItem::toggle() void FileListItem::toggle()
{ {
_copy = !_copy; _copy = !_copy;
repaint(); tqrepaint();
} }
PURL::FileGroup FileListItem::fileGroup() const PURL::FileGroup FileListItem::fileGroup() const
@ -76,7 +76,7 @@ FileListBox::FileListBox(TQWidget *parent)
_listView->header()->setResizeEnabled(false); _listView->header()->setResizeEnabled(false);
_listView->header()->setMovingEnabled(false); _listView->header()->setMovingEnabled(false);
_listView->setColumnText(0, i18n("Copy")); _listView->setColumnText(0, i18n("Copy"));
int spacing = tqstyle().pixelMetric(TQStyle::PM_HeaderMargin); int spacing = tqstyle().tqpixelMetric(TQStyle::PM_HeaderMargin);
TQFontMetrics fm(font()); TQFontMetrics fm(font());
_listView->header()->resizeSection(0, fm.width(i18n("Copy")) + 2*spacing); // hack _listView->header()->resizeSection(0, fm.width(i18n("Copy")) + 2*spacing); // hack
_listView->setColumnText(1, i18n("Filename")); _listView->setColumnText(1, i18n("Filename"));
@ -184,7 +184,7 @@ void ProjectWizard::next()
return; return;
} }
} else if ( url().exists() ) { } else if ( url().exists() ) {
if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").arg(url().filename())) ) return; if ( !MessageBox::askContinue(i18n("Project \"%1\"already exists. Overwrite it?").tqarg(url().filename())) ) return;
} }
if ( !toolchain().check(device(), &Main::compileLog()) ) return; if ( !toolchain().check(device(), &Main::compileLog()) ) return;
_files->setDirectory(_directory->directory()); _files->setDirectory(_directory->directory());
@ -203,7 +203,7 @@ void ProjectWizard::next()
for (uint i=0; i<_files->count(); i++) for (uint i=0; i<_files->count(); i++)
if ( static_cast<const FileListItem *>(_files->item(i))->fileGroup()==PURL::Source ) nb++; if ( static_cast<const FileListItem *>(_files->item(i))->fileGroup()==PURL::Source ) nb++;
if ( toolchain().compileType()==Tool::SingleFile && nb>1 ) { 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? ").arg(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? ").tqarg(nb)) ) return;
} }
} }
KWizard::next(); KWizard::next();
@ -243,7 +243,7 @@ void ProjectWizard::done(int r)
} }
Log::StringView sview; Log::StringView sview;
if ( turl.write(text, sview) ) files += turl; if ( turl.write(text, sview) ) files += turl;
else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").arg(turl.pretty()) + sview.string(), Log::Show); else MessageBox::detailedSorry(i18n("Error creating template file."), i18n("File: %1\n").tqarg(turl.pretty()) + sview.string(), Log::Show);
_project->setOpenedFiles(files); _project->setOpenedFiles(files);
} else { } else {
Log::StringView sview; Log::StringView sview;

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "register_view.h" #include "register_view.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <tqcheckbox.h> #include <tqcheckbox.h>

@ -10,8 +10,8 @@
#include "text_editor.h" #include "text_editor.h"
#include <tqfile.h> #include <tqfile.h>
#include <textedit.h> #include <tqtextedit.h>
#include <layout.h> #include <tqlayout.h>
#include <klibloader.h> #include <klibloader.h>
#include <kpopupmenu.h> #include <kpopupmenu.h>
@ -96,7 +96,7 @@ void TextEditor::addView()
connect(v, TQT_SIGNAL(gotFocus(Kate::View *)), TQT_SLOT(gotFocus(Kate::View *))); connect(v, TQT_SIGNAL(gotFocus(Kate::View *)), TQT_SLOT(gotFocus(Kate::View *)));
connect(v, TQT_SIGNAL(cursorPositionChanged()), TQT_SLOT(statusChanged())); connect(v, TQT_SIGNAL(cursorPositionChanged()), TQT_SLOT(statusChanged()));
connect(v, TQT_SIGNAL(dropEventPass(TQDropEvent *)), TQT_SIGNAL(dropEventPass(TQDropEvent *))); connect(v, TQT_SIGNAL(dropEventPass(TQDropEvent *)), TQT_SIGNAL(dropEventPass(TQDropEvent *)));
connect(v, TQT_SIGNAL(newStatus()), TQT_SLOT(statusChanged())); connect(v, TQT_SIGNAL(newtqStatus()), TQT_SLOT(statusChanged()));
v->show(); v->show();
v->setFocus(); v->setFocus();
v->child(0, "KateViewInternal")->installEventFilter(this); v->child(0, "KateViewInternal")->installEventFilter(this);
@ -167,7 +167,7 @@ void TextEditor::statusChanged()
{ {
uint line, col; uint line, col;
_view->cursorPosition(&line, &col) ; _view->cursorPosition(&line, &col) ;
TQString text = i18n("Line: %1 Col: %2").arg(line+1).arg(col+1); TQString text = i18n("Line: %1 Col: %2").tqarg(line+1).tqarg(col+1);
if( isReadOnly() ) text += " " + i18n("R/O"); if( isReadOnly() ) text += " " + i18n("R/O");
emit statusTextChanged(" " + text + " "); emit statusTextChanged(" " + text + " ");
if ( isReadOnly()!=_oldReadOnly || isModified()!=_oldModified ) emit guiChanged(); if ( isReadOnly()!=_oldReadOnly || isModified()!=_oldModified ) emit guiChanged();

@ -11,7 +11,7 @@
#include <tqpixmap.h> #include <tqpixmap.h>
#include <tqiconset.h> #include <tqiconset.h>
#include <layout.h> #include <tqlayout.h>
#include <tqsplitter.h> #include <tqsplitter.h>
#include <tqstringlist.h> #include <tqstringlist.h>
#include <tqtimer.h> #include <tqtimer.h>
@ -91,23 +91,23 @@ MainWindow::MainWindow()
Main::_toplevel = this; Main::_toplevel = this;
// status bar // status bar
_actionStatus = new TQLabel(statusBar()); _actiontqStatus = new TQLabel(statusBar());
statusBar()->addWidget(_actionStatus); statusBar()->addWidget(_actiontqStatus);
_actionProgress = new TQProgressBar(statusBar()); _actionProgress = new TQProgressBar(statusBar());
statusBar()->addWidget(_actionProgress); statusBar()->addWidget(_actionProgress);
_debugStatus = new TQLabel(statusBar()); _debugtqStatus = new TQLabel(statusBar());
statusBar()->addWidget(_debugStatus, 0, true); statusBar()->addWidget(_debugtqStatus, 0, true);
_editorStatus = new TQLabel(statusBar()); _editortqStatus = new TQLabel(statusBar());
statusBar()->addWidget(_editorStatus, 0, true); statusBar()->addWidget(_editortqStatus, 0, true);
_programmerStatus = new ProgrammerStatusWidget(statusBar()); _programmertqStatus = new ProgrammerStatusWidget(statusBar());
connect(_programmerStatus, TQT_SIGNAL(configure()), TQT_SLOT(configureProgrammer())); connect(_programmertqStatus, TQT_SIGNAL(configure()), TQT_SLOT(configureProgrammer()));
connect(_programmerStatus, TQT_SIGNAL(selected(const Programmer::Group &)), TQT_SLOT(selectProgrammer(const Programmer::Group &))); connect(_programmertqStatus, TQT_SIGNAL(selected(const Programmer::Group &)), TQT_SLOT(selectProgrammer(const Programmer::Group &)));
statusBar()->addWidget(_programmerStatus->widget(), 0, true); statusBar()->addWidget(_programmertqStatus->widget(), 0, true);
_toolStatus = new ToolStatusWidget(statusBar()); _tooltqStatus = new ToolStatusWidget(statusBar());
connect(_toolStatus, TQT_SIGNAL(configureToolchain()), TQT_SLOT(configureToolchains())); connect(_tooltqStatus, TQT_SIGNAL(configureToolchain()), TQT_SLOT(configureToolchains()));
connect(_toolStatus, TQT_SIGNAL(configure()), TQT_SLOT(configureProject())); connect(_tooltqStatus, TQT_SIGNAL(configure()), TQT_SLOT(configureProject()));
connect(_toolStatus, TQT_SIGNAL(selected(const Tool::Group &)), TQT_SLOT(selectTool(const Tool::Group &))); connect(_tooltqStatus, TQT_SIGNAL(selected(const Tool::Group &)), TQT_SLOT(selectTool(const Tool::Group &)));
statusBar()->addWidget(_toolStatus->widget(), 0, true); statusBar()->addWidget(_tooltqStatus->widget(), 0, true);
// interface // interface
_mainDock = createDockWidget("main_dock_widget", TQPixmap()); _mainDock = createDockWidget("main_dock_widget", TQPixmap());
@ -132,7 +132,7 @@ MainWindow::MainWindow()
_mainDock->setWidget(Main::_editorManager); _mainDock->setWidget(Main::_editorManager);
connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(guiChanged()), TQT_SLOT(updateGUI())); connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(guiChanged()), TQT_SLOT(updateGUI()));
connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(modified(const PURL::Url &)), TQT_TQOBJECT(Main::_projectManager), TQT_SLOT(modified(const PURL::Url &))); connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(modified(const PURL::Url &)), TQT_TQOBJECT(Main::_projectManager), TQT_SLOT(modified(const PURL::Url &)));
connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(statusChanged(const TQString &)), _editorStatus, TQT_SLOT(setText(const TQString &))); connect(TQT_TQOBJECT(Main::_editorManager), TQT_SIGNAL(statusChanged(const TQString &)), _editortqStatus, TQT_SLOT(setText(const TQString &)));
dock = createDock("compile_log_dock_widget", loader.loadIcon("piklab_compile", KIcon::Small), dock = createDock("compile_log_dock_widget", loader.loadIcon("piklab_compile", KIcon::Small),
i18n("Compile Log"), DockPosition(KDockWidget::DockBottom, 80)); i18n("Compile Log"), DockPosition(KDockWidget::DockBottom, 80));
@ -160,15 +160,15 @@ MainWindow::MainWindow()
// managers // managers
Programmer::manager = new Programmer::GuiManager(TQT_TQOBJECT(this)); Programmer::manager = new Programmer::GuiManager(TQT_TQOBJECT(this));
Programmer::manager->setView(_programLog); Programmer::manager->setView(_programLog);
connect(Programmer::manager, TQT_SIGNAL(actionMessage(const TQString &)), _actionStatus, TQT_SLOT(setText(const TQString &))); connect(Programmer::manager, TQT_SIGNAL(actionMessage(const TQString &)), _actiontqStatus, TQT_SLOT(setText(const TQString &)));
connect(Programmer::manager, TQT_SIGNAL(showProgress(bool)), TQT_SLOT(showProgress(bool))); connect(Programmer::manager, TQT_SIGNAL(showProgress(bool)), TQT_SLOT(showProgress(bool)));
connect(Programmer::manager, TQT_SIGNAL(setTotalProgress(uint)), TQT_SLOT(setTotalProgress(uint))); connect(Programmer::manager, TQT_SIGNAL(setTotalProgress(uint)), TQT_SLOT(setTotalProgress(uint)));
connect(Programmer::manager, TQT_SIGNAL(setProgress(uint)), TQT_SLOT(setProgress(uint))); connect(Programmer::manager, TQT_SIGNAL(setProgress(uint)), TQT_SLOT(setProgress(uint)));
Debugger::manager = new Debugger::GuiManager; Debugger::manager = new Debugger::GuiManager;
connect(Debugger::manager, TQT_SIGNAL(targetStateChanged()), TQT_SLOT(updateGUI())); connect(Debugger::manager, TQT_SIGNAL(targetStateChanged()), TQT_SLOT(updateGUI()));
connect(Debugger::manager, TQT_SIGNAL(statusChanged(const TQString &)), _debugStatus, TQT_SLOT(setText(const TQString &))); connect(Debugger::manager, TQT_SIGNAL(statusChanged(const TQString &)), _debugtqStatus, TQT_SLOT(setText(const TQString &)));
connect(Debugger::manager, TQT_SIGNAL(actionMessage(const TQString &)), _actionStatus, TQT_SLOT(setText(const TQString &))); connect(Debugger::manager, TQT_SIGNAL(actionMessage(const TQString &)), _actiontqStatus, TQT_SLOT(setText(const TQString &)));
Main::_compileManager = new Compile::Manager(TQT_TQOBJECT(this)); Main::_compileManager = new Compile::Manager(TQT_TQOBJECT(this));
Main::_compileManager->setView(Main::_compileLog); Main::_compileManager->setView(Main::_compileLog);
@ -570,7 +570,7 @@ void MainWindow::updateGUI()
showProgress(false); showProgress(false);
break; break;
case Main::Compiling: case Main::Compiling:
_actionStatus->setText(Main::_compileManager->label()); _actiontqStatus->setText(Main::_compileManager->label());
showProgress(true); showProgress(true);
makeWidgetDockVisible(Main::_compileLog); makeWidgetDockVisible(Main::_compileLog);
break; break;
@ -618,7 +618,7 @@ void MainWindow::updateGUI()
Main::action("project_add_current_file")->setEnabled(Main::project() && !inProject && idle && isSource); Main::action("project_add_current_file")->setEnabled(Main::project() && !inProject && idle && isSource);
// update build actions // update build actions
static_cast<PopupButton *>(_toolStatus->widget())->setText(" " + Main::toolGroup().label() + " "); static_cast<PopupButton *>(_tooltqStatus->widget())->setText(" " + Main::toolGroup().label() + " ");
bool hexProject = ( Main::_projectManager->projectUrl().fileType()==PURL::Hex ); bool hexProject = ( Main::_projectManager->projectUrl().fileType()==PURL::Hex );
bool customTool = Main::toolGroup().isCustom(); bool customTool = Main::toolGroup().isCustom();
Main::action("build_build_project")->setEnabled((Main::project() || (inProject && !hexProject) ) && idle); Main::action("build_build_project")->setEnabled((Main::project() || (inProject && !hexProject) ) && idle);
@ -630,11 +630,11 @@ void MainWindow::updateGUI()
// update programmer status // update programmer status
PortType ptype = Programmer::GroupConfig::portType(Main::programmerGroup()); PortType ptype = Programmer::GroupConfig::portType(Main::programmerGroup());
static_cast<PopupButton *>(_programmerStatus->widget())->setText(" " + Main::programmerGroup().statusLabel(ptype) + " "); static_cast<PopupButton *>(_programmertqStatus->widget())->setText(" " + Main::programmerGroup().statusLabel(ptype) + " ");
TQFont f = font(); TQFont f = font();
bool supported = (Main::deviceData() ? Main::programmerGroup().isSupported(Main::deviceData()->name()) : false); bool supported = (Main::deviceData() ? Main::programmerGroup().isSupported(Main::deviceData()->name()) : false);
f.setItalic(!supported); f.setItalic(!supported);
_programmerStatus->widget()->setFont(f); _programmertqStatus->widget()->setFont(f);
bool isProgrammer = ( Main::programmerGroup().properties() & ::Programmer::Programmer ); bool isProgrammer = ( Main::programmerGroup().properties() & ::Programmer::Programmer );
PURL::Url purl = Main::_projectManager->projectUrl(); PURL::Url purl = Main::_projectManager->projectUrl();
bool hasHex = ( currentType==PURL::Hex || Main::_projectManager->contains(purl.toFileType(PURL::Hex)) ); bool hasHex = ( currentType==PURL::Hex || Main::_projectManager->contains(purl.toFileType(PURL::Hex)) );
@ -728,7 +728,7 @@ void MainWindow::runPikloops()
_pikloopsProcess->setup("pikloops", TQStringList(), false); _pikloopsProcess->setup("pikloops", TQStringList(), false);
connect(_pikloopsProcess, TQT_SIGNAL(done(int)), TQT_SLOT(pikloopsDone())); connect(_pikloopsProcess, TQT_SIGNAL(done(int)), TQT_SLOT(pikloopsDone()));
if ( !_pikloopsProcess->start(0) ) if ( !_pikloopsProcess->start(0) )
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); 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);
} }
void MainWindow::pikloopsDone() void MainWindow::pikloopsDone()
@ -965,11 +965,11 @@ void MainWindow::showProgress(bool show)
{ {
if (show) { if (show) {
PBusyCursor::start(); PBusyCursor::start();
_actionStatus->show(); _actiontqStatus->show();
_actionProgress->show(); _actionProgress->show();
} else { } else {
PBusyCursor::stop(); PBusyCursor::stop();
_actionStatus->hide(); _actiontqStatus->hide();
_actionProgress->hide(); _actionProgress->hide();
} }
} }

@ -93,9 +93,9 @@ signals:
private: private:
Log::Widget *_programLog; Log::Widget *_programLog;
TQLabel *_actionStatus, *_debugStatus, *_editorStatus; TQLabel *_actiontqStatus, *_debugtqStatus, *_editortqStatus;
ProgrammerStatusWidget *_programmerStatus; ProgrammerStatusWidget *_programmertqStatus;
ToolStatusWidget *_toolStatus; ToolStatusWidget *_tooltqStatus;
TQProgressBar *_actionProgress; TQProgressBar *_actionProgress;
ConfigGenerator *_configGenerator; ConfigGenerator *_configGenerator;
::Process::Base *_pikloopsProcess, *_kfindProcess; ::Process::Base *_pikloopsProcess, *_kfindProcess;

@ -65,7 +65,7 @@ MenuBarButton::MenuBarButton(const TQString &icon, TQWidget *parent)
: TQToolButton(parent, "menu_bar_button") : TQToolButton(parent, "menu_bar_button")
{ {
TQFontMetrics fm(font()); TQFontMetrics fm(font());
int h = fm.height() + 2*tqstyle().pixelMetric(TQStyle::PM_DefaultFrameWidth, this); int h = fm.height() + 2*tqstyle().tqpixelMetric(TQStyle::PM_DefaultFrameWidth, this);
setFixedHeight(h); setFixedHeight(h);
KIconLoader loader; KIconLoader loader;
setIconSet(loader.loadIconSet(icon, KIcon::Small, fm.height()-2)); setIconSet(loader.loadIconSet(icon, KIcon::Small, fm.height()-2));
@ -73,7 +73,7 @@ MenuBarButton::MenuBarButton(const TQString &icon, TQWidget *parent)
setAutoRaise(true); setAutoRaise(true);
} }
TQSize MenuBarButton::sizeHint() const TQSize MenuBarButton::tqsizeHint() const
{ {
return TQSize(TQToolButton::sizeHint().width(), height()); return TQSize(TQToolButton::tqsizeHint().width(), height());
} }

@ -75,7 +75,7 @@ Q_OBJECT
TQ_OBJECT TQ_OBJECT
public: public:
MenuBarButton(const TQString &icon, TQWidget *parent); MenuBarButton(const TQString &icon, TQWidget *parent);
virtual TQSize sizeHint() const; virtual TQSize tqsizeHint() const;
}; };
#endif #endif

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

@ -115,7 +115,7 @@ CLI::ExitCode CLI::Main::executeCommand(const TQString &command)
if ( _device==0 ) return okExit(i18n("Hex file is valid.")); if ( _device==0 ) return okExit(i18n("Hex file is valid."));
TQStringList warnings; TQStringList warnings;
Device::Memory::WarningTypes wtypes = _memory->fromHexBuffer(_source1, warnings); Device::Memory::WarningTypes wtypes = _memory->fromHexBuffer(_source1, warnings);
if ( wtypes==Device::Memory::NoWarning ) return okExit(i18n("Hex file is compatible with device \"%1\".").arg(_device->name())); if ( wtypes==Device::Memory::NoWarning ) return okExit(i18n("Hex file is compatible with device \"%1\".").tqarg(_device->name()));
return errorExit(warnings.join("\n"), EXEC_ERROR); return errorExit(warnings.join("\n"), EXEC_ERROR);
} }
if ( command=="info" ) { 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 && 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 (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.")); 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.").arg(toHexLabel(it.key(), 8)), EXEC_ERROR); return errorExit(i18n("The two hex files are different at address %1.").tqarg(toHexLabel(it.key(), 8)), EXEC_ERROR);
} }
if ( command=="checksum" ) { if ( command=="checksum" ) {
TQStringList warnings; 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]); 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 log(Log::LineType::Warning, i18n("Checksum computation is experimental and is not always correct!")); // #### REMOVE ME
BitValue cs = _memory->checksum(); BitValue cs = _memory->checksum();
log(Log::LineType::Normal, i18n("Checksum: %1").arg(toHexLabel(cs, 4))); log(Log::LineType::Normal, i18n("Checksum: %1").tqarg(toHexLabel(cs, 4)));
if ( _device->group().name()=="pic" ) { if ( _device->group().name()=="pic" ) {
BitValue ucs = static_cast<Pic::Memory *>(_memory)->unprotectedChecksum(); BitValue ucs = static_cast<Pic::Memory *>(_memory)->unprotectedChecksum();
if ( ucs!=cs ) log(Log::LineType::Information, i18n("Unprotected checksum: %1").arg(toHexLabel(ucs, 4))); if ( ucs!=cs ) log(Log::LineType::Information, i18n("Unprotected checksum: %1").tqarg(toHexLabel(ucs, 4)));
} }
return OK; return OK;
} }
@ -220,7 +220,7 @@ CLI::ExitCode CLI::Main::executeSetCommand(const TQString &property, const TQStr
} }
TQString s = value.upper(); TQString s = value.upper();
_device = Device::lister().data(s); _device = Device::lister().data(s);
if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").arg(s), ARG_ERROR); if ( _device==0 ) return errorExit(i18n("Unknown device \"%1\".").tqarg(s), ARG_ERROR);
return OK; return OK;
} }
if ( property=="fill" ) { 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); if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR);
return OK; return OK;
} }
return errorExit(i18n("Unknown property \"%1\".").arg(property), ARG_ERROR); return errorExit(i18n("Unknown property \"%1\".").tqarg(property), ARG_ERROR);
} }
TQString CLI::Main::executeGetCommand(const TQString &property) 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>"); if ( _fill.isEmpty() ) return i18n("<not set>");
return _fill; return _fill;
} }
log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").arg(property)); log(Log::LineType::SoftError, i18n("Unknown property \"%1\".").tqarg(property));
return TQString(); 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); if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR);
PURL::Url dummy; PURL::Url dummy;
Breakpoint::Data data(dummy, address); Breakpoint::Data data(dummy, address);
if ( Breakpoint::list().contains(data) ) return okExit(i18n("Breakpoint already set at %1.").arg(toHexLabel(address, nbChars(NumberBase::Hex, address)))); if ( Breakpoint::list().contains(data) ) return okExit(i18n("Breakpoint already set at %1.").tqarg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
Breakpoint::list().append(data); Breakpoint::list().append(data);
Breakpoint::list().setAddress(data, address); Breakpoint::list().setAddress(data, address);
Breakpoint::list().setState(data, Breakpoint::Active); Breakpoint::list().setState(data, Breakpoint::Active);
return okExit(i18n("Breakpoint set at %1.").arg(toHexLabel(address, nbChars(NumberBase::Hex, address)))); return okExit(i18n("Breakpoint set at %1.").tqarg(toHexLabel(address, nbChars(NumberBase::Hex, address))));
} }
return errorExit(i18n("The first argument should be \"e\"."), ARG_ERROR); 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++) { for (uint i=0; i<nb; i++) {
Address address = Breakpoint::list().address(Breakpoint::list().data(i)); Address address = Breakpoint::list().address(Breakpoint::list().data(i));
log(Log::LineType::Normal, TQString(" #%1: %2").arg(i).arg(toHexLabel(address, nbc))); log(Log::LineType::Normal, TQString(" #%1: %2").tqarg(i).tqarg(toHexLabel(address, nbc)));
} }
return OK; return OK;
} }
@ -198,7 +198,7 @@ CLI::ExitCode CLI::Interactive::processLine(const TQString &s)
Breakpoint::Data data = Breakpoint::list().data(i); Breakpoint::Data data = Breakpoint::list().data(i);
Address address = Breakpoint::list().address(data); Address address = Breakpoint::list().address(data);
Breakpoint::list().remove(data); Breakpoint::list().remove(data);
return okExit(i18n("Breakpoint at %1 removed.").arg(toHexLabelAbs(address))); return okExit(i18n("Breakpoint at %1 removed.").tqarg(toHexLabelAbs(address)));
} }
if ( words[0]=="raw-com" ) { if ( words[0]=="raw-com" ) {
if ( words.count()!=2 ) return errorExit(i18n("This command needs a commands filename."), ARG_ERROR); 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(); const Pic::RegistersData &rdata = data.registersData();
log(Log::LineType::Normal, i18n("Special Function Registers:")); log(Log::LineType::Normal, i18n("Special Function Registers:"));
TQValueVector<Pic::RegisterNameData> list = Pic::sfrList(data); TQValueVector<Pic::RegisterNameData> list = Pic::sfrList(data);
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())); 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()));
log(Log::LineType::Normal, i18n("General Purpose Registers:")); log(Log::LineType::Normal, i18n("General Purpose Registers:"));
list = Pic::gprList(data, coff); list = Pic::gprList(data, coff);
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())); 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()));
return OK; return OK;
} }
@ -260,7 +260,7 @@ CLI::ExitCode CLI::Interactive::variableList()
const Pic::RegistersData &rdata = data.registersData(); const Pic::RegistersData &rdata = data.registersData();
TQValueVector<Pic::RegisterNameData> list = Pic::variableList(data, *coff); TQValueVector<Pic::RegisterNameData> list = Pic::variableList(data, *coff);
if ( list.count()==0 ) log(Log::LineType::Normal, i18n("No variable.")); 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").arg(toHexLabel(list[i].data().address(), rdata.nbCharsAddress())).arg(list[i].label())); 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()));
return OK; return OK;
} }
@ -292,7 +292,7 @@ CLI::ExitCode CLI::Interactive::executeRegister(const TQString &name, const TQSt
bool ok; bool ok;
ulong v = fromAnyLabel(value, &ok); ulong v = fromAnyLabel(value, &ok);
if ( !ok ) return errorExit(i18n("Number format not recognized."), ARG_ERROR); 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).").arg(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).").tqarg(toHexLabel(maxValue(NumberBase::Hex, nbChars), nbChars)), ARG_ERROR);
Register::TypeData rtd; Register::TypeData rtd;
if ( name.lower()=="w" || name.lower()=="wreg" ) if ( name.lower()=="w" || name.lower()=="wreg" )
rtd = static_cast<Debugger::PicBase *>(Debugger::manager->debugger())->deviceSpecific()->wregTypeData(); 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 ( value.isEmpty() ) {
if ( !Debugger::manager->readRegister(rtd) ) return ARG_ERROR; if ( !Debugger::manager->readRegister(rtd) ) return ARG_ERROR;
return okExit(i18n("%1 = %2").arg(name.upper()).arg(toHexLabel(Register::list().value(rtd), nbChars))); return okExit(i18n("%1 = %2").tqarg(name.upper()).tqarg(toHexLabel(Register::list().value(rtd), nbChars)));
} }
return (Debugger::manager->writeRegister(rtd, v) ? OK : EXEC_ERROR); 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) CLI::ExitCode CLI::Interactive::executeRawCommands(const TQString &filename)
{ {
TQFile file(filename); TQFile file(filename);
if ( !file.open(IO_ReadOnly) ) return errorExit(i18n("Could not open filename \"%1\".").arg(filename), ARG_ERROR); if ( !file.open(IO_ReadOnly) ) return errorExit(i18n("Could not open filename \"%1\".").tqarg(filename), ARG_ERROR);
if ( Programmer::manager->programmer()==0 ) { if ( Programmer::manager->programmer()==0 ) {
Programmer::manager->createProgrammer(_device); Programmer::manager->createProgrammer(_device);
if ( !Programmer::manager->programmer()->simpleConnectHardware() ) return EXEC_ERROR; if ( !Programmer::manager->programmer()->simpleConnectHardware() ) return EXEC_ERROR;
@ -330,7 +330,7 @@ CLI::ExitCode CLI::Interactive::executeRawCommands(const TQString &filename)
} else { } else {
TQString rs; TQString rs;
if ( !programmer->hardware()->rawRead(s.length(), rs) ) return EXEC_ERROR; 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).").arg(rs).arg(s)); if ( rs!=s ) log(Log::LineType::Warning, i18n("Read string is different than expected: %1 (%2).").tqarg(rs).tqarg(s));
} }
} }
return okExit(i18n("End of command file reached.")); 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()); if ( CLI::_port=="usb" ) return Port::Description(PortType::USB, TQString());
PortType type = Port::findType(CLI::_port); PortType type = Port::findType(CLI::_port);
if ( type==PortType::Nb_Types ) { 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.").arg(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.").tqarg(CLI::_port));
type = PortType::Serial; type = PortType::Serial;
} }
return Port::Description(type, CLI::_port); return Port::Description(type, CLI::_port);

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

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

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

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

@ -44,7 +44,7 @@ public:
Register::TypeData pcTypeData() const; Register::TypeData pcTypeData() const;
virtual bool readRegister(const Register::TypeData &data, BitValue &value) = 0; virtual bool readRegister(const Register::TypeData &data, BitValue &value) = 0;
virtual bool writeRegister(const Register::TypeData &data, BitValue value) = 0; virtual bool writeRegister(const Register::TypeData &data, BitValue value) = 0;
virtual bool updatePortStatus(uint index, TQMap<uint, Device::PortBitData> &bits) = 0; virtual bool updatePorttqStatus(uint index, TQMap<uint, Device::PortBitData> &bits) = 0;
protected: protected:
Programmer::Base &_programmer; Programmer::Base &_programmer;
@ -68,7 +68,7 @@ class DeviceSpecific : public Log::Base
{ {
public: public:
DeviceSpecific(Debugger::Base &base) : Log::Base(base), _base(base) {} DeviceSpecific(Debugger::Base &base) : Log::Base(base), _base(base) {}
virtual bool updateStatus() = 0; virtual bool updatetqStatus() = 0;
virtual TQString statusString() const = 0; virtual TQString statusString() const = 0;
protected: protected:

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

@ -83,7 +83,7 @@ void Direct::Hardware::setPin(PinType type, bool on)
int pin = _data.pins[type]; int pin = _data.pins[type];
if ( isGroundPin(pin) ) return; if ( isGroundPin(pin) ) return;
uint p = (pin<0 ? -pin : pin)-1; uint p = (pin<0 ? -pin : pin)-1;
//log(Log::DebugLevel::Extra, TQString("Hardware::setPin %1 %2: %3 %4").arg(PIN_DATA[type].label).arg(pin).arg(on).arg(_data.clockDelay)); //log(Log::DebugLevel::Extra, TQString("Hardware::setPin %1 %2: %3 %4").tqarg(PIN_DATA[type].label).tqarg(pin).tqarg(on).tqarg(_data.clockDelay));
_port->setPinOn(p, on, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic)); _port->setPinOn(p, on, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic));
if ( type==Clock ) Port::usleep(_data.clockDelay); if ( type==Clock ) Port::usleep(_data.clockDelay);
} }
@ -95,7 +95,7 @@ bool Direct::Hardware::readBit()
uint p = (pin<0 ? -pin : pin)-1; uint p = (pin<0 ? -pin : pin)-1;
bool on; bool on;
_port->readPin(p, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic), on); _port->readPin(p, (pin<0 ? Port::NegativeLogic : Port::PositiveLogic), on);
//log(Log::DebugLevel::Extra, TQString("Hardware::read DataIn %2: %3").arg(pin).arg(on)); //log(Log::DebugLevel::Extra, TQString("Hardware::read DataIn %2: %3").tqarg(pin).tqarg(on));
return 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 TQString Direct::Hardware::pinLabelForIndex(Port::IODir dir, uint i) const
{ {
Port::PinData pd = _port->pinData(dir)[i]; Port::PinData pd = _port->pinData(dir)[i];
return TQString("%1 (%2)").arg(pd.pin+1).arg(pd.label); return TQString("%1 (%2)").tqarg(pd.pin+1).tqarg(pd.label);
} }
Port::IODir Direct::Hardware::ioTypeForPin(int pin) const 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); gotoMemory(type);
for (uint i = 0; i<data.count(); ) { for (uint i = 0; i<data.count(); ) {
if ( !writeWords(type, data, i, force) ) { if ( !writeWords(type, data, i, force) ) {
log(Log::LineType::Error, i18n("Error programming %1 at %2.").arg(type.label()).arg(toHexLabel(i, 8))); log(Log::LineType::Error, i18n("Error programming %1 at %2.").tqarg(type.label()).tqarg(toHexLabel(i, 8)));
return false; return false;
} }
} }
@ -134,7 +134,7 @@ bool Direct::pic16::writeWords(Pic::MemoryRangeType type, const Device::Array &d
} }
} }
startProg(type); startProg(type);
TQString cmd = TQString("w%1").arg(waitProgTime(type)); TQString cmd = TQString("w%1").tqarg(waitProgTime(type));
pulseEngine(cmd.latin1()); pulseEngine(cmd.latin1());
endProg(type); endProg(type);
return true; return true;

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

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

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

@ -57,7 +57,7 @@ Direct::HConfigWidget::HConfigWidget(::Programmer::Base &base, TQWidget *parent,
_testLabels[i] = new TQLabel(w); _testLabels[i] = new TQLabel(w);
TQToolTip::add(_testcbs[i], PIN_DATA[i].testComment); TQToolTip::add(_testcbs[i], PIN_DATA[i].testComment);
grid->addWidget(_testLabels[i], i, 4); grid->addWidget(_testLabels[i], i, 4);
updateTestStatus(PinType(i), false); updateTesttqStatus(PinType(i), false);
} else { } else {
_testcbs[i] = 0; _testcbs[i] = 0;
_testLabels[i] = 0; _testLabels[i] = 0;
@ -150,11 +150,11 @@ void Direct::HConfigWidget::updateTestPin(PinType ptype)
Q_ASSERT( _connected && ptype!=DataIn ); Q_ASSERT( _connected && ptype!=DataIn );
bool on = _testcbs[ptype]->isChecked(); bool on = _testcbs[ptype]->isChecked();
hardware()->setPin(ptype, on); hardware()->setPin(ptype, on);
updateTestStatus(ptype, on); updateTesttqStatus(ptype, on);
if ( ptype==Vpp ) updateDataIn(); if ( ptype==Vpp ) updateDataIn();
} }
void Direct::HConfigWidget::updateTestStatus(PinType ptype, bool on) void Direct::HConfigWidget::updateTesttqStatus(PinType ptype, bool on)
{ {
if (on) _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].onLabel)); if (on) _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].onLabel));
else _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].offLabel)); else _testLabels[ptype]->setText(i18n(PIN_DATA[ptype].offLabel));
@ -163,7 +163,7 @@ void Direct::HConfigWidget::updateTestStatus(PinType ptype, bool on)
void Direct::HConfigWidget::updateDataIn() void Direct::HConfigWidget::updateDataIn()
{ {
bool on = hardware()->readBit(); bool on = hardware()->readBit();
updateTestStatus(DataIn, on); updateTesttqStatus(DataIn, on);
_testcbs[DataIn]->setChecked(on); _testcbs[DataIn]->setChecked(on);
} }
@ -204,7 +204,7 @@ bool Direct::HConfigWidget::set(const Port::Description &pd, const ::Hardware::D
if (_edit) { if (_edit) {
for (uint i=0; i<Nb_PinTypes; i++) { for (uint i=0; i<Nb_PinTypes; i++) {
_testcbs[i]->setEnabled(_connected); _testcbs[i]->setEnabled(_connected);
updateTestStatus(PinType(i), false); updateTesttqStatus(PinType(i), false);
} }
if ( _connected ) _timerPollDataOut->start(100); if ( _connected ) _timerPollDataOut->start(100);
_sendBitsButton->setEnabled(_connected); _sendBitsButton->setEnabled(_connected);

@ -55,7 +55,7 @@ private:
void sendBits(uint d, int nbb); void sendBits(uint d, int nbb);
void updateTestPin(PinType ptype); void updateTestPin(PinType ptype);
void updateTestStatus(PinType ptype, bool on); void updateTesttqStatus(PinType ptype, bool on);
uint pin(PinType ptype) const; uint pin(PinType ptype) const;
void updatePin(PinType ptype); void updatePin(PinType ptype);
Hardware *hardware() { return static_cast<Hardware *>(_hardware); } Hardware *hardware() { return static_cast<Hardware *>(_hardware); }

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

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

@ -45,7 +45,7 @@ public:
virtual bool setBreakpoints(const TQValueList<Address> &list); virtual bool setBreakpoints(const TQValueList<Address> &list);
virtual bool readRegister(const Register::TypeData &data, BitValue &value); virtual bool readRegister(const Register::TypeData &data, BitValue &value);
virtual bool writeRegister(const Register::TypeData &data, BitValue value); virtual bool writeRegister(const Register::TypeData &data, BitValue value);
virtual bool updatePortStatus(uint index, TQMap<uint, Device::PortBitData> &bits); virtual bool updatePorttqStatus(uint index, TQMap<uint, Device::PortBitData> &bits);
private: private:
uint _nbBreakpoints; uint _nbBreakpoints;

@ -23,16 +23,16 @@ GPSim::ConfigWidget::ConfigWidget(const ::Programmer::Group &group, TQWidget *pa
_status = new TQLabel(this); _status = new TQLabel(this);
addWidget(_status, row,row, 1,1); addWidget(_status, row,row, 1,1);
TQTimer::singleShot(0, this, TQT_SLOT(updateStatus())); TQTimer::singleShot(0, this, TQT_SLOT(updatetqStatus()));
} }
void GPSim::ConfigWidget::updateStatus() void GPSim::ConfigWidget::updatetqStatus()
{ {
VersionData version; VersionData version;
ProcessManager manager(0); ProcessManager manager(0);
if ( !manager.start() ) _status->setText(i18n("Could not start \"gpsim\"")); 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 if ( !manager.getVersion(version) || !version.isValid() ) _status->setText(i18n("Could not detect \"gpsim\" version"));
else _status->setText(i18n("Found version \"%1\"").arg(version.pretty())); else _status->setText(i18n("Found version \"%1\"").tqarg(version.pretty()));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

@ -23,7 +23,7 @@ public:
ConfigWidget(const ::Programmer::Group &group, TQWidget *parent); ConfigWidget(const ::Programmer::Group &group, TQWidget *parent);
private slots: private slots:
void updateStatus(); void updatetqStatus();
private: private:
TQLabel *_status; TQLabel *_status;

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

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

@ -11,7 +11,7 @@
#include <tqradiobutton.h> #include <tqradiobutton.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <layout.h> #include <tqlayout.h>
#include <tqbuttongroup.h> #include <tqbuttongroup.h>
#include <tqlabel.h> #include <tqlabel.h>
@ -27,7 +27,7 @@ public:
void setGroup(const Programmer::Group &group); void setGroup(const Programmer::Group &group);
Port::Description portDescription() const { return Port::Description(type(), device(type())); } Port::Description portDescription() const { return Port::Description(type(), device(type())); }
void saveConfig(); void saveConfig();
void setStatus(PortType type, const TQString &message); void settqStatus(PortType type, const TQString &message);
signals: signals:
void changed(); void changed();

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "prog_config_center.h" #include "prog_config_center.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqwidgetstack.h> #include <tqwidgetstack.h>
#include <tqcombobox.h> #include <tqcombobox.h>
@ -86,7 +86,7 @@ void Programmer::SelectConfigWidget::portChanged()
delete config; delete config;
TQWidget *w = _stack->item(_combo->currentItem()); TQWidget *w = _stack->item(_combo->currentItem());
bool ok = static_cast< ::Programmer::ConfigWidget *>(w)->setPort(hd); bool ok = static_cast< ::Programmer::ConfigWidget *>(w)->setPort(hd);
_portSelector->setStatus(hd.port.type, ok ? i18n("Connection: Ok") : i18n("Connection: Error")); _portSelector->settqStatus(hd.port.type, ok ? i18n("Connection: Ok") : i18n("Connection: Error"));
} }
TQPixmap Programmer::SelectConfigWidget::pixmap() const TQPixmap Programmer::SelectConfigWidget::pixmap() const

@ -8,7 +8,7 @@
***************************************************************************/ ***************************************************************************/
#include "prog_config_widget.h" #include "prog_config_widget.h"
#include <layout.h> #include <tqlayout.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <tqcheckbox.h> #include <tqcheckbox.h>

@ -32,7 +32,7 @@ public:
virtual bool setPort(const HardwareDescription &hd); virtual bool setPort(const HardwareDescription &hd);
signals: signals:
void updatePortStatus(bool ok); void updatePorttqStatus(bool ok);
protected: protected:
const Group &_group; const Group &_group;

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

@ -61,7 +61,7 @@ bool Icd1::SerialPort::sendCommand(uint cmd)
synchronize(); synchronize();
char c[7] = "$XXXX\r"; char c[7] = "$XXXX\r";
TQString cs = toHex(cmd, 4); TQString cs = toHex(cmd, 4);
log(Log::DebugLevel::Extra, TQString("Send command: %1").arg(toPrintable(cs, PrintAlphaNum))); log(Log::DebugLevel::Extra, TQString("Send command: %1").tqarg(toPrintable(cs, PrintAlphaNum)));
c[1] = cs[0].latin1(); c[1] = cs[0].latin1();
c[2] = cs[1].latin1(); c[2] = cs[1].latin1();
c[3] = cs[2].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)); uint end = (force ? data.count() : findNonMaskEnd(type, data));
nbWords = end - wordOffset + 1; nbWords = end - wordOffset + 1;
log(Log::DebugLevel::Normal, TQString(" start=%1 nbWords=%2 total=%3 force=%4") log(Log::DebugLevel::Normal, TQString(" start=%1 nbWords=%2 total=%3 force=%4")
.arg(toHexLabel(wordOffset, device().nbCharsAddress())).arg(toHexLabel(nbWords, device().nbCharsAddress())) .tqarg(toHexLabel(wordOffset, device().nbCharsAddress())).tqarg(toHexLabel(nbWords, device().nbCharsAddress()))
.arg(toHexLabel(data.count(), device().nbCharsAddress())).arg(force ? "true" : "false")); .tqarg(toHexLabel(data.count(), device().nbCharsAddress())).tqarg(force ? "true" : "false"));
} }
_base.progressMonitor().addTaskProgress(data.count()-nbWords); _base.progressMonitor().addTaskProgress(data.count()-nbWords);
return data.mid(wordOffset, nbWords); return data.mid(wordOffset, nbWords);

@ -170,14 +170,14 @@ bool Icd2::Hardware::setup()
TQString s; TQString s;
if ( !_port->receive(2, s) ) return false; if ( !_port->receive(2, s) ) return false;
if ( s!="02" ) { if ( s!="02" ) {
log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").arg(s)); log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").tqarg(s));
return false; return false;
} }
// ?? // ??
if ( !command("08", 2) ) return false; if ( !command("08", 2) ) return false;
if ( _rx.mid(5, 2)!="00" ) { if ( _rx.mid(5, 2)!="00" ) {
log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").arg(_rx)); log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").tqarg(_rx));
return false; 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(); for (uint i=0; i<uint(s.length()); i++) chk += cs[i].latin1();
tx += toHex(chk, 2); tx += toHex(chk, 2);
tx += '>'; tx += '>';
log(Log::DebugLevel::Extra, TQString("send command: '%1'").arg(tx)); log(Log::DebugLevel::Extra, TQString("send command: '%1'").tqarg(tx));
TQByteArray a = toAscii(tx); TQByteArray a = toAscii(tx);
return _port->send(a.data(), a.count()); 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 ( poll && _port->type()==PortType::USB ) {
if ( !static_cast<USBPort *>(_port)->poll(size, _rx) ) return false; 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...) } 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'").arg(_rx)); log(Log::DebugLevel::Extra, TQString("received answer: '%1'").tqarg(_rx));
if ( size!=fromHex(_rx.mid(1, 2), 0) ) { if ( size!=fromHex(_rx.mid(1, 2), 0) ) {
log(Log::LineType::Error, i18n("Received length too short.")); log(Log::LineType::Error, i18n("Received length too short."));
return false; return false;
@ -217,12 +217,12 @@ bool Icd2::Hardware::receiveResponse(const TQString &command, uint responseSize,
return false; return false;
} }
if ( _rx[0]!='[' || _rx[size-1]!=']' ) { if ( _rx[0]!='[' || _rx[size-1]!=']' ) {
log(Log::LineType::Error, i18n("Malformed string received \"%1\"").arg(_rx)); log(Log::LineType::Error, i18n("Malformed string received \"%1\"").tqarg(_rx));
return false; return false;
} }
if ( command.mid(0, 2)!=_rx.mid(3, 2) ) { if ( command.mid(0, 2)!=_rx.mid(3, 2) ) {
log(Log::LineType::Error, i18n("Wrong return value (\"%1\"; was expecting \"%2\")") log(Log::LineType::Error, i18n("Wrong return value (\"%1\"; was expecting \"%2\")")
.arg(_rx.mid(3, 2)).arg(command.mid(0, 2))); .tqarg(_rx.mid(3, 2)).tqarg(command.mid(0, 2)));
return false; return false;
} }
// verify the checksum // 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); TQString cs = s.mid(s.length()-3, 2);
if ( chk!=fromHex(cs, 0) ) { if ( chk!=fromHex(cs, 0) ) {
log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").arg(cs).arg(toHex(chk, 2))); log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").tqarg(cs).tqarg(toHex(chk, 2)));
return false; return false;
} }
return true; 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) 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)").arg(toHex(wordIndex, 8)).arg(toHex(nbWords, 8)).arg(toHex(data.size(), 8))); 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)));
Q_ASSERT( wordIndex+nbWords<=data.size() ); Q_ASSERT( wordIndex+nbWords<=data.size() );
// prepare data // prepare data
TQString s = "{"; TQString s = "{";

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

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

@ -52,8 +52,8 @@ bool Icd2::ProgrammerBase::selfTest(bool ask)
if ( i!=0 ) s += "; "; if ( i!=0 ) s += "; ";
s += _testData.pretty(TestData::VoltageType(i)); s += _testData.pretty(TestData::VoltageType(i));
} }
log(Log::LineType::Warning, i18n("Self-test failed: %1").arg(s)); 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?").arg(s)) ) { if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").tqarg(s)) ) {
logUserAbort(); logUserAbort();
return false; return false;
} }
@ -77,7 +77,7 @@ VersionData Icd2::ProgrammerBase::mplabVersion(::Programmer::FirmwareVersionType
bool Icd2::ProgrammerBase::setupFirmware() bool Icd2::ProgrammerBase::setupFirmware()
{ {
const FamilyData &fdata = FAMILY_DATA[family(device()->name())]; const FamilyData &fdata = FAMILY_DATA[family(device()->name())];
log(Log::DebugLevel::Normal, TQString(" Firmware id is %1 and we want %2").arg(_firmwareId).arg(fdata.efid)); log(Log::DebugLevel::Normal, TQString(" Firmware id is %1 and we want %2").tqarg(_firmwareId).tqarg(fdata.efid));
if ( fdata.efid==_firmwareId ) return true; if ( fdata.efid==_firmwareId ) return true;
log(Log::LineType::Information, i18n(" Incorrect firmware loaded.")); 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"; TQString nameFilter = "ICD" + TQString::number(fdata.efid).rightJustify(2, '0') + "??????.hex";
TQStringList files = dir.files(nameFilter); TQStringList files = dir.files(nameFilter);
if ( files.isEmpty() ) { if ( files.isEmpty() ) {
log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").arg(nameFilter).arg(dir.path())); log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").tqarg(nameFilter).tqarg(dir.path()));
return false; return false;
} }
// upload hex file // upload hex file
PURL::Url url(dir, files[files.count()-1]); PURL::Url url(dir, files[files.count()-1]);
log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").arg(url.pretty())); log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").tqarg(url.pretty()));
Log::StringView sview; Log::StringView sview;
PURL::File file(url, sview); PURL::File file(url, sview);
if ( !file.openForRead() ) { if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty())); log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
return false; return false;
} }
if ( !doUploadFirmware(file) ) 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->send(a.data(), a.count()) ) return false;
if ( !_port->receive(1, s) ) return false; if ( !_port->receive(1, s) ) return false;
if ( s.upper()!=mode ) { if ( s.upper()!=mode ) {
log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").arg(mode)); log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").tqarg(mode));
return false; return false;
} }
//log(Log::Debug, "set fast speed"); //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 ( !doSequence(Poll, (char *)a.data(), size) ) return false;
if (_poll) break; if (_poll) break;
} }
//log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").arg(toPrintable((const char *)a.data(), size))); //log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").tqarg(toPrintable((const char *)a.data(), size)));
return true; return true;
} }
@ -152,7 +152,7 @@ Icd2::USBHardware::USBHardware(::Programmer::Base &base)
bool Icd2::USBHardware::internalConnect(const TQString &mode) bool Icd2::USBHardware::internalConnect(const TQString &mode)
{ {
// load control messages for USB device if needed // load control messages for USB device if needed
log(Log::DebugLevel::Extra, TQString("need firmware ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0)); log(Log::DebugLevel::Extra, TQString("need firmware ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0));
if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE) ) { if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE) ) {
USBPort port(ID_FIRMWARE, *this); USBPort port(ID_FIRMWARE, *this);
if ( !port.open() ) return false; if ( !port.open() ) return false;
@ -163,7 +163,7 @@ bool Icd2::USBHardware::internalConnect(const TQString &mode)
} }
port.close(); port.close();
for (uint i=0; i<10; i++) { for (uint i=0; i<10; i++) {
log(Log::DebugLevel::Extra, TQString("client here ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0)); log(Log::DebugLevel::Extra, TQString("client here ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0));
if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_CLIENT) ) break; if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_CLIENT) ) break;
Port::msleep(1000); Port::msleep(1000);
} }

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

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

@ -81,7 +81,7 @@ bool Debugger::Manager::internalInit()
if ( !coffUrl().exists() ) return false; if ( !coffUrl().exists() ) return false;
Log::Base log; Log::Base log;
log.setView(compileView()); log.setView(compileView());
log.log(Log::LineType::Information, i18n("Parsing COFF file: %1").arg(coffUrl().pretty())); log.log(Log::LineType::Information, i18n("Parsing COFF file: %1").tqarg(coffUrl().pretty()));
_coff = new Coff::TextObject(_data, coffUrl()); _coff = new Coff::TextObject(_data, coffUrl());
if ( !_coff->parse(log) ) { if ( !_coff->parse(log) ) {
delete _coff; delete _coff;
@ -110,7 +110,7 @@ void Debugger::Manager::freeActiveBreakpoint()
uint max = programmerGroup()->maxNbBreakpoints(deviceData()); uint max = programmerGroup()->maxNbBreakpoints(deviceData());
Q_ASSERT( nb<=max && max!=0 ); Q_ASSERT( nb<=max && max!=0 );
if ( nb==max ) { 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.").arg(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));
Breakpoint::list().setState(last, Breakpoint::Disabled); Breakpoint::list().setState(last, Breakpoint::Disabled);
} }
} }
@ -213,7 +213,7 @@ bool Debugger::Manager::updateRegister(const Register::TypeData &data)
int index = rdata->portIndex(data.address()); int index = rdata->portIndex(data.address());
if ( index!=-1 ) { if ( index!=-1 ) {
TQMap<uint, Device::PortBitData> data; TQMap<uint, Device::PortBitData> data;
if ( !debugger()->updatePortStatus(index, data) ) return false; if ( !debugger()->updatePorttqStatus(index, data) ) return false;
Register::list().setPortData(index, data); Register::list().setPortData(index, data);
} }
} }
@ -384,7 +384,7 @@ bool Debugger::Manager::prepareDebugging()
break; break;
} }
if ( i==Programmer::Nb_InputFileTypes ) { if ( i==Programmer::Nb_InputFileTypes ) {
log(Log::LineType::Error, i18n("Cannot start debugging session without input file (%1).").arg(first.pretty())); log(Log::LineType::Error, i18n("Cannot start debugging session without input file (%1).").tqarg(first.pretty()));
return false; return false;
} }
} }

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

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

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

@ -52,14 +52,14 @@ bool Pickit::USBPort::command(const char *s)
bool Pickit::USBPort::command(const Array &cmd) bool Pickit::USBPort::command(const Array &cmd)
{ {
log(Log::DebugLevel::Extra, TQString("send command: \"%1\"").arg(cmd.pretty())); log(Log::DebugLevel::Extra, TQString("send command: \"%1\"").tqarg(cmd.pretty()));
return write(writeEndPoint(), (const char *)cmd._data.data(), cmd.length()); return write(writeEndPoint(), (const char *)cmd._data.data(), cmd.length());
} }
bool Pickit::USBPort::receive(Pickit::Array &array) bool Pickit::USBPort::receive(Pickit::Array &array)
{ {
if ( !read(readEndPoint(), (char *)array._data.data(), array.length()) ) return false; if ( !read(readEndPoint(), (char *)array._data.data(), array.length()) ) return false;
log(Log::DebugLevel::Max, TQString("received: \"%1\"").arg(array.pretty())); log(Log::DebugLevel::Max, TQString("received: \"%1\"").tqarg(array.pretty()));
return true; 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) 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").arg(nbBytesWord).arg(nbRead).arg(offset)); log(Log::DebugLevel::Max, TQString("receive words nbBytesWord=%1 nbRead=%2 offset=%3").tqarg(nbBytesWord).tqarg(nbRead).tqarg(offset));
Array a = array(); Array a = array();
TQMemArray<uchar> data(nbRead*a.length()); TQMemArray<uchar> data(nbRead*a.length());
uint l = 0; 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); data[index]= read[5 + 2*k] & 0xFF | (read[6 + 2*k] << 8);
if ( vdata && index>=0x1000 && index<0x3FF0 && data[index]!=(*vdata)[index] ) { 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).") log(Log::LineType::Error, i18n("Firmware memory does not match hex file (at address 0x%2: reading 0x%3 and expecting 0x%4).")
.arg(TQString(toHex(index/2, device->nbCharsAddress()))) .tqarg(TQString(toHex(index/2, device->nbCharsAddress())))
.arg(TQString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))) .tqarg(TQString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))
.arg(TQString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))); .tqarg(TQString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))));
return false; return false;
} }
} }
@ -111,7 +111,7 @@ bool Pickit2::USBPort::uploadFirmware(const Pic::Memory &memory, ProgressMonitor
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool Pickit2::Hardware::readVoltages(VoltagesData &voltages) bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
{ {
log(Log::DebugLevel::Extra, TQString("readVoltages: Firmware is %1").arg(_base.firmwareVersion().pretty())); log(Log::DebugLevel::Extra, TQString("readVoltages: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) { if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) {
log(Log::LineType::Warning, i18n("Cannot read voltages with this firmware version.")); log(Log::LineType::Warning, i18n("Cannot read voltages with this firmware version."));
return true; return true;
@ -128,9 +128,9 @@ bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
bool Pickit2::Hardware::setVddVpp(double vdd, double vpp) bool Pickit2::Hardware::setVddVpp(double vdd, double vpp)
{ {
log(Log::DebugLevel::Extra, TQString("setVddVpp: Firmware is %1").arg(_base.firmwareVersion().pretty())); log(Log::DebugLevel::Extra, TQString("setVddVpp: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) return true; if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) return true;
log(Log::DebugLevel::Normal, TQString(" set Vdd = %1 V and Vpp = %2 V").arg(vdd).arg(vpp)); log(Log::DebugLevel::Normal, TQString(" set Vdd = %1 V and Vpp = %2 V").tqarg(vdd).tqarg(vpp));
Array cmd; Array cmd;
cmd[0] = 's'; cmd[0] = 's';
uint cvdd = uint(32.0 * vdd + 12.5); uint cvdd = uint(32.0 * vdd + 12.5);

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

@ -28,22 +28,22 @@ bool Pickit::Base::readFirmwareVersion()
bool Pickit::Base::regenerateOsccal(const PURL::Url &url) bool Pickit::Base::regenerateOsccal(const PURL::Url &url)
{ {
log(Log::DebugLevel::Normal, TQString(" Calibration firmware file: %1").arg(url.pretty())); log(Log::DebugLevel::Normal, TQString(" Calibration firmware file: %1").tqarg(url.pretty()));
Log::StringView sview; Log::StringView sview;
PURL::File file(url, sview); PURL::File file(url, sview);
if ( !file.openForRead() ) { if ( !file.openForRead() ) {
log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty())); log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
return false; return false;
} }
Pic::Memory memory(*device()); Pic::Memory memory(*device());
TQStringList errors, warnings; TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes; Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) { if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").arg(url.pretty()).arg(errors[0])); log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").tqarg(url.pretty()).tqarg(errors[0]));
return false; return false;
} }
if ( warningTypes!=Pic::Memory::NoWarning ) { if ( warningTypes!=Pic::Memory::NoWarning ) {
log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").arg(device()->name())); log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").tqarg(device()->name()));
return false; return false;
} }
if ( !askContinue(i18n("This will overwrite the device code memory. Continue anyway?")) ) 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.").arg(version.pretty())); log(Log::LineType::Information, i18n("Bootloader version %1 detected.").tqarg(version.pretty()));
if ( version.majorNum()!=2 ) { if ( version.majorNum()!=2 ) {
log(Log::LineType::Error, i18n("Only bootloader version 2.x is supported.")); log(Log::LineType::Error, i18n("Only bootloader version 2.x is supported."));
return false; return false;
@ -50,7 +50,7 @@ bool Pickit2Bootloader::Hardware::write(Pic::MemoryRangeType type, const Device:
if ( i>=0x1000 && i<0x3FF0 ) continue; if ( i>=0x1000 && i<0x3FF0 ) continue;
if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue; if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue;
uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i; 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.").arg(toHexLabel(address, device().nbCharsAddress()))); log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress())));
break; break;
} }
return port().writeFirmwareCodeMemory(data, _base.progressMonitor()); return port().writeFirmwareCodeMemory(data, _base.progressMonitor());

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

@ -18,7 +18,7 @@ namespace Pickit2V2
enum FirmwareCommand { enum FirmwareCommand {
EnterBootloader = 0x42, NoOperation = 0x5A, FirmwareVersion = 0x76, EnterBootloader = 0x42, NoOperation = 0x5A, FirmwareVersion = 0x76,
SetVdd = 0xA0, SetVpp = 0xA1, ReadStatus = 0xA2, ReadVoltages = 0xA3, SetVdd = 0xA0, SetVpp = 0xA1, ReadtqStatus = 0xA2, ReadVoltages = 0xA3,
DownloadScript = 0xA4, RunScript = 0xA5, ExecuteScript = 0xA6, DownloadScript = 0xA4, RunScript = 0xA5, ExecuteScript = 0xA6,
ClearDownloadBuffer = 0xA7, DownloadData = 0xA8, ClearUploadBuffer = 0xA9, ClearDownloadBuffer = 0xA7, DownloadData = 0xA8, ClearUploadBuffer = 0xA9,
UploadData = 0xAA, ClearScriptBuffer = 0xAB, UploadDataNoLen = 0xAC, UploadData = 0xAA, ClearScriptBuffer = 0xAB, UploadDataNoLen = 0xAC,
@ -94,7 +94,7 @@ public:
bool setTarget(); bool setTarget();
bool setFastProgramming(bool fast); bool setFastProgramming(bool fast);
virtual bool readVoltages(VoltagesData &voltagesData); virtual bool readVoltages(VoltagesData &voltagesData);
bool readStatus(ushort &status); bool readtqStatus(ushort &status);
bool readMemory(Pic::MemoryRangeType type, ::Device::Array &data, const ::Programmer::VerifyData *vdata); bool readMemory(Pic::MemoryRangeType type, ::Device::Array &data, const ::Programmer::VerifyData *vdata);
bool writeMemory(Pic::MemoryRangeType type, const ::Device::Array &data, bool force); bool writeMemory(Pic::MemoryRangeType type, const ::Device::Array &data, bool force);
bool eraseAll(); bool eraseAll();

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

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

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

@ -45,7 +45,7 @@ public:
virtual bool setBreakpoints(const TQValueList<Address> &list); virtual bool setBreakpoints(const TQValueList<Address> &list);
virtual bool readRegister(const Register::TypeData &data, BitValue &value); virtual bool readRegister(const Register::TypeData &data, BitValue &value);
virtual bool writeRegister(const Register::TypeData &data, BitValue value); virtual bool writeRegister(const Register::TypeData &data, BitValue value);
virtual bool updatePortStatus(uint index, TQMap<uint, Device::PortBitData> &bits); virtual bool updatePorttqStatus(uint index, TQMap<uint, Device::PortBitData> &bits);
private: private:
uint _nbBreakpoints; uint _nbBreakpoints;

@ -81,12 +81,12 @@ bool TinyBootloader::Hardware::verifyDeviceId()
for (uint i=0; i<uint(list.count()); i++) for (uint i=0; i<uint(list.count()); i++)
if ( _id==data(list[i]).id ) devices.append(list[i]); if ( _id==data(list[i]).id ) devices.append(list[i]);
if ( _id!=id ) { if ( _id!=id ) {
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))); 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).").arg(devices.join(" ")).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).").tqarg(devices.join(" ")).tqarg(toHexLabel(_id, 2)).tqarg(toHexLabel(id, 2)));
// we can't ask for "continue anyway?" because bootloader can timeout... // we can't ask for "continue anyway?" because bootloader can timeout...
return false; return false;
} }
log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").arg(devices.join(" "))); log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").tqarg(devices.join(" ")));
return true; return true;
} }
@ -101,10 +101,10 @@ bool TinyBootloader::Hardware::waitReady(bool *checkCRC)
if (checkCRC) { if (checkCRC) {
*checkCRC = false; *checkCRC = false;
if ( c=='N' ) return true; if ( c=='N' ) return true;
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").arg(toPrintable(c, PrintAlphaNum))); log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").tqarg(toPrintable(c, PrintAlphaNum)));
return true; return true;
} }
log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").arg(toPrintable(c, PrintAlphaNum))); log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").tqarg(toPrintable(c, PrintAlphaNum)));
return false; return false;
} }
@ -160,7 +160,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase)
for (uint i=nb; i<data.size(); i++) { for (uint i=nb; i<data.size(); i++) {
if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue; if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue;
uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i; 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.").arg(toHexLabel(address, device().nbCharsAddress()))); log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress())));
break; break;
} }
@ -206,7 +206,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase)
if ( !sendCodeAddress(address, crc) ) return false; if ( !sendCodeAddress(address, crc) ) return false;
uint nbw = device().nbBytesWord(Pic::MemoryRangeType::Code); uint nbw = device().nbBytesWord(Pic::MemoryRangeType::Code);
if ( !sendChar(nbw*nbWords, &crc) ) return false; if ( !sendChar(nbw*nbWords, &crc) ) return false;
log(Log::DebugLevel::Normal, TQString("write code memory at %1: %2 bytes").arg(toHexLabel(address, 4)).arg(2*nbWords)); log(Log::DebugLevel::Normal, TQString("write code memory at %1: %2 bytes").tqarg(toHexLabel(address, 4)).tqarg(2*nbWords));
for(uint k=0; k<nbWords; k++) { 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(0), &crc) ) return false; // data low
if ( !sendChar(wdata[i+k].byte(1), &crc) ) return false; // data high 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(); const_cast<Tool::Group *>(this)->checkInitSupported();
if ( hasCheckDevicesError() ) 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?").arg(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?").tqarg(label())) : false);
if ( !device.isEmpty() && device!=Device::AUTO_DATA.name && !isSupported(device) ) 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?").arg(label()).arg(device)) : false); return (log ? log->askContinue(i18n("The selected toolchain (%1) does not support device %2. Continue anyway?").tqarg(label()).tqarg(device)) : false);
return true; return true;
} }

@ -19,7 +19,7 @@ bool Boost::CompilerBasic::checkExecutableResult(bool, TQStringList &lines) cons
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
TQString Boost::GroupBasic::informationText() const TQString Boost::GroupBasic::informationText() const
{ {
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"); 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");
} }
Tool::SourceGenerator *Boost::GroupBasic::sourceGeneratorFactory() const Tool::SourceGenerator *Boost::GroupBasic::sourceGeneratorFactory() const

@ -19,7 +19,7 @@ bool Boost::CompilerC::checkExecutableResult(bool, TQStringList &lines) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
TQString Boost::GroupC::informationText() const TQString Boost::GroupC::informationText() const
{ {
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"); 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");
} }
Tool::SourceGenerator *Boost::GroupC::sourceGeneratorFactory() const Tool::SourceGenerator *Boost::GroupC::sourceGeneratorFactory() const

@ -20,7 +20,7 @@ bool Boost::CompilerCpp::checkExecutableResult(bool, TQStringList &lines) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
TQString Boost::GroupCpp::informationText() const TQString Boost::GroupCpp::informationText() const
{ {
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"); 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");
} }
Tool::SourceGenerator *Boost::GroupCpp::sourceGeneratorFactory() const 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 TQString C18::Group::informationText() const
{ {
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"); 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");
} }

@ -52,7 +52,7 @@ Compile::Config *CC5X::Group::configFactory(::Project *project) const
TQString CC5X::Group::informationText() const TQString CC5X::Group::informationText() const
{ {
return i18n("<a href=\"%1\">CC5X</a> is a C compiler distributed by B Knudsen Data.").arg("http://www.bknd.com/cc5x/index.shtml"); return i18n("<a href=\"%1\">CC5X</a> is a C compiler distributed by B Knudsen Data.").tqarg("http://www.bknd.com/cc5x/index.shtml");
} }
Tool::Group::BaseData CC5X::Group::baseFactory(Tool::Category category) const 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 TQString CCSC::Group::informationText() const
{ {
return i18n("<a href=\"%1\">CCS Compiler</a> is a C compiler distributed by CCS.").arg("http://www.ccsinfo.com/content.php?page=compilers"); return i18n("<a href=\"%1\">CCS Compiler</a> is a C compiler distributed by CCS.").tqarg("http://www.ccsinfo.com/content.php?page=compilers");
} }
Tool::Group::BaseData CCSC::Group::baseFactory(Tool::Category category) const 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"); PURL::Url url = PURL::Url(directory(), inputFilepath(0)).toExtension("err");
Log::StringView sview; Log::StringView sview;
PURL::File file(url, sview); PURL::File file(url, sview);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").arg(url.pretty()), TQString(), 0); if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").tqarg(url.pretty()), TQString(), 0);
else { else {
TQStringList lines = file.readLines(); TQStringList lines = file.readLines();
for (uint i=0; i<lines.count(); i++) parseLine(lines[i]); 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 TQString GPUtils::Group::informationText() const
{ {
return i18n("<a href=\"%1\">GPUtils</a> is an open-source assembler and linker suite.<br>").arg("http://gputils.sourceforge.net"); return i18n("<a href=\"%1\">GPUtils</a> is an open-source assembler and linker suite.<br>").tqarg("http://gputils.sourceforge.net");
} }
Tool::Group::BaseData GPUtils::Group::baseFactory(Tool::Category category) const Tool::Group::BaseData GPUtils::Group::baseFactory(Tool::Category category) const

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

@ -11,7 +11,7 @@
#define TOOL_CONFIG_WIDGET_H #define TOOL_CONFIG_WIDGET_H
#include <tqcombobox.h> #include <tqcombobox.h>
#include <layout.h> #include <tqlayout.h>
#include <tqtabwidget.h> #include <tqtabwidget.h>
#include <tqvaluevector.h> #include <tqvaluevector.h>
#include <kcombobox.h> #include <kcombobox.h>

@ -10,7 +10,7 @@
#include "toolchain_config_center.h" #include "toolchain_config_center.h"
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <kiconloader.h> #include <kiconloader.h>
#include "tools/list/tools_config_widget.h" #include "tools/list/tools_config_widget.h"

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

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

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

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

@ -47,7 +47,7 @@ Compile::Config *MPC::Group::configFactory(::Project *project) const
TQString MPC::Group::informationText() const TQString MPC::Group::informationText() const
{ {
return i18n("<a href=\"%1\">MPC Compiler</a> is a C compiler distributed by Byte Craft.").arg("http://www.bytecraft.com/mpccaps.html"); return i18n("<a href=\"%1\">MPC Compiler</a> is a C compiler distributed by Byte Craft.").tqarg("http://www.bytecraft.com/mpccaps.html");
} }
Tool::Group::BaseData MPC::Group::baseFactory(Tool::Category category) const 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"); PURL::Url url = PURL::Url(directory(), inputFilepath(0)).toExtension("err");
Log::StringView sview; Log::StringView sview;
PURL::File file(url, sview); PURL::File file(url, sview);
if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").arg(url.pretty()), TQString(), 0); if ( !file.openForRead() ) doLog(Log::LineType::Error, i18n("Could not find error file (%1).").tqarg(url.pretty()), TQString(), 0);
else { else {
TQStringList lines = file.readLines(); TQStringList lines = file.readLines();
for (uint i=0; i<lines.count(); i++) parseLine(lines[i]); 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 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.").arg("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.").tqarg("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 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 TQString PICC::PICCLiteGroup::informationText() const
{ {
return i18n("<a href=\"%1\">PICC-Lite</a> is a freeware C compiler distributed by HTSoft.").arg("http://www.htsoft.com"); return i18n("<a href=\"%1\">PICC-Lite</a> is a freeware C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
} }
Tool::Group::BaseData PICC::PICCLiteGroup::baseFactory(Tool::Category category) const 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 TQString PICC::PICCGroup::informationText() const
{ {
return i18n("<a href=\"%1\">PICC</a> is a C compiler distributed by HTSoft.").arg("http://www.htsoft.com"); return i18n("<a href=\"%1\">PICC</a> is a C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
} }
Tool::Group::BaseData PICC::PICCGroup::baseFactory(Tool::Category category) const 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 TQString PICC::PICC18Group::informationText() const
{ {
return i18n("<a href=\"%1\">PICC 18</a> is a C compiler distributed by HTSoft.").arg("http://www.htsoft.com"); return i18n("<a href=\"%1\">PICC 18</a> is a C compiler distributed by HTSoft.").tqarg("http://www.htsoft.com");
} }
Tool::Group::BaseData PICC::PICC18Group::baseFactory(Tool::Category category) const 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 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.").arg("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.").tqarg("http://sdcc.sourceforge.net");
} }
const ::Tool::Base *SDCC::Group::base(Tool::Category category) const const ::Tool::Base *SDCC::Group::base(Tool::Category category) const

@ -10,7 +10,7 @@
#include <tqdir.h> #include <tqdir.h>
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
#include <tqregexp.h> #include <tqregexp.h>
bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special special, TQDomElement element) bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special special, TQDomElement element)
@ -84,27 +84,27 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
{ {
TQString name = device.attribute("name").upper(); TQString name = device.attribute("name").upper();
if ( name.isEmpty() ) qFatal("Device has no name"); if ( name.isEmpty() ) qFatal("Device has no name");
if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").arg(name)); if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").tqarg(name));
_data = createData(); _data = createData();
_map[name] = _data; _map[name] = _data;
_data->_name = name; _data->_name = name;
_data->_alternatives = TQStringList::split(' ', device.attribute("alternative")); _data->_alternatives = TQStringList::split(' ', device.attribute("alternative"));
if ( _data->_alternatives.count() ) _alternatives[name] = _data->_alternatives; if ( _data->_alternatives.count() ) _alternatives[name] = _data->_alternatives;
_data->_status = Status::fromKey(device.attribute("status")); _data->_status = tqStatus::fromKey(device.attribute("status"));
switch (_data->_status.type()) { switch (_data->_status.type()) {
case Status::Nb_Types: case tqStatus::Nb_Types:
qFatal("Unrecognized or absent device status"); qFatal("Unrecognized or absent device status");
break; break;
case Status::Future: case tqStatus::Future:
if ( _data->_alternatives.count() ) qFatal("Future device has alternative"); if ( _data->_alternatives.count() ) qFatal("Future device has alternative");
break; break;
case Status::NotRecommended: case tqStatus::NotRecommended:
case Status::Mature: case tqStatus::Mature:
if ( _data->_alternatives.count()==0 ) warning("Not-recommended/mature device has no alternative"); if ( _data->_alternatives.count()==0 ) warning("Not-recommended/mature device has no alternative");
break; break;
case Status::InProduction: case tqStatus::InProduction:
case Status::EOL: case tqStatus::EOL:
case Status::Unknown: break; case tqStatus::Unknown: break;
} }
// document // document
@ -119,26 +119,26 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
_data->_documents.datasheet = documents.attribute("datasheet"); _data->_documents.datasheet = documents.attribute("datasheet");
TQRegExp rexp("\\d{5}"); TQRegExp rexp("\\d{5}");
if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified"); if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified");
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet)); if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").tqarg(_data->_documents.datasheet));
_data->_documents.progsheet = documents.attribute("progsheet"); _data->_documents.progsheet = documents.attribute("progsheet");
if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified"); if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified");
if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet)); if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").tqarg(_data->_documents.progsheet));
_data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas")); _data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas"));
for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) { for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) {
TQString errata = _data->_documents.erratas[i]; TQString errata = _data->_documents.erratas[i];
if ( !rexp.exactMatch(errata) ) { if ( !rexp.exactMatch(errata) ) {
TQRegExp rexp2("\\d{5}e\\d"); TQRegExp rexp2("\\d{5}e\\d");
if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() ) 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)").arg(errata)); qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").tqarg(errata));
} }
} }
} }
if ( _data->_documents.webpage=="?" ) warning("No webpage specified"); if ( _data->_documents.webpage=="?" ) warning("No webpage specified");
else { else {
TQRegExp rexp("\\d{6}"); TQRegExp rexp("\\d{6}");
if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage)); if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").tqarg(_data->_documents.webpage));
if ( _documents.contains(_data->_documents.webpage) ) if ( _documents.contains(_data->_documents.webpage) )
qFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage])); qFatal(TQString("webpage duplicated (already used for %1)").tqarg(_documents[_data->_documents.webpage]));
_documents[_data->_documents.webpage] = name; _documents[_data->_documents.webpage] = name;
} }
@ -194,21 +194,21 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
for (; Package::TYPE_DATA[i].name; i++) { for (; Package::TYPE_DATA[i].name; i++) {
if ( types[k]!=Package::TYPE_DATA[i].name ) continue; if ( types[k]!=Package::TYPE_DATA[i].name ) continue;
for (uint j=0; j<uint(package.types.count()); j++) for (uint j=0; j<uint(package.types.count()); j++)
if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k])); if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").tqarg(types[k]));
uint j = 0; uint j = 0;
for (; j<Package::MAX_NB; j++) for (; j<Package::MAX_NB; j++)
if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break; 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)").arg(types[k]).arg(nb).arg(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)").tqarg(types[k]).tqarg(nb).tqarg(Package::TYPE_DATA[i].nbPins[0]));
package.types.append(i); package.types.append(i);
break; break;
} }
if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").arg(types[k])); if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").tqarg(types[k]));
} }
// pins // pins
TQString name = Package::TYPE_DATA[package.types[0]].name; TQString name = Package::TYPE_DATA[package.types[0]].name;
if ( name=="sot23" ) { if ( name=="sot23" ) {
if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package"); 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\"").arg(name)); } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").tqarg(name));
uint have_pins = false; uint have_pins = false;
TQMemArray<bool> found(nb); TQMemArray<bool> found(nb);
found.fill(false); found.fill(false);
@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
child = child.nextSibling(); child = child.nextSibling();
} }
if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !! 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").arg(i+1)); else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").tqarg(i+1));
return package; return package;
} }
@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse()
for (; ait!=_alternatives.end(); ++ait) { for (; ait!=_alternatives.end(); ++ait) {
TQStringList::const_iterator lit = ait.data().begin(); TQStringList::const_iterator lit = ait.data().begin();
for (; lit!=ait.data().end(); ++lit) for (; lit!=ait.data().end(); ++lit)
if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key())); if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").tqarg((*lit)).tqarg(ait.key()));
} }
} }

@ -11,7 +11,7 @@
#include <tqmap.h> #include <tqmap.h>
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
#include "common/common/misc.h" #include "common/common/misc.h"
#include "common/common/streamer.h" #include "common/common/streamer.h"

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

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

@ -13,7 +13,7 @@
* *
* Use PICCLITE to compile this program for the PIC16F877. * Use PICCLITE to compile this program for the PIC16F877.
* *
* Status: Sept 25, 2003 * tqStatus: Sept 25, 2003
* Working. The code is pretty brute force and the resolution isn't * Working. The code is pretty brute force and the resolution isn't
* what I expected. Need to review calculations for angle vs. accel * what I expected. Need to review calculations for angle vs. accel
* (gravity). I determined the zero offsets empirically and hard coded * (gravity). I determined the zero offsets empirically and hard coded

@ -10,7 +10,7 @@
* *
* Use PICCLITE to compile this program for the PIC16F877. * Use PICCLITE to compile this program for the PIC16F877.
* *
* Status: Sept 25, 2003 * tqStatus: Sept 25, 2003
* Working. The code is pretty brute force and the resolution isn't * Working. The code is pretty brute force and the resolution isn't
* what I expected. Need to review calculations for angle vs. accel * what I expected. Need to review calculations for angle vs. accel
* (gravity). I determined the zero offsets empirically and hard coded * (gravity). I determined the zero offsets empirically and hard coded

Loading…
Cancel
Save