summaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_xmlreader.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/objects/class_xmlreader.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/objects/class_xmlreader.cpp')
-rw-r--r--src/modules/objects/class_xmlreader.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/modules/objects/class_xmlreader.cpp b/src/modules/objects/class_xmlreader.cpp
index f4bccc8f..243a0b79 100644
--- a/src/modules/objects/class_xmlreader.cpp
+++ b/src/modules/objects/class_xmlreader.cpp
@@ -128,15 +128,15 @@
*/
-#ifndef QT_NO_XML
+#ifndef TQT_NO_XML
-#include <qxml.h>
+#include <tqxml.h>
-class KviXmlHandler : public QXmlDefaultHandler
+class KviXmlHandler : public TQXmlDefaultHandler
{
protected:
KviKvsObject_xmlreader * m_pReader;
- QString m_szErrorString;
+ TQString m_szErrorString;
public:
KviXmlHandler(KviKvsObject_xmlreader * pReader)
{
@@ -156,12 +156,12 @@ private:
m_szErrorString = __tr2qs("Processing aborted");
return false;
}
- void decodeException(QString &szMsg,bool bError,const QXmlParseException &exception)
+ void decodeException(TQString &szMsg,bool bError,const TQXmlParseException &exception)
{
if(bError)
- KviQString::sprintf(szMsg,__tr2qs("Error near line %d, column %d"),exception.lineNumber(),exception.columnNumber());
+ KviTQString::sprintf(szMsg,__tr2qs("Error near line %d, column %d"),exception.lineNumber(),exception.columnNumber());
else
- KviQString::sprintf(szMsg,__tr2qs("Warning near line %d, column %d"),exception.lineNumber(),exception.columnNumber());
+ KviTQString::sprintf(szMsg,__tr2qs("Warning near line %d, column %d"),exception.lineNumber(),exception.columnNumber());
szMsg += ": ";
szMsg += exception.message();
}
@@ -187,7 +187,7 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool startElement(const QString &szNamespaceUri,const QString &szLocalName,const QString &szQualifiedName,const QXmlAttributes &attrs)
+ virtual bool startElement(const TQString &szNamespaceUri,const TQString &szLocalName,const TQString &szQualifiedName,const TQXmlAttributes &attrs)
{
KviKvsVariant ret;
KviKvsVariantList par;
@@ -205,7 +205,7 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool endElement(const QString &szNamespaceUri,const QString &szLocalName,const QString &szQualifiedName)
+ virtual bool endElement(const TQString &szNamespaceUri,const TQString &szLocalName,const TQString &szQualifiedName)
{
KviKvsVariant ret;
KviKvsVariantList par;
@@ -218,7 +218,7 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool characters(const QString &szChars)
+ virtual bool characters(const TQString &szChars)
{
KviKvsVariant ret;
KviKvsVariantList par;
@@ -229,10 +229,10 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool warning(const QXmlParseException &exception)
+ virtual bool warning(const TQXmlParseException &exception)
{
// recoverable
- QString szMsg;
+ TQString szMsg;
decodeException(szMsg,false,exception);
KviKvsVariant ret;
@@ -244,10 +244,10 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool error(const QXmlParseException &exception)
+ virtual bool error(const TQXmlParseException &exception)
{
// recoverable
- QString szMsg;
+ TQString szMsg;
decodeException(szMsg,false,exception);
KviKvsVariant ret;
@@ -259,21 +259,21 @@ public:
return handleKvsCallReturnValue(&ret);
}
- virtual bool fatalError(const QXmlParseException &exception)
+ virtual bool fatalError(const TQXmlParseException &exception)
{
- QString szMsg;
+ TQString szMsg;
decodeException(szMsg,true,exception);
m_pReader->fatalError(szMsg);
return true;
}
- virtual QString errorString()
+ virtual TQString errorString()
{
return m_szErrorString;
}
};
-#endif // !QT_NO_XML
+#endif // !TQT_NO_XML
KVSO_BEGIN_REGISTERCLASS(KviKvsObject_xmlreader,"xmlreader","object")
@@ -295,7 +295,7 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_xmlreader)
KVSO_BEGIN_DESTRUCTOR(KviKvsObject_xmlreader)
KVSO_END_DESTRUCTOR(KviKvsObject_xmlreader)
-void KviKvsObject_xmlreader::fatalError(const QString &szError)
+void KviKvsObject_xmlreader::fatalError(const TQString &szError)
{
m_szLastError = szError;
@@ -306,27 +306,27 @@ void KviKvsObject_xmlreader::fatalError(const QString &szError)
bool KviKvsObject_xmlreader::function_parse(KviKvsObjectFunctionCall *c)
{
- QString szString;
+ TQString szString;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("string",KVS_PT_STRING,0,szString)
KVSO_PARAMETERS_END(c)
-#ifdef QT_NO_XML
- fatalError(__tr2qs("XML support not available in the Qt library"));
+#ifdef TQT_NO_XML
+ fatalError(__tr2qs("XML support not available in the TQt library"));
c->returnValue()->setBoolean(false);
#else
m_szLastError = "";
KviXmlHandler handler(this);
- QXmlInputSource source;
+ TQXmlInputSource source;
// We have a problem here.. most kvirc functions already interpret the data
// read from files. We should have binary data handling features to get this to work correctly.
// The following snippet of code tries to provide a best-effort workaround.
- KviQCString utf8data = KviQString::toUtf8(szString);
- QByteArray data = utf8data;
+ KviTQCString utf8data = KviTQString::toUtf8(szString);
+ TQByteArray data = utf8data;
data.truncate(utf8data.length()); // don't include the null terminator in data
source.setData(data);
//debug("PARSING(%s) LEN(%d)",szString.utf8().data(),szString.utf8().length());
- QXmlSimpleReader reader;
+ TQXmlSimpleReader reader;
reader.setContentHandler(&handler);
reader.setErrorHandler(&handler);
c->returnValue()->setBoolean(reader.parse(source));