summaryrefslogtreecommitdiffstats
path: root/quanta/parsers/dtd/dtdparser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/parsers/dtd/dtdparser.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-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/parsers/dtd/dtdparser.cpp')
-rw-r--r--quanta/parsers/dtd/dtdparser.cpp84
1 files changed, 42 insertions, 42 deletions
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 <qcheckbox.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qregexp.h>
-#include <qstring.h>
+#include <tqcheckbox.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqregexp.h>
+#include <tqstring.h>
//kde includes
#include <kconfig.h>
@@ -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("<qt>Cannot download the DTD from <b>%1</b>.</qt>").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 += "<br>" + s;
- s = QString::fromLatin1(errorPtr->str2);
+ s = TQString::fromLatin1(errorPtr->str2);
if (!s.isEmpty())
errorStr += "<br>" + s;
- s = QString::fromLatin1(errorPtr->str2);
+ s = TQString::fromLatin1(errorPtr->str2);
if (!s.isEmpty())
errorStr += "<br>" + 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("<!doctype", false), "");
+ m_doctype.replace(TQRegExp("<!doctype", false), "");
m_doctype = m_doctype.left(m_doctype.findRev(">"));
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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
DTD::entityStream << "<!DOCTYPE TAGS>" << endl
<< "<TAGS>" << 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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
stream << "<!DOCTYPE TAGS>" << endl
<< "<TAGS>" << 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 << "<children>" << endl;
for( int i = 0; i < childNum; i++ )
{
- stream << " <child name=\"" << QString((const char*)list_ptr[i]) << "\"";
+ stream << " <child name=\"" << TQString((const char*)list_ptr[i]) << "\"";
xmlElementPtr child_ptr = xmlGetDtdElementDesc(DTD::dtd_ptr, list_ptr[i]);
if (child_ptr && child_ptr->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 << "<children>" << endl;
while (content_ptr)
{
- if (!QString((const char*)content_ptr->name).isEmpty())
+ if (!TQString((const char*)content_ptr->name).isEmpty())
{
- stream << " <child name=\"" << QString((const char*)content_ptr->name) << "\"";
- QString ocur;
+ stream << " <child name=\"" << TQString((const char*)content_ptr->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 << "<tag name=\"" << name << "\" type=\"entity\" />" << endl << endl;
}
}
-QString DTDParser::dirName()
+TQString DTDParser::dirName()
{
return DTD::dirName;
}