From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: TQt4 port kmymoney This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp') diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp index 4df855b..382893a 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp @@ -28,7 +28,7 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer() { } -MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) +MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const TQDomElement& node) { if(!node.isNull()) { if("KEYVALUEPAIRS" != node.tagName()) @@ -36,9 +36,9 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) m_kvp.clear(); - QDomNodeList nodeList = node.elementsByTagName("PAIR"); + TQDomNodeList nodeList = node.elementsByTagName("PAIR"); for(unsigned int i = 0; i < nodeList.count(); ++i) { - const QDomElement& el(nodeList.item(i).toElement()); + const TQDomElement& el(nodeList.item(i).toElement()); m_kvp[el.attribute("key")] = el.attribute("value"); } } @@ -48,32 +48,32 @@ MyMoneyKeyValueContainer::~MyMoneyKeyValueContainer() { } -const QString& MyMoneyKeyValueContainer::value(const QString& key) const +const TQString& MyMoneyKeyValueContainer::value(const TQString& key) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) return (*it); - return QString::null; + return TQString(); } -void MyMoneyKeyValueContainer::setValue(const QString& key, const QString& value) +void MyMoneyKeyValueContainer::setValue(const TQString& key, const TQString& value) { m_kvp[key] = value; } -void MyMoneyKeyValueContainer::setPairs(const QMap& list) +void MyMoneyKeyValueContainer::setPairs(const TQMap& list) { m_kvp = list; } -void MyMoneyKeyValueContainer::deletePair(const QString& key) +void MyMoneyKeyValueContainer::deletePair(const TQString& key) { - QMap::Iterator it; + TQMap::Iterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) m_kvp.remove(it); } @@ -85,7 +85,7 @@ void MyMoneyKeyValueContainer::clear(void) bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& right) const { - QMap::ConstIterator it_a, it_b; + TQMap::ConstIterator it_a, it_b; it_a = m_kvp.begin(); it_b = right.m_kvp.begin(); @@ -101,20 +101,20 @@ bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& righ return (it_a == m_kvp.end() && it_b == right.m_kvp.end()); } -void MyMoneyKeyValueContainer::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyKeyValueContainer::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { if(m_kvp.count() != 0) { - QDomElement el = document.createElement("KEYVALUEPAIRS"); + TQDomElement el = document.createElement("KEYVALUEPAIRS"); - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_kvp.begin(); it != m_kvp.end(); ++it) { - QDomElement pair = document.createElement("PAIR"); + TQDomElement pair = document.createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); el.appendChild(pair); } - parent.appendChild(el); + tqparent.appendChild(el); } } -- cgit v1.2.1