summaryrefslogtreecommitdiffstats
path: root/src/xmlwork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlwork.cpp')
-rw-r--r--src/xmlwork.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/xmlwork.cpp b/src/xmlwork.cpp
index 92c2aca..41eefc5 100644
--- a/src/xmlwork.cpp
+++ b/src/xmlwork.cpp
@@ -18,24 +18,24 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qdom.h>
-#include <qstringlist.h>
-#include <qfile.h>
+#include <tqstring.h>
+#include <tqdom.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
#include "xmlwork.h"
-QDomDocument* XMLWork::openFile(const QString &name, const QString &filePath)
+TQDomDocument* XMLWork::openFile(const TQString &name, const TQString &filePath)
{
- QDomDocument *doc = new QDomDocument(name);
- QFile file(filePath);
+ TQDomDocument *doc = new TQDomDocument(name);
+ TQFile file(filePath);
if ( ! file.open(IO_ReadOnly) ) {
- // QMessageBox::information(this, "Load an XML file", "Error : un-openable file");
+ // TQMessageBox::information(this, "Load an XML file", "Error : un-openable file");
delete doc;
return 0;
}
if ( ! doc->setContent(&file) ) {
- // QMessageBox::information(this, "Load an XML file", "Error : malformed content");
+ // TQMessageBox::information(this, "Load an XML file", "Error : malformed content");
file.close();
delete doc;
return 0;
@@ -44,13 +44,13 @@ QDomDocument* XMLWork::openFile(const QString &name, const QString &filePath)
return doc;
}
-QDomElement XMLWork::getElement(const QDomElement &startElement, const QString &elementPath)
+TQDomElement XMLWork::getElement(const TQDomElement &startElement, const TQString &elementPath)
{
- QStringList elements = QStringList::split("/", elementPath, false);
- QDomNode n = startElement.firstChild();
+ TQStringList elements = TQStringList::split("/", elementPath, false);
+ TQDomNode n = startElement.firstChild();
for (unsigned int i = 0; i < elements.count(); ++i) { // For each elements
while ( ! n.isNull() ) { // Browse theire sub elements
- QDomElement e = n.toElement(); // and search the good one
+ TQDomElement e = n.toElement(); // and search the good one
if ( (!e.isNull()) && e.tagName() == *elements.at(i) ) { // If found
if ( i + 1 == elements.count() ) // And if it is the asked element
return e; // Return the first corresponding
@@ -62,27 +62,27 @@ QDomElement XMLWork::getElement(const QDomElement &startElement, const QString &
n = n.nextSibling();
}
}
- return QDomElement(); // Not found !
+ return TQDomElement(); // Not found !
}
-QString XMLWork::getElementText(const QDomElement &startElement, const QString &elementPath, const QString &defaultTxt)
+TQString XMLWork::getElementText(const TQDomElement &startElement, const TQString &elementPath, const TQString &defaultTxt)
{
- QDomElement e = getElement(startElement, elementPath);
+ TQDomElement e = getElement(startElement, elementPath);
if (e.isNull())
return defaultTxt;
else
return e.text();
}
-void XMLWork::addElement(QDomDocument &document, QDomElement &parent, const QString &name, const QString &text)
+void XMLWork::addElement(TQDomDocument &document, TQDomElement &tqparent, const TQString &name, const TQString &text)
{
- QDomElement tag = document.createElement(name);
- parent.appendChild(tag);
- QDomText content = document.createTextNode(text);
+ TQDomElement tag = document.createElement(name);
+ tqparent.appendChild(tag);
+ TQDomText content = document.createTextNode(text);
tag.appendChild(content);
}
-bool XMLWork::trueOrFalse(const QString &value, bool defaultValue)
+bool XMLWork::trueOrFalse(const TQString &value, bool defaultValue)
{
if ( value == "true" || value == "1" || value == "on" || value == "yes" )
return true;
@@ -91,19 +91,19 @@ bool XMLWork::trueOrFalse(const QString &value, bool defaultValue)
return defaultValue;
}
-QString XMLWork::trueOrFalse(bool value)
+TQString XMLWork::trueOrFalse(bool value)
{
return value ? "true" : "false";
}
-QString XMLWork::innerXml(QDomElement &element)
+TQString XMLWork::innerXml(TQDomElement &element)
{
- QString inner;
- for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling())
+ TQString inner;
+ for (TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling())
if (n.isCharacterData())
inner += n.toCharacterData().data();
else if (n.isElement()) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
inner += "<" + e.tagName() + ">" + innerXml(e) + "</" + e.tagName() + ">";
}
return inner;