diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
commit | e985f7e545f4739493965aad69bbecb136dc9346 (patch) | |
tree | 54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/parsers/dtd | |
parent | f7670c198945adc3b95ad69a959fe5f8ae55b493 (diff) | |
download | tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip |
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/parsers/dtd')
-rw-r--r-- | quanta/parsers/dtd/dtd.cpp | 72 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtd.h | 2 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtdparser.cpp | 44 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtdparser.h | 2 | ||||
-rw-r--r-- | quanta/parsers/dtd/dtepcreationdlg.ui | 34 |
5 files changed, 77 insertions, 77 deletions
diff --git a/quanta/parsers/dtd/dtd.cpp b/quanta/parsers/dtd/dtd.cpp index 964c35fb..c0942441 100644 --- a/quanta/parsers/dtd/dtd.cpp +++ b/quanta/parsers/dtd/dtd.cpp @@ -30,8 +30,8 @@ #include <ktempfile.h> #include "dtd.h" -#include "../quantacommon.h" -#include "../qextfileinfo.h" +#include "../tquantacommon.h" +#include "../tqextfileinfo.h" DTD::DTD(const KURL &dtdURL, const TQString &dtepDir) @@ -51,7 +51,7 @@ TQStringList DTD::getTags() AttributeList* DTD::getTagAttributes(TQString tag) { - return tagAttributes.find(tag); + return tagAttributes.tqfind(tag); } @@ -84,7 +84,7 @@ void DTD::writeTagFiles() TQString dirName = m_dtepDir; KURL u; u.setPath(dirName); - if (!QExtFileInfo::createDir(dirName)) { + if (!TQExtFileInfo::createDir(dirName)) { QuantaCommon::dirCreationError(0, u); return; } @@ -121,10 +121,10 @@ void DTD::writeTagFiles() bool DTD::parseDTD(const KURL &url) { - TQString fileName = TQString::null; + TQString fileName = TQString(); if (!KIO::NetAccess::download(url, fileName)) { - KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol))); + KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol))); return false; } TQFile file(fileName); @@ -183,7 +183,7 @@ bool DTD::parseDTD(const KURL &url) parseDTD(entityURL); } else { - kdDebug(24000) << TQString("Unknown tag: [%1]").arg(line) << endl; + kdDebug(24000) << TQString("Unknown tag: [%1]").tqarg(line) << endl; } if (it != lines.end()) ++it; @@ -195,14 +195,14 @@ void DTD::parseDTDEntity(TQString line) { TQString name; TQString *value; - line.replace("\\end", " "); + line.tqreplace("\\end", " "); name = line.mid(11); - int firstSpace = name.find(' '); + int firstSpace = name.tqfind(' '); name = name.remove(firstSpace, name.length()-firstSpace); value = new TQString(line.mid(11+firstSpace)); - value->remove(0, value->find("\"")+1); - value->remove(value->findRev("\""), value->length()); + value->remove(0, value->tqfind("\"")+1); + value->remove(value->tqfindRev("\""), value->length()); parseDTDReplace(value); stripSpaces(value); @@ -217,14 +217,14 @@ void DTD::parseDTDElement(const TQString &l) { TQString *value; TQString line = l; - line.replace("\\end", " "); + line.tqreplace("\\end", " "); name = line.mid(10); - int firstSpace = name.find(' '); + int firstSpace = name.tqfind(' '); name.remove(firstSpace, name.length()-firstSpace); value = new TQString(line.mid(10+firstSpace)); - //value->remove(0, value->find("\"")+1); - value->remove(value->find(">"), 10000); + //value->remove(0, value->tqfind("\"")+1); + value->remove(value->tqfind(">"), 10000); parseDTDReplace(&name); parseDTDReplace(value); @@ -254,14 +254,14 @@ void DTD::parseDTDAttlist(const TQString &l) { TQString *value; TQString line = l; - line.replace("\\end", " "); + line.tqreplace("\\end", " "); name = line.mid(10); - int firstSpace = name.find(' '); + int firstSpace = name.tqfind(' '); name.remove(firstSpace, name.length()-firstSpace); value = new TQString(line.mid(10+firstSpace)); - //value->remove(0, value->find("\"")+1); - value->remove(value->find(">"), 10000); + //value->remove(0, value->tqfind("\"")+1); + value->remove(value->tqfind(">"), 10000); parseDTDReplace(&name); parseDTDReplace(value); @@ -362,51 +362,51 @@ void DTD::parseTagAttributeValues(const TQString &name, TQString *value) { void DTD::parseDTDReplace(TQString *value) { int begin, end; - begin = value->find("%"); - end = value->find(";"); + begin = value->tqfind("%"); + end = value->tqfind(";"); while (begin != -1 && end != -1) { TQString replaceText = value->mid(begin+1, end-begin-1); - TQString *replaceValue = entities.find(replaceText); + TQString *replaceValue = entities.tqfind(replaceText); if (replaceValue != 0L) { - value->replace(begin, end-begin+1, *replaceValue); + value->tqreplace(begin, end-begin+1, *replaceValue); } else { kdDebug(24000) << "Can not find entity: " << replaceText << endl; return; } - begin = value->find("%"); - end = value->find(";"); + begin = value->tqfind("%"); + end = value->tqfind(";"); } } void DTD::stripSpaces(TQString *value) { int index=-1; - while ( (index=value->find(' ',++index)) != -1 ) { - if ( value->findRev('(',index) != -1 && value->find(')',index) != -1) + while ( (index=value->tqfind(' ',++index)) != -1 ) { + if ( value->tqfindRev('(',index) != -1 && value->tqfind(')',index) != -1) value->remove(index,1); } } void DTD::removeComments(TQString &value) { int begin, end; - begin = value.find("<!--"); - end = value.find("-->",begin+2); + begin = value.tqfind("<!--"); + end = value.tqfind("-->",begin+2); while (begin != -1 && end != -1) { value.remove(begin, end-begin+3); - begin = value.find("<!--"); - end = value.find("-->",begin+2); + begin = value.tqfind("<!--"); + end = value.tqfind("-->",begin+2); } - begin = value.find("--"); - end = value.find("--",begin+2); + begin = value.tqfind("--"); + end = value.tqfind("--",begin+2); while (begin != -1 && end != -1) { value.remove(begin, end-begin+2); - begin = value.find("--"); - end = value.find("--",begin+2); + begin = value.tqfind("--"); + end = value.tqfind("--",begin+2); } - value.replace(TQRegExp("<!>"), ""); + value.tqreplace(TQRegExp("<!>"), ""); } bool DTD::parseDTD() diff --git a/quanta/parsers/dtd/dtd.h b/quanta/parsers/dtd/dtd.h index cc0cf238..723ee4b6 100644 --- a/quanta/parsers/dtd/dtd.h +++ b/quanta/parsers/dtd/dtd.h @@ -22,7 +22,7 @@ #include <tqdict.h> //app includes -#include "qtag.h" +#include "tqtag.h" class KURL; diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp index 0d623978..577d2734 100644 --- a/quanta/parsers/dtd/dtdparser.cpp +++ b/quanta/parsers/dtd/dtdparser.cpp @@ -72,10 +72,10 @@ DTDParser::~DTDParser() bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) { bool fineTune = false; - TQString fileName = TQString::null; + TQString fileName = TQString(); if (!KIO::NetAccess::download(m_dtdURL, fileName, 0)) { - KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").arg( m_dtdURL.prettyURL(0, KURL::StripFileProtocol))); + KMessageBox::error(0, i18n("<qt>Cannot download the DTD from <b>%1</b>.</qt>").tqarg( m_dtdURL.prettyURL(0, KURL::StripFileProtocol))); return false; } DTD::dtd_ptr = xmlParseDTD(NULL, xmlCharStrndup(fileName.utf8(), fileName.utf8().length())); @@ -86,23 +86,23 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) xmlErrorPtr errorPtr = xmlGetLastError(); if (errorPtr != NULL) { - TQString s = TQString::fromLatin1(errorPtr->message); + TQString s = TQString::tqfromLatin1(errorPtr->message); if (!s.isEmpty()) errorStr = s; - s = TQString::fromLatin1(errorPtr->str1); + s = TQString::tqfromLatin1(errorPtr->str1); if (!s.isEmpty()) errorStr += "<br>" + s; - s = TQString::fromLatin1(errorPtr->str2); + s = TQString::tqfromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "<br>" + s; - s = TQString::fromLatin1(errorPtr->str2); + s = TQString::tqfromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "<br>" + s; - errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); + errorStr += TQString("(%1, %2)").tqarg(errorPtr->line).tqarg(errorPtr->int2); xmlResetError(errorPtr); } #endif - KMessageBox::error(0, i18n("<qt>Error while parsing the DTD.<br>The error message is:<br><i>%1</i></qt>").arg(errorStr)); + KMessageBox::error(0, i18n("<qt>Error while parsing the DTD.<br>The error message is:<br><i>%1</i></qt>").tqarg(errorStr)); return false; } if (targetDir.isEmpty()) @@ -123,8 +123,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) m_name = w.dtdName->text(); m_nickName = w.nickName->text(); m_doctype = w.doctype->text(); - m_doctype.replace(TQRegExp("<!doctype", false), ""); - m_doctype = m_doctype.left(m_doctype.findRev(">")); + m_doctype.tqreplace(TQRegExp("<!doctype", false), ""); + m_doctype = m_doctype.left(m_doctype.tqfindRev(">")); m_dtdURLLine = w.dtdURL->text(); m_defaultExtension = w.defaultExtension->text(); m_caseSensitive = w.caseSensitive->isChecked(); @@ -134,7 +134,7 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) DTD::dirName = targetDir; KURL u; u.setPath(DTD::dirName); - if (!QExtFileInfo::createDir(u, 0L)) { + if (!TQExtFileInfo::createDir(u, 0L)) { QuantaCommon::dirCreationError(0L, u); return false; } @@ -144,7 +144,7 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) TQFile file( DTD::dirName + "entities.tag" ); if ( file.open( IO_WriteOnly ) ) { - DTD::entityStream.setDevice(&file); + DTD::entityStream.setDevice(TQT_TQIODEVICE(&file)); DTD::entityStream.setEncoding(TQTextStream::UnicodeUTF8); DTD::entityStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; DTD::entityStream << "<!DOCTYPE TAGS>" << endl @@ -154,8 +154,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) file.close(); } else { - KMessageBox::error(0L, i18n("<qt>Cannot create the <br><b>%1</b> file.<br>Check that you have write permission in the parent folder.</qt>") - .arg(file.name())); + KMessageBox::error(0L, i18n("<qt>Cannot create the <br><b>%1</b> file.<br>Check that you have write permission in the tqparent folder.</qt>") + .tqarg(file.name())); return false; } } @@ -235,7 +235,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) attr->name = TQString((const char*)at_ptr->name); switch (at_ptr->def) { case 1: {attr->status = "optional"; break;} //NONE - case 2: {attr->status = "required"; break;} //REQUIRED + case 2: {attr->status = "required"; break;} //RETQUIRED case 3: {attr->status = "implied"; break;} //IMPLIED case 4: {attr->status = "fixed"; break;} //FIXED } @@ -265,7 +265,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) if (childNum > 0) { - stream << "<children>" << endl; + stream << "<tqchildren>" << endl; for( int i = 0; i < childNum; i++ ) { stream << " <child name=\"" << TQString((const char*)list_ptr[i]) << "\""; @@ -293,14 +293,14 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) stream << " />" << endl; } - stream << "</children>" << endl; + stream << "</tqchildren>" << endl; stream << endl; } /* xmlElementContentPtr content_ptr = el_ptr->content; if (content_ptr) { - stream << "<children>" << endl; + stream << "<tqchildren>" << endl; while (content_ptr) { if (!TQString((const char*)content_ptr->name).isEmpty()) @@ -325,17 +325,17 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) { if (content_ptr == el_ptr->content) break; - if (content_ptr->parent) + if (content_ptr->tqparent) { - if (content_ptr == content_ptr->parent->c1) + if (content_ptr == content_ptr->tqparent->c1) content_ptr->c1 = 0L; else content_ptr->c2 = 0L; } - content_ptr = content_ptr->parent; + content_ptr = content_ptr->tqparent; } } - stream << "</children>" << endl; + stream << "</tqchildren>" << endl; } */ } stream << "</tag>" << endl diff --git a/quanta/parsers/dtd/dtdparser.h b/quanta/parsers/dtd/dtdparser.h index 800fa445..b9948ea6 100644 --- a/quanta/parsers/dtd/dtdparser.h +++ b/quanta/parsers/dtd/dtdparser.h @@ -35,7 +35,7 @@ public: * @param entitiesOnly if true, only the entities are extracted from the DTD into the entities.tag file * @return true on success, false if some error happened */ - bool parse(const TQString &targetDir = TQString::null, bool entitiesOnly = false); + bool parse(const TQString &targetDir = TQString(), bool entitiesOnly = false); protected: void writeDescriptionRC(); diff --git a/quanta/parsers/dtd/dtepcreationdlg.ui b/quanta/parsers/dtd/dtepcreationdlg.ui index 3247c7ae..adaeabc4 100644 --- a/quanta/parsers/dtd/dtepcreationdlg.ui +++ b/quanta/parsers/dtd/dtepcreationdlg.ui @@ -9,7 +9,7 @@ ***************************************************************************/ </comment> <author>(C) 2003 Andras Mantia <amantia@kde.org></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>DTEPCreationDlg</cstring> </property> @@ -21,7 +21,7 @@ <height>285</height> </rect> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>500</width> <height>200</height> @@ -37,17 +37,17 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit" row="2" column="1"> + <widget class="TQLineEdit" row="2" column="1"> <property name="name"> <cstring>nickName</cstring> </property> </widget> - <widget class="QLineEdit" row="4" column="1"> + <widget class="TQLineEdit" row="4" column="1"> <property name="name"> <cstring>dtdURL</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -55,7 +55,7 @@ <string>Name: </string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -63,7 +63,7 @@ <string>Nickname:</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -71,22 +71,22 @@ <string>!DOCTYPE definition line:</string> </property> </widget> - <widget class="QLineEdit" row="0" column="1"> + <widget class="TQLineEdit" row="0" column="1"> <property name="name"> <cstring>directory</cstring> </property> </widget> - <widget class="QLineEdit" row="3" column="1"> + <widget class="TQLineEdit" row="3" column="1"> <property name="name"> <cstring>doctype</cstring> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>dtdName</cstring> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -94,7 +94,7 @@ <string>DTD URL:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -102,7 +102,7 @@ <string>Target directory name:</string> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -110,12 +110,12 @@ <string>Default extension:</string> </property> </widget> - <widget class="QLineEdit" row="5" column="1"> + <widget class="TQLineEdit" row="5" column="1"> <property name="name"> <cstring>defaultExtension</cstring> </property> </widget> - <widget class="QCheckBox" row="6" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="6" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>caseSensitive</cstring> </property> @@ -126,7 +126,7 @@ <bool>true</bool> </property> </widget> - <widget class="QCheckBox" row="7" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>fineTune</cstring> </property> @@ -148,5 +148,5 @@ <tabstop>defaultExtension</tabstop> <tabstop>caseSensitive</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> |