diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/src/dtds.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/src/dtds.cpp')
-rw-r--r-- | quanta/src/dtds.cpp | 274 |
1 files changed, 137 insertions, 137 deletions
diff --git a/quanta/src/dtds.cpp b/quanta/src/dtds.cpp index 44fba0ab..9943904a 100644 --- a/quanta/src/dtds.cpp +++ b/quanta/src/dtds.cpp @@ -19,11 +19,11 @@ ***************************************************************************/ //qt includes -#include <qfile.h> +#include <tqfile.h> #include <qextfileinfo.h> -#include <qdom.h> -#include <qcursor.h> -#include <qtimer.h> +#include <tqdom.h> +#include <tqcursor.h> +#include <tqtimer.h> // include files for KDE #include <kapplication.h> @@ -50,36 +50,36 @@ #include "dtds.h" /** filename for the desciption of the dtd */ -const QString m_rcFilename("description.rc"); +const TQString m_rcFilename("description.rc"); /** This constructor reads the dictionary of known dtd's, the attributes and tags will be loaded on the first access to one dtd. */ -DTDs::DTDs(QObject *parent) - :QObject(parent) +DTDs::DTDs(TQObject *parent) + :TQObject(parent) { - connect(this, SIGNAL(hideSplash()), parent, SLOT(slotHideSplash())); - connect(this, SIGNAL(enableIdleTimer(bool)), parent, SLOT(slotEnableIdleTimer(bool))); - connect(this, SIGNAL(loadToolbarForDTD(const QString&)), parent, SLOT(slotLoadToolbarForDTD(const QString&))); + connect(this, TQT_SIGNAL(hideSplash()), parent, TQT_SLOT(slotHideSplash())); + connect(this, TQT_SIGNAL(enableIdleTimer(bool)), parent, TQT_SLOT(slotEnableIdleTimer(bool))); + connect(this, TQT_SIGNAL(loadToolbarForDTD(const TQString&)), parent, TQT_SLOT(slotLoadToolbarForDTD(const TQString&))); // kdDebug(24000) << "dtds::dtds" << endl; - m_dict = new QDict<DTDStruct>(119, false); //optimized for max 119 DTD. This should be enough. + m_dict = new TQDict<DTDStruct>(119, false); //optimized for max 119 DTD. This should be enough. m_dict->setAutoDelete(true); - m_doc = new QDomDocument(); + m_doc = new TQDomDocument(); - QString localKDEdir = KGlobal::instance()->dirs()->localkdedir(); - QStringList tagsResourceDirs = KGlobal::instance()->dirs()->findDirs("appdata", "dtep"); - QStringList tagsDirs; - QStringList::ConstIterator end = tagsResourceDirs.constEnd(); - for ( QStringList::ConstIterator it = tagsResourceDirs.constBegin(); it != end; ++it ) + TQString localKDEdir = KGlobal::instance()->dirs()->localkdedir(); + TQStringList tagsResourceDirs = KGlobal::instance()->dirs()->findDirs("appdata", "dtep"); + TQStringList tagsDirs; + TQStringList::ConstIterator end = tagsResourceDirs.constEnd(); + for ( TQStringList::ConstIterator it = tagsResourceDirs.constBegin(); it != end; ++it ) { if ((*it).startsWith(localKDEdir)) { - QDir dir(*it); - dir.setFilter(QDir::Dirs); - QStringList subDirs = dir.entryList(); - QStringList::ConstIterator subitEnd = subDirs.constEnd(); - for ( QStringList::ConstIterator subit = subDirs.constBegin(); subit != subitEnd; ++subit ) + TQDir dir(*it); + dir.setFilter(TQDir::Dirs); + TQStringList subDirs = dir.entryList(); + TQStringList::ConstIterator subitEnd = subDirs.constEnd(); + for ( TQStringList::ConstIterator subit = subDirs.constBegin(); subit != subitEnd; ++subit ) { // kdDebug(24000) << "dtds::dtds add:" << *it + *subit+"/" << endl; if ((*subit != ".") && (*subit != "..")) @@ -87,15 +87,15 @@ DTDs::DTDs(QObject *parent) } } } - for ( QStringList::ConstIterator it = tagsResourceDirs.constBegin(); it != end; ++it ) + for ( TQStringList::ConstIterator it = tagsResourceDirs.constBegin(); it != end; ++it ) { if (!(*it).startsWith(localKDEdir)) { - QDir dir(*it); - dir.setFilter(QDir::Dirs); - QStringList subDirs = dir.entryList(); - QStringList::ConstIterator subitEnd = subDirs.constEnd(); - for ( QStringList::ConstIterator subit = subDirs.constBegin(); subit != subitEnd; ++subit ) + TQDir dir(*it); + dir.setFilter(TQDir::Dirs); + TQStringList subDirs = dir.entryList(); + TQStringList::ConstIterator subitEnd = subDirs.constEnd(); + for ( TQStringList::ConstIterator subit = subDirs.constBegin(); subit != subitEnd; ++subit ) { // kdDebug(24000) << "dtds::dtds add2:" << *it + *subit+"/" << endl; if ((*subit != ".") && (*subit != "..")) @@ -104,17 +104,17 @@ DTDs::DTDs(QObject *parent) } } // kdDebug(24000) << tagsDirs.count() << " folders found." << endl; - QTime t; + TQTime t; t.start(); - QStringList::ConstIterator tagsDirsEnd = tagsDirs.constEnd(); - for ( QStringList::ConstIterator it = tagsDirs.constBegin(); it != tagsDirsEnd; ++it ) + TQStringList::ConstIterator tagsDirsEnd = tagsDirs.constEnd(); + for ( TQStringList::ConstIterator it = tagsDirs.constBegin(); it != tagsDirsEnd; ++it ) { // kdDebug(24000) << "read:" << *it << endl; readTagDir(*it, false); // read all tags, but only short form } kdDebug(24000) << "DTD reading: " << t.elapsed() << endl; //load the mimetypes from the insideDTDs - QDictIterator<DTDStruct> it(*m_dict); + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { DTDStruct * dtd = it.current(); @@ -133,7 +133,7 @@ DTDs::DTDs(QObject *parent) DTDs::~DTDs() { - QDictIterator<DTDStruct> it(*m_dict); + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { removeDTD (it.current()); @@ -159,15 +159,15 @@ void DTDs::removeDTD(DTDStruct *dtd) /** Reads the tag files and the description.rc from tagDir in order to build up the internal DTD and tag structures. */ -bool DTDs::readTagDir(const QString &dirName, bool loadAll) +bool DTDs::readTagDir(const TQString &dirName, bool loadAll) { // kdDebug(24000) << "dtds::readTagDir:" << dirName << " all:" << loadAll << endl; - QString tmpStr = dirName + m_rcFilename; - if (!QFile::exists(tmpStr)) + TQString tmpStr = dirName + m_rcFilename; + if (!TQFile::exists(tmpStr)) return false; KConfig *dtdConfig = new KConfig(tmpStr, true); dtdConfig->setGroup("General"); - QString dtdName = dtdConfig->readEntry("Name", "Unknown"); + TQString dtdName = dtdConfig->readEntry("Name", "Unknown"); if (m_dict->find(dtdName.lower())) { delete dtdConfig; @@ -194,14 +194,14 @@ bool DTDs::readTagDir(const QString &dirName, bool loadAll) //Read the areas that define the areas dtdConfig->setGroup("Parsing rules"); - QStringList definitionAreaBorders = dtdConfig->readListEntry("AreaBorders"); + TQStringList definitionAreaBorders = dtdConfig->readListEntry("AreaBorders"); for (uint i = 0; i < definitionAreaBorders.count(); i++) { - QStringList tmpStrList = QStringList::split(" ", definitionAreaBorders[i].stripWhiteSpace()); + TQStringList tmpStrList = TQStringList::split(" ", definitionAreaBorders[i].stripWhiteSpace()); dtd->definitionAreas[tmpStrList[0].stripWhiteSpace()] = tmpStrList[1].stripWhiteSpace(); } //Read the tags that define this DTD - QStringList tmpStrList = dtdConfig->readListEntry("Tags"); + TQStringList tmpStrList = dtdConfig->readListEntry("Tags"); for (uint i = 0; i < tmpStrList.count(); i++) { tmpStr = tmpStrList[i].stripWhiteSpace(); @@ -237,9 +237,9 @@ bool DTDs::readTagDir2(DTDStruct *dtd) { // kdDebug(24000) << "dtds::readTagDir2:" << dtd->name << " at " << dtd->fileName << endl; - if (!QFile::exists(dtd->fileName)) return false; + if (!TQFile::exists(dtd->fileName)) return false; - kapp->setOverrideCursor( QCursor(Qt::WaitCursor) ); + kapp->setOverrideCursor( TQCursor(Qt::WaitCursor) ); KConfig *dtdConfig = new KConfig(dtd->fileName, true); @@ -269,15 +269,15 @@ bool DTDs::readTagDir2(DTDStruct *dtd) //read all the tag files KURL dirURL(dtd->fileName); dirURL.setFileName(""); - QString dirName = dirURL.path(1); - if (QFile::exists(dirName + "common.tag")) + TQString dirName = dirURL.path(1); + if (TQFile::exists(dirName + "common.tag")) readTagFile(dirName + "common.tag", dtd, 0L); //bool idleTimerStatus = quantaApp->slotEnableIdleTimer(false); emit enableIdleTimer(false); KURL::List files = QExtFileInfo::allFilesRelative(dirURL, "*.tag", 0L); //quantaApp->slotEnableIdleTimer(idleTimerStatus); emit enableIdleTimer(true); - QString tmpStr; + TQString tmpStr; KURL::List::ConstIterator end_f = files.constEnd(); for ( KURL::List::ConstIterator it_f = files.constBegin(); it_f != end_f; ++it_f ) { @@ -306,15 +306,15 @@ bool DTDs::readTagDir2(DTDStruct *dtd) //read the extra tags and their attributes dtdConfig->setGroup("Extra tags"); dtd->defaultAttrType = dtdConfig->readEntry("DefaultAttrType","input"); - QStrList extraTagsList; + TQStrList extraTagsList; dtdConfig->readListEntry("List",extraTagsList); - QString option; - QStrList optionsList; - QStrList attrList; + TQString option; + TQStrList optionsList; + TQStrList attrList; for (uint i = 0 ; i < extraTagsList.count(); i++) { QTag *tag = new QTag(); - tag->setName(QString(extraTagsList.at(i)).stripWhiteSpace()); + tag->setName(TQString(extraTagsList.at(i)).stripWhiteSpace()); tmpStr = (dtd->caseSensitive) ? tag->name() : tag->name().upper(); if (tagList->find(tmpStr)) //the tag is already defined in a .tag file @@ -324,11 +324,11 @@ bool DTDs::readTagDir2(DTDStruct *dtd) } tag->parentDTD = dtd; //read the possible stopping tags - QStrList stoppingTags; + TQStrList stoppingTags; dtdConfig->readListEntry(tag->name() + "_stoppingtags",stoppingTags); for (uint j = 0; j < stoppingTags.count(); j++) { - QString stopTag = QString(stoppingTags.at(j)).stripWhiteSpace(); + TQString stopTag = TQString(stoppingTags.at(j)).stripWhiteSpace(); if (!dtd->caseSensitive) stopTag = stopTag.upper(); tag->stoppingTags.append(stopTag); } @@ -337,14 +337,14 @@ bool DTDs::readTagDir2(DTDStruct *dtd) dtdConfig->readListEntry(tag->name() + "_options",optionsList); for (uint j = 0; j < optionsList.count(); j++) { - option = QString(optionsList.at(j)).stripWhiteSpace(); - QDictIterator<AttributeList> it(*(dtd->commonAttrs)); + option = TQString(optionsList.at(j)).stripWhiteSpace(); + TQDictIterator<AttributeList> it(*(dtd->commonAttrs)); for( ; it.current(); ++it ) { - tmpStr = "has" + QString(it.currentKey()).stripWhiteSpace(); + tmpStr = "has" + TQString(it.currentKey()).stripWhiteSpace(); if (option == tmpStr) { - tag->commonGroups += QString(it.currentKey()).stripWhiteSpace(); + tag->commonGroups += TQString(it.currentKey()).stripWhiteSpace(); } } if (option == "single") @@ -361,7 +361,7 @@ bool DTDs::readTagDir2(DTDStruct *dtd) for (uint j = 0; j < attrList.count(); j++) { Attribute* attr = new Attribute; - attr->name = QString(attrList.at(j)).stripWhiteSpace(); + attr->name = TQString(attrList.at(j)).stripWhiteSpace(); attr->type = dtd->defaultAttrType; tag->addAttribute(attr); delete attr; @@ -383,7 +383,7 @@ bool DTDs::readTagDir2(DTDStruct *dtd) dtdConfig->setGroup("Parsing rules"); bool appendCommonRules = dtdConfig->readBoolEntry("AppendCommonSpecialAreas", true); //Read the special areas and area names - QString rxStr = ""; + TQString rxStr = ""; if (dtd->family == Xml && appendCommonRules) { dtd->specialAreas["<?xml"] = "?>"; @@ -396,14 +396,14 @@ bool DTDs::readTagDir2(DTDStruct *dtd) tmpStr = "(<?xml)|(<!--)|(<!)|"; rxStr = QuantaCommon::makeRxCompatible(tmpStr); } - QStringList specialAreasList = dtdConfig->readListEntry("SpecialAreas"); - QStringList specialAreaNameList = dtdConfig->readListEntry("SpecialAreaNames"); - QStringList tmpStrList; + TQStringList specialAreasList = dtdConfig->readListEntry("SpecialAreas"); + TQStringList specialAreaNameList = dtdConfig->readListEntry("SpecialAreaNames"); + TQStringList tmpStrList; for (uint i = 0; i < specialAreasList.count(); i++) { if (!specialAreasList[i].stripWhiteSpace().isEmpty()) { - tmpStrList = QStringList::split(" ",specialAreasList[i].stripWhiteSpace()); + tmpStrList = TQStringList::split(" ",specialAreasList[i].stripWhiteSpace()); tmpStr = tmpStrList[0].stripWhiteSpace(); rxStr.append(QuantaCommon::makeRxCompatible(tmpStr)+"|"); dtd->specialAreas[tmpStr] = tmpStrList[1].stripWhiteSpace(); @@ -426,15 +426,15 @@ bool DTDs::readTagDir2(DTDStruct *dtd) dtd->specialTags[tmpStr.left(pos).stripWhiteSpace()] = tmpStr.mid(pos+1, tmpStr.findRev(')')-pos-1).stripWhiteSpace(); } - //static const QString quotationStr = "\\\\\"|\\\\'"; + //static const TQString quotationStr = "\\\\\"|\\\\'"; rxStr = "\\\\\"|\\\\'|"; - QStringList commentsList = dtdConfig->readListEntry("Comments"); + TQStringList commentsList = dtdConfig->readListEntry("Comments"); if (dtd->family == Xml && appendCommonRules) commentsList.append("<!-- -->"); - QString tmpStr2; + TQString tmpStr2; for (uint i = 0; i < commentsList.count(); i++) { - tmpStrList = QStringList::split(" ",commentsList[i].stripWhiteSpace()); + tmpStrList = TQStringList::split(" ",commentsList[i].stripWhiteSpace()); tmpStr = tmpStrList[0].stripWhiteSpace(); rxStr += QuantaCommon::makeRxCompatible(tmpStr); rxStr += "|"; @@ -448,7 +448,7 @@ bool DTDs::readTagDir2(DTDStruct *dtd) /**** End of code for the new parser *****/ //read the definition of a structure, and the structure keywords - QStringList structKeywords = dtdConfig->readListEntry("StructKeywords",','); + TQStringList structKeywords = dtdConfig->readListEntry("StructKeywords",','); if (structKeywords.count() !=0 ) { tmpStr = "\\b("; @@ -529,11 +529,11 @@ bool DTDs::readTagDir2(DTDStruct *dtd) if (dtd->family == Script) { StructTreeGroup group; - QRegExp attrRx("\\([^\\)]*\\)"); - QString tagStr; + TQRegExp attrRx("\\([^\\)]*\\)"); + TQString tagStr; for (uint index = 1; index <= structGroupsCount; index++) { - dtdConfig->setGroup(QString("StructGroup_%1").arg(index)); + dtdConfig->setGroup(TQString("StructGroup_%1").arg(index)); //new code group.name = dtdConfig->readEntry("Name").stripWhiteSpace(); group.noName = dtdConfig->readEntry("No_Name").stripWhiteSpace(); @@ -579,22 +579,22 @@ bool DTDs::readTagDir2(DTDStruct *dtd) } else { XMLStructGroup group; - QRegExp attrRx("\\([^\\)]*\\)"); - QString tagName; + TQRegExp attrRx("\\([^\\)]*\\)"); + TQString tagName; for (uint index = 1; index <= structGroupsCount; index++) { - dtdConfig->setGroup(QString("StructGroup_%1").arg(index)); + dtdConfig->setGroup(TQString("StructGroup_%1").arg(index)); group.name = dtdConfig->readEntry("Name").stripWhiteSpace(); group.noName = dtdConfig->readEntry("No_Name").stripWhiteSpace(); group.icon = dtdConfig->readEntry("Icon").stripWhiteSpace(); group.appendToTags = dtdConfig->readBoolEntry("AppendToTags", false); group.parentGroup = dtdConfig->readEntry("ParentGroup").stripWhiteSpace(); - QString tagStr = dtdConfig->readEntry("Tag").stripWhiteSpace(); + TQString tagStr = dtdConfig->readEntry("Tag").stripWhiteSpace(); if (!tagStr.isEmpty()) { attrRx.search(tagStr); tmpStr = attrRx.cap(); - tmpStrList = QStringList::split(',', tmpStr.mid(1, tmpStr.length()-2)); + tmpStrList = TQStringList::split(',', tmpStr.mid(1, tmpStr.length()-2)); tagName = tagStr.left(tagStr.find('(')).lower(); group.attributes.clear(); for (uint i = 0; i < tmpStrList.count(); i++) @@ -621,11 +621,11 @@ void DTDs::resolveInherited (DTDStruct *dtd) if (!dtd->inheritsTagsFrom.isEmpty()) { DTDStruct *parent = (DTDStruct *) find(dtd->inheritsTagsFrom); // this loads the dtd, if not present in memory - QDictIterator<QTag> tag_it(*(parent->tagsList)); + TQDictIterator<QTag> tag_it(*(parent->tagsList)); for ( ; tag_it.current(); ++tag_it) { QTag *tag = tag_it.current(); - QString searchForTag = (dtd->caseSensitive) ? tag->name() : tag->name().upper(); + TQString searchForTag = (dtd->caseSensitive) ? tag->name() : tag->name().upper(); if (!dtd->tagsList->find(searchForTag)) { QTag *newTag = new QTag(*tag); @@ -636,8 +636,8 @@ void DTDs::resolveInherited (DTDStruct *dtd) //Read the pseudo DTD area definition strings (special area/tag string) //from the DTD's which may be present in the DTD (May_Contain setting) - QMap<QString, QString>::ConstIterator mapIt; - QString specialAreaStartRxStr = dtd->specialAreaStartRx.pattern(); + TQMap<TQString, TQString>::ConstIterator mapIt; + TQString specialAreaStartRxStr = dtd->specialAreaStartRx.pattern(); if (!specialAreaStartRxStr.isEmpty()) specialAreaStartRxStr += "|"; for (uint i = 0; i < dtd->insideDTDs.count(); i++) @@ -649,7 +649,7 @@ void DTDs::resolveInherited (DTDStruct *dtd) { for (mapIt = insideDTD->definitionAreas.begin(); mapIt != insideDTD->definitionAreas.end(); ++mapIt) { - QString tmpStr = mapIt.key(); + TQString tmpStr = mapIt.key(); dtd->specialAreas[tmpStr] = mapIt.data(); dtd->specialAreaNames[tmpStr] = dtd->insideDTDs[i]; specialAreaStartRxStr.append("(?:" + QuantaCommon::makeRxCompatible(tmpStr) + ")|"); @@ -667,10 +667,10 @@ void DTDs::resolveInherited (DTDStruct *dtd) /** Reads the tags for the tag files. Returns the number of read tags. */ -uint DTDs::readTagFile(const QString& fileName, DTDStruct* parentDTD, QTagList *tagList) +uint DTDs::readTagFile(const TQString& fileName, DTDStruct* parentDTD, QTagList *tagList) { // kdDebug(24000) << "dtds::readTagFile:" << fileName << endl; - QFile f(fileName); + TQFile f(fileName); if (! f.exists()) kdError() << "dtds::readTagFile file does not exist:" << fileName << endl; else @@ -680,7 +680,7 @@ uint DTDs::readTagFile(const QString& fileName, DTDStruct* parentDTD, QTagList * kdError() << "dtds::readTagFile unable to open:" << fileName << " Status: " << f.status() << endl; } - QString errorMsg; + TQString errorMsg; int errorLine, errorCol; if (!m_doc->setContent( &f, &errorMsg, &errorLine, &errorCol )) { @@ -691,16 +691,16 @@ uint DTDs::readTagFile(const QString& fileName, DTDStruct* parentDTD, QTagList * } f.close(); - QDomNodeList nodeList = m_doc->elementsByTagName("tag"); + TQDomNodeList nodeList = m_doc->elementsByTagName("tag"); uint numOfTags = nodeList.count(); for (uint i = 0; i < numOfTags; i++) { - QDomNode n = nodeList.item(i); - QDomElement e = n.toElement(); + TQDomNode n = nodeList.item(i); + TQDomElement e = n.toElement(); if (e.attribute("type") == "class") { - QString extends = e.attribute("extends"); - QString name = e.attribute("name"); + TQString extends = e.attribute("extends"); + TQString name = e.attribute("name"); if (!name.isEmpty() && !extends.isEmpty()) parentDTD->classInheritance[name] = extends; continue; @@ -713,7 +713,7 @@ uint DTDs::readTagFile(const QString& fileName, DTDStruct* parentDTD, QTagList * setAttributes(&n, tag, common); if (common) { - QString groupName = e.attribute("name"); + TQString groupName = e.attribute("name"); AttributeList *attrs = tag->attributes(); attrs->setAutoDelete(false); AttributeList *commonAttrList = new AttributeList; //no need to delete it @@ -739,27 +739,27 @@ uint DTDs::readTagFile(const QString& fileName, DTDStruct* parentDTD, QTagList * /** Parse the dom document and retrieve the tag attributes */ -void DTDs::setAttributes(QDomNode *dom, QTag* tag, bool &common) +void DTDs::setAttributes(TQDomNode *dom, QTag* tag, bool &common) { common = false; Attribute *attr; - QDomElement el = dom->toElement(); - QString tmpStr; + TQDomElement el = dom->toElement(); + TQString tmpStr; tmpStr = el.attribute("common"); if ((tmpStr != "1" && tmpStr != "yes")) //in case of common tags, we are not interested in these options { if (tag->parentDTD->commonAttrs) { - QDictIterator<AttributeList> it(*(tag->parentDTD->commonAttrs)); + TQDictIterator<AttributeList> it(*(tag->parentDTD->commonAttrs)); for( ; it.current(); ++it ) { - QString lookForAttr = "has" + QString(it.currentKey()).stripWhiteSpace(); + TQString lookForAttr = "has" + TQString(it.currentKey()).stripWhiteSpace(); tmpStr = el.attribute(lookForAttr); if (tmpStr == "1" || tmpStr == "yes") { - tag->commonGroups += QString(it.currentKey()).stripWhiteSpace(); + tag->commonGroups += TQString(it.currentKey()).stripWhiteSpace(); } } } @@ -790,20 +790,20 @@ void DTDs::setAttributes(QDomNode *dom, QTag* tag, bool &common) { common = true; } - QString attrList; - for ( QDomNode n = dom->firstChild(); !n.isNull(); n = n.nextSibling() ) + TQString attrList; + for ( TQDomNode n = dom->firstChild(); !n.isNull(); n = n.nextSibling() ) { tmpStr = n.nodeName(); if (tmpStr == "children") { - QDomElement el = n.toElement(); - QDomElement item = el.firstChild().toElement(); + TQDomElement el = n.toElement(); + TQDomElement item = el.firstChild().toElement(); while ( !item.isNull() ) { tmpStr = item.tagName(); if (tmpStr == "child") { - QString childTag = item.attribute("name"); + TQString childTag = item.attribute("name"); if (!tag->parentDTD->caseSensitive) childTag = childTag.upper(); tag->childTags.insert(childTag, item.attribute("usage") == "required"); @@ -813,13 +813,13 @@ void DTDs::setAttributes(QDomNode *dom, QTag* tag, bool &common) } else if (tmpStr == "stoppingtags") //read what tag can act as closing tag { - QDomElement el = n.toElement(); - QDomElement item = el.firstChild().toElement(); + TQDomElement el = n.toElement(); + TQDomElement item = el.firstChild().toElement(); while ( !item.isNull() ) { if (item.tagName() == "stoppingtag") { - QString stopTag = item.attribute("name"); + TQString stopTag = item.attribute("name"); if (!tag->parentDTD->caseSensitive) stopTag = stopTag.upper(); tag->stoppingTags.append(stopTag); @@ -829,7 +829,7 @@ void DTDs::setAttributes(QDomNode *dom, QTag* tag, bool &common) } else if (tmpStr == "attr") //an attribute { - QDomElement el = n.toElement(); + TQDomElement el = n.toElement(); attr = new Attribute; attr->name = el.attribute("name"); attr->source = el.attribute("source"); @@ -842,9 +842,9 @@ void DTDs::setAttributes(QDomNode *dom, QTag* tag, bool &common) attr->status = el.attribute("status"); if ( attr->type == "list" ) { - for ( QDomElement attrEl = el.firstChild().toElement(); !attrEl.isNull(); attrEl = attrEl.nextSibling().toElement() ) { + for ( TQDomElement attrEl = el.firstChild().toElement(); !attrEl.isNull(); attrEl = attrEl.nextSibling().toElement() ) { if ( attrEl.tagName() == "items" ) { - QDomElement item = attrEl.firstChild().toElement(); + TQDomElement item = attrEl.firstChild().toElement(); while ( !item.isNull() ) { attr->values.append( item.text() ); item = item.nextSibling().toElement(); @@ -907,21 +907,21 @@ void DTDs::slotLoadDTD() DTDParser dtdParser(url, KGlobal::dirs()->saveLocation("data") + resourceDir + "dtep"); if (dtdParser.parse()) { - QString dirName = dtdParser.dirName(); + TQString dirName = dtdParser.dirName(); KConfig dtdcfg(dirName + m_rcFilename, true); dtdcfg.setGroup("General"); - QString dtdName = dtdcfg.readEntry("Name"); - QString nickName = dtdcfg.readEntry("NickName", dtdName); + TQString dtdName = dtdcfg.readEntry("Name"); + TQString nickName = dtdcfg.readEntry("NickName", dtdName); DTDStruct * dtd = m_dict->find(dtdName) ; if (dtd && - KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").arg(nickName), QString::null, i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) + KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").arg(nickName), TQString::null, i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) { return; } removeDTD(dtd); if (readTagDir(dirName)) { - QString family = dtdcfg.readEntry("Family", "1"); + TQString family = dtdcfg.readEntry("Family", "1"); Document *w = ViewManager::ref()->activeDocument(); if (family == "1" && w && KMessageBox::questionYesNo(0L, i18n("<qt>Use the newly loaded <b>%1</b> DTD for the current document?</qt>").arg(nickName), i18n("Change DTD"), i18n("Use"), i18n("Do Not Use")) == KMessageBox::Yes) @@ -935,18 +935,18 @@ void DTDs::slotLoadDTD() } } -void DTDs::slotLoadDTEP(const QString &_dirName, bool askForAutoload) +void DTDs::slotLoadDTEP(const TQString &_dirName, bool askForAutoload) { - QString dirName = _dirName; + TQString dirName = _dirName; if (!dirName.endsWith("/")) dirName += "/"; KConfig dtdcfg(dirName + m_rcFilename, true); dtdcfg.setGroup("General"); - QString dtdName = dtdcfg.readEntry("Name"); - QString nickName = dtdcfg.readEntry("NickName", dtdName); + TQString dtdName = dtdcfg.readEntry("Name"); + TQString nickName = dtdcfg.readEntry("NickName", dtdName); DTDStruct * dtd = m_dict->find(dtdName) ; if ( dtd && - KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").arg(nickName), QString::null, i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) + KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").arg(nickName), TQString::null, i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) { return; } @@ -956,13 +956,13 @@ void DTDs::slotLoadDTEP(const QString &_dirName, bool askForAutoload) KMessageBox::error(0L, i18n("<qt>Cannot read the DTEP from <b>%1</b>. Check that the folder contains a valid DTEP (<i>description.rc and *.tag files</i>).</qt>").arg(dirName), i18n("Error Loading DTEP")); } else { - QString family = dtdcfg.readEntry("Family", "1"); - if (askForAutoload && KMessageBox::questionYesNo(0L, i18n("<qt>Autoload the <b>%1</b> DTD in the future?</qt>").arg(nickName), QString::null, i18n("Load"), i18n("Do Not Load")) == KMessageBox::Yes) + TQString family = dtdcfg.readEntry("Family", "1"); + if (askForAutoload && KMessageBox::questionYesNo(0L, i18n("<qt>Autoload the <b>%1</b> DTD in the future?</qt>").arg(nickName), TQString::null, i18n("Load"), i18n("Do Not Load")) == KMessageBox::Yes) { KURL src; src.setPath(dirName); KURL target; - QString destDir = KGlobal::dirs()->saveLocation("data") + resourceDir + "dtep/"; + TQString destDir = KGlobal::dirs()->saveLocation("data") + resourceDir + "dtep/"; target.setPath(destDir + src.fileName()); KIO::copy( src, target, false); //don't care about the result } @@ -981,12 +981,12 @@ void DTDs::slotLoadEntities() { KDialogBase dlg(0L, "loadentities", true, i18n("Load DTD Entities Into DTEP"), KDialogBase::Ok | KDialogBase::Cancel); LoadEntityDlgS entitiesWidget(&dlg); - QStringList lst(DTDs::ref()->nickNameList(true)); + TQStringList lst(DTDs::ref()->nickNameList(true)); entitiesWidget.targetDTEPCombo->insertStringList(lst); Document *w = ViewManager::ref()->activeDocument(); if (w) { - QString nickName = DTDs::ref()->getDTDNickNameFromName(w->getDTDIdentifier()); + TQString nickName = DTDs::ref()->getDTDNickNameFromName(w->getDTDIdentifier()); entitiesWidget.targetDTEPCombo->setCurrentItem(lst.findIndex(nickName)); } dlg.setMainWidget(&entitiesWidget); @@ -994,7 +994,7 @@ void DTDs::slotLoadEntities() { DTDStruct * dtd = m_dict->find(getDTDNameFromNickName(entitiesWidget.targetDTEPCombo->currentText())); DTDParser dtdParser(KURL::fromPathOrURL(entitiesWidget.sourceDTDRequester->url()), KGlobal::dirs()->saveLocation("data") + resourceDir + "dtep"); - QString dtdDir = QFileInfo(dtd->fileName).dirPath(); + TQString dtdDir = TQFileInfo(dtd->fileName).dirPath(); if (dtdParser.parse(dtdDir, true)) { readTagFile(dtdDir + "/entities.tag", dtd, dtd->tagsList); @@ -1004,9 +1004,9 @@ void DTDs::slotLoadEntities() /** Returns the DTD name (identifier) corresponding to the DTD's nickname */ -QString DTDs::getDTDNameFromNickName(const QString& nickName) +TQString DTDs::getDTDNameFromNickName(const TQString& nickName) { - QDictIterator<DTDStruct> it(*m_dict); + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { if (it.current()->nickName.lower() == nickName.lower()) @@ -1018,10 +1018,10 @@ QString DTDs::getDTDNameFromNickName(const QString& nickName) } /** returns the known nick names */ -QStringList DTDs::nickNameList(bool topLevelOnly) +TQStringList DTDs::nickNameList(bool topLevelOnly) { - QStringList nickList; - QDictIterator<DTDStruct> it(*m_dict); + TQStringList nickList; + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { if (!topLevelOnly || it.current()->toplevel) @@ -1035,10 +1035,10 @@ QStringList DTDs::nickNameList(bool topLevelOnly) /** returns the known names */ -QStringList DTDs::nameList(bool topLevelOnly) +TQStringList DTDs::nameList(bool topLevelOnly) { - QStringList nameList; - QDictIterator<DTDStruct> it(*m_dict); + TQStringList nameList; + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { if (!topLevelOnly || it.current()->toplevel) @@ -1050,10 +1050,10 @@ QStringList DTDs::nameList(bool topLevelOnly) return nameList; } -QStringList DTDs::fileNameList(bool topLevelOnly) +TQStringList DTDs::fileNameList(bool topLevelOnly) { - QStringList nameList; - QDictIterator<DTDStruct> it(*m_dict); + TQStringList nameList; + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { if (!topLevelOnly || it.current()->toplevel) @@ -1067,8 +1067,8 @@ QStringList DTDs::fileNameList(bool topLevelOnly) const DTDStruct * DTDs::DTDforURL(const KURL &url) { - QValueList<DTDStruct*> foundList; - QDictIterator<DTDStruct> it(*m_dict); + TQValueList<DTDStruct*> foundList; + TQDictIterator<DTDStruct> it(*m_dict); for( ; it.current(); ++it ) { if (it.current()->toplevel && canHandle(it.current(), url)) @@ -1080,7 +1080,7 @@ const DTDStruct * DTDs::DTDforURL(const KURL &url) return find("empty"); else { - QString path = url.path(); + TQString path = url.path(); for (uint i = 0; i < foundList.count(); i++) { if (path.endsWith('.' + foundList[i]->defaultExtension)) @@ -1092,7 +1092,7 @@ const DTDStruct * DTDs::DTDforURL(const KURL &url) bool DTDs::canHandle(const DTDStruct *dtd, const KURL &url) { - QString mimetype = KMimeType::findByURL(url)->name(); + TQString mimetype = KMimeType::findByURL(url)->name(); if (dtd->mimeTypes.contains(mimetype)) return true; if (url.path().endsWith('.' + dtd->defaultExtension)) |