From 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 00:15:53 +0000 Subject: TQt4 port piklab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/common/global/xml_data_file.cpp | 108 ++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'src/common/global/xml_data_file.cpp') diff --git a/src/common/global/xml_data_file.cpp b/src/common/global/xml_data_file.cpp index 2464b34..30d42cd 100644 --- a/src/common/global/xml_data_file.cpp +++ b/src/common/global/xml_data_file.cpp @@ -8,25 +8,25 @@ ***************************************************************************/ #include "xml_data_file.h" -#include -#include +#include +#include #include #include #include "common/global/pfile.h" -XmlDataFile::XmlDataFile(const PURL::Url &url, const QString &name) +XmlDataFile::XmlDataFile(const PURL::Url &url, const TQString &name) : _url(url), _name(name), _document(name) { - QDomElement root = _document.createElement(name); + TQDomElement root = _document.createElement(name); _document.appendChild(root); } -bool XmlDataFile::load(QString &error) +bool XmlDataFile::load(TQString &error) { Log::StringView sview; PURL::File file(_url, sview); if ( !file.openForRead() ) { - error = i18n("Error opening file: %1").arg(sview.string()); + error = i18n("Error opening file: %1").tqarg(sview.string()); return false; } if ( !_document.setContent(file.qfile(), false, &error) ) return false; @@ -38,122 +38,122 @@ bool XmlDataFile::load(QString &error) return true; } -bool XmlDataFile::save(QString &error) const +bool XmlDataFile::save(TQString &error) const { Log::StringView sview; PURL::File file(_url, sview); bool ok = file.openForWrite(); if (ok) { - QString s = _document.toString(2); + TQString s = _document.toString(2); file.appendText(s); ok = file.close(); } - if ( !ok ) error = i18n("Error saving file: %1").arg(sview.string()); + if ( !ok ) error = i18n("Error saving file: %1").tqarg(sview.string()); return ok; } -QDomElement XmlDataFile::findChildElement(QDomElement parent, const QString &name) const +TQDomElement XmlDataFile::findChildElement(TQDomElement tqparent, const TQString &name) const { - QDomNodeList list = parent.elementsByTagName(name); + TQDomNodeList list = tqparent.elementsByTagName(name); return list.item(0).toElement(); } -QDomElement XmlDataFile::createChildElement(QDomElement parent, const QString &name) +TQDomElement XmlDataFile::createChildElement(TQDomElement tqparent, const TQString &name) { - QDomNodeList list = parent.elementsByTagName(name); + TQDomNodeList list = tqparent.elementsByTagName(name); if ( list.count()==0 ) { - QDomElement element = _document.createElement(name); - parent.appendChild(element); + TQDomElement element = _document.createElement(name); + tqparent.appendChild(element); return element; } return list.item(0).toElement(); } -void XmlDataFile::removeChilds(QDomNode parent) const +void XmlDataFile::removeChilds(TQDomNode tqparent) const { - QDomNodeList list = parent.childNodes(); + TQDomNodeList list = tqparent.childNodes(); for (uint i=0; i