From dc6b8e72fed2586239e3514819238c520636c9d9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:54:04 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/parsers/dtd/dtdparser.cpp | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'quanta/parsers/dtd/dtdparser.cpp') diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp index 86060967..0d623978 100644 --- a/quanta/parsers/dtd/dtdparser.cpp +++ b/quanta/parsers/dtd/dtdparser.cpp @@ -14,13 +14,13 @@ ***************************************************************************/ //qt includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include //kde includes #include @@ -51,15 +51,15 @@ namespace DTD { - QString dirName; + TQString dirName; xmlDtdPtr dtd_ptr; /* Pointer to the parsed DTD */ - QTextStream entityStream; + TQTextStream entityStream; } void saveElement(xmlElementPtr elem, xmlBufferPtr buf); void saveEntity(xmlEntityPtr entity, xmlBufferPtr buf); -DTDParser::DTDParser(const KURL& dtdURL, const QString &dtepDir) +DTDParser::DTDParser(const KURL& dtdURL, const TQString &dtepDir) { m_dtdURL = dtdURL; m_dtepDir = dtepDir; @@ -69,10 +69,10 @@ DTDParser::~DTDParser() { } -bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) +bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) { bool fineTune = false; - QString fileName = QString::null; + TQString fileName = TQString::null; if (!KIO::NetAccess::download(m_dtdURL, fileName, 0)) { KMessageBox::error(0, i18n("Cannot download the DTD from %1.").arg( m_dtdURL.prettyURL(0, KURL::StripFileProtocol))); @@ -81,24 +81,24 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) DTD::dtd_ptr = xmlParseDTD(NULL, xmlCharStrndup(fileName.utf8(), fileName.utf8().length())); if( DTD::dtd_ptr == NULL ) { - QString errorStr = i18n("Unknown"); + TQString errorStr = i18n("Unknown"); #ifndef LIBXML_2_5 xmlErrorPtr errorPtr = xmlGetLastError(); if (errorPtr != NULL) { - QString s = QString::fromLatin1(errorPtr->message); + TQString s = TQString::fromLatin1(errorPtr->message); if (!s.isEmpty()) errorStr = s; - s = QString::fromLatin1(errorPtr->str1); + s = TQString::fromLatin1(errorPtr->str1); if (!s.isEmpty()) errorStr += "
" + s; - s = QString::fromLatin1(errorPtr->str2); + s = TQString::fromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "
" + s; - s = QString::fromLatin1(errorPtr->str2); + s = TQString::fromLatin1(errorPtr->str2); if (!s.isEmpty()) errorStr += "
" + s; - errorStr += QString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); + errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); xmlResetError(errorPtr); } #endif @@ -110,20 +110,20 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) KDialogBase dlg(0L, 0L, true, i18n("DTD - > DTEP Conversion"), KDialogBase::Ok | KDialogBase::Cancel); DTEPCreationDlg w(&dlg); dlg.setMainWidget(&w); - QString name = QString((const char*)DTD::dtd_ptr->name); + TQString name = TQString((const char*)DTD::dtd_ptr->name); if (name == "none") - name = QFileInfo(m_dtdURL.fileName()).baseName(); + name = TQFileInfo(m_dtdURL.fileName()).baseName(); w.dtdName->setText(name); w.nickName->setText(name); - w.directory->setText(QFileInfo(m_dtdURL.fileName()).baseName()); - w.doctype->setText(QString((const char*)DTD::dtd_ptr->ExternalID)); - w.dtdURL->setText(QString((const char*)DTD::dtd_ptr->SystemID)); + w.directory->setText(TQFileInfo(m_dtdURL.fileName()).baseName()); + w.doctype->setText(TQString((const char*)DTD::dtd_ptr->ExternalID)); + w.dtdURL->setText(TQString((const char*)DTD::dtd_ptr->SystemID)); if (!dlg.exec()) return false; m_name = w.dtdName->text(); m_nickName = w.nickName->text(); m_doctype = w.doctype->text(); - m_doctype.replace(QRegExp("")); m_dtdURLLine = w.dtdURL->text(); m_defaultExtension = w.defaultExtension->text(); @@ -141,11 +141,11 @@ bool DTDParser::parse(const QString &targetDir, bool entitiesOnly) DTD::dirName.append("/"); if (DTD::dtd_ptr->entities) { - QFile file( DTD::dirName + "entities.tag" ); + TQFile file( DTD::dirName + "entities.tag" ); if ( file.open( IO_WriteOnly ) ) { DTD::entityStream.setDevice(&file); - DTD::entityStream.setEncoding(QTextStream::UnicodeUTF8); + DTD::entityStream.setEncoding(TQTextStream::UnicodeUTF8); DTD::entityStream << "" << endl; DTD::entityStream << "" << endl << "" << endl; @@ -211,12 +211,12 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) Q_UNUSED(buf); if (elem) { - QString elemName = QString((const char*)elem->name); - QFile file( DTD::dirName + elemName + ".tag" ); + TQString elemName = TQString((const char*)elem->name); + TQFile file( DTD::dirName + elemName + ".tag" ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream( &file ); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << "" << endl; stream << "" << endl << "" << endl @@ -232,21 +232,21 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) at_ptr = el_ptr->attributes; while (at_ptr) { Attribute *attr = new Attribute; - attr->name = QString((const char*)at_ptr->name); + 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 3: {attr->status = "implied"; break;} //IMPLIED case 4: {attr->status = "fixed"; break;} //FIXED } - attr->defaultValue = QString((const char*)at_ptr->defaultValue); + attr->defaultValue = TQString((const char*)at_ptr->defaultValue); xmlEnumerationPtr enum_ptr; enum_ptr = at_ptr->tree; while (enum_ptr) { - attr->values += QString((const char*)enum_ptr->name); + attr->values += TQString((const char*)enum_ptr->name); enum_ptr = enum_ptr->next; } - QString attrtype; + TQString attrtype; switch (at_ptr->atype) { case 9: {attrtype = "list"; break;} default: {attrtype = "input"; break;} //TODO handle the rest of types @@ -268,7 +268,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) stream << "" << endl; for( int i = 0; i < childNum; i++ ) { - stream << " content && child_ptr->content->ocur) { @@ -276,7 +276,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) //{ // stream << " usage=\"required\""; // } - QString ocur; + TQString ocur; switch (child_ptr->content->ocur) { case 1: {ocur = "once"; break;} @@ -285,7 +285,7 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) case 4: {ocur = "plus"; break;} } stream << " usage=\"" << ocur << "\""; - QString name = QString((const char*)child_ptr->content->name); + TQString name = TQString((const char*)child_ptr->content->name); if (name == "#PCDATA") name == "#text"; stream << " name2=\"" << name << "\""; @@ -303,10 +303,10 @@ void saveElement(xmlElementPtr elem, xmlBufferPtr buf) stream << "" << endl; while (content_ptr) { - if (!QString((const char*)content_ptr->name).isEmpty()) + if (!TQString((const char*)content_ptr->name).isEmpty()) { - stream << " name) << "\""; - QString ocur; + stream << " name) << "\""; + TQString ocur; switch (content_ptr->ocur) { case 1: {ocur = "once"; break;} @@ -350,12 +350,12 @@ void saveEntity(xmlEntityPtr entity, xmlBufferPtr buf) Q_UNUSED(buf); if (entity) { - QString name = QString((const char*)entity->name); + TQString name = TQString((const char*)entity->name); DTD::entityStream << "" << endl << endl; } } -QString DTDParser::dirName() +TQString DTDParser::dirName() { return DTD::dirName; } -- cgit v1.2.1