diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:57:30 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:57:30 -0600 |
commit | ad1fc5fc8eadb9b63e8767e57ac41cbac84f7eb7 (patch) | |
tree | c47273eb6595f763c282d33fb89affe1f8866120 /src/xml_to_data | |
parent | 9d6927a7d6a543332f828bffedf65eecf6774c6d (diff) | |
download | piklab-ad1fc5fc8eadb9b63e8767e57ac41cbac84f7eb7.tar.gz piklab-ad1fc5fc8eadb9b63e8767e57ac41cbac84f7eb7.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 9d6927a7d6a543332f828bffedf65eecf6774c6d.
Diffstat (limited to 'src/xml_to_data')
-rw-r--r-- | src/xml_to_data/device_xml_to_data.cpp | 42 | ||||
-rw-r--r-- | src/xml_to_data/device_xml_to_data.h | 2 | ||||
-rw-r--r-- | src/xml_to_data/prog_xml_to_data.h | 12 | ||||
-rw-r--r-- | src/xml_to_data/xml_to_data.cpp | 8 |
4 files changed, 32 insertions, 32 deletions
diff --git a/src/xml_to_data/device_xml_to_data.cpp b/src/xml_to_data/device_xml_to_data.cpp index c0861d4..c1d41ac 100644 --- a/src/xml_to_data/device_xml_to_data.cpp +++ b/src/xml_to_data/device_xml_to_data.cpp @@ -10,7 +10,7 @@ #include <tqdir.h> #include <tqfile.h> -#include <textstream.h> +#include <tqtextstream.h> #include <tqregexp.h> 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(); 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(); _map[name] = _data; _data->_name = name; _data->_alternatives = TQStringList::split(' ', device.attribute("alternative")); 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()) { - case Status::Nb_Types: + case tqStatus::Nb_Types: qFatal("Unrecognized or absent device status"); break; - case Status::Future: + case tqStatus::Future: if ( _data->_alternatives.count() ) qFatal("Future device has alternative"); break; - case Status::NotRecommended: - case Status::Mature: + case tqStatus::NotRecommended: + case tqStatus::Mature: if ( _data->_alternatives.count()==0 ) warning("Not-recommended/mature device has no alternative"); break; - case Status::InProduction: - case Status::EOL: - case Status::Unknown: break; + case tqStatus::InProduction: + case tqStatus::EOL: + case tqStatus::Unknown: break; } // document @@ -119,26 +119,26 @@ void Device::XmlToDataBase::processDevice(TQDomElement device) _data->_documents.datasheet = documents.attribute("datasheet"); TQRegExp rexp("\\d{5}"); if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified"); - if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").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"); 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")); for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) { TQString errata = _data->_documents.erratas[i]; if ( !rexp.exactMatch(errata) ) { TQRegExp rexp2("\\d{5}e\\d"); if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() ) - qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").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"); else { 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) ) - 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; } @@ -194,21 +194,21 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element) for (; Package::TYPE_DATA[i].name; i++) { if ( types[k]!=Package::TYPE_DATA[i].name ) continue; for (uint j=0; j<uint(package.types.count()); j++) - if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k])); + if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").tqarg(types[k])); uint j = 0; for (; j<Package::MAX_NB; j++) if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break; - if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").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); 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 TQString name = Package::TYPE_DATA[package.types[0]].name; if ( name=="sot23" ) { if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package"); - } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name)); + } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").tqarg(name)); uint have_pins = false; TQMemArray<bool> found(nb); found.fill(false); @@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element) child = child.nextSibling(); } if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !! - else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").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; } @@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse() for (; ait!=_alternatives.end(); ++ait) { TQStringList::const_iterator lit = ait.data().begin(); for (; lit!=ait.data().end(); ++lit) - if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key())); + if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").tqarg((*lit)).tqarg(ait.key())); } } diff --git a/src/xml_to_data/device_xml_to_data.h b/src/xml_to_data/device_xml_to_data.h index 9a065a0..36b8824 100644 --- a/src/xml_to_data/device_xml_to_data.h +++ b/src/xml_to_data/device_xml_to_data.h @@ -11,7 +11,7 @@ #include <tqmap.h> #include <tqfile.h> -#include <textstream.h> +#include <tqtextstream.h> #include "common/common/misc.h" #include "common/common/streamer.h" diff --git a/src/xml_to_data/prog_xml_to_data.h b/src/xml_to_data/prog_xml_to_data.h index b9f6a5f..e45e6e1 100644 --- a/src/xml_to_data/prog_xml_to_data.h +++ b/src/xml_to_data/prog_xml_to_data.h @@ -10,7 +10,7 @@ #define PROG_XML_TO_DATA_H #include <tqfile.h> -#include <textstream.h> +#include <tqtextstream.h> #include <tqmap.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\""); _current = element.attribute("name").upper(); - if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").arg(_current)); - if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").arg(_current)); + if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").tqarg(_current)); + if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").tqarg(_current)); PData data; if ( hasFamilies() ) { 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); data.family = familyIndex(family); } @@ -88,7 +88,7 @@ void ExtXmlToData<Data>::parse() TQDomDocument doc = parseFile(_basename + ".xml"); TQDomElement root = doc.documentElement(); if ( root.nodeName()!="type" ) qFatal("Root node should be \"type\""); - if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").arg(_basename)); + if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").tqarg(_basename)); TQDomNode child = root.firstChild(); while ( !child.isNull() ) { if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1()); @@ -105,7 +105,7 @@ void ExtXmlToData<Data>::output() { // write .cpp file TQFile file(_basename + "_data.cpp"); - if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").arg(file.name())); + if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").tqarg(file.name())); TQTextStream s(&file); s << "// #### Do not edit: this file is autogenerated !!!" << endl << endl; s << "#include \"devices/list/device_list.h\"" << endl; diff --git a/src/xml_to_data/xml_to_data.cpp b/src/xml_to_data/xml_to_data.cpp index ee6a204..8e14d81 100644 --- a/src/xml_to_data/xml_to_data.cpp +++ b/src/xml_to_data/xml_to_data.cpp @@ -9,7 +9,7 @@ #include "xml_to_data.h" #include <tqfile.h> -#include <textstream.h> +#include <tqtextstream.h> TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &tag, const TQString &attribute, const TQString &value) const @@ -19,7 +19,7 @@ TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &t while ( !child.isNull() ) { if ( child.nodeName()==tag && child.isElement() && (attribute.isEmpty() || child.toElement().attribute(attribute)==value) ) { - if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").arg(tag).arg(value)); + if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").tqarg(tag).tqarg(value)); element = child.toElement(); } child = child.nextSibling(); @@ -34,7 +34,7 @@ void XmlToData::checkTagNames(TQDomElement element, const TQString &tag, for (uint i=0; i<uint(list.count()); i++) { if ( !list.item(i).isElement() ) continue; TQString name = list.item(i).toElement().attribute("name"); - if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").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; int 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; } |