Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneytag.cpp
Show All 16 Lines | |||||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "mymoneytag.h" | 19 | #include "mymoneytag.h" | ||
20 | #include "mymoneytag_p.h" | 20 | #include "mymoneytag_p.h" | ||
21 | 21 | | |||
22 | // ---------------------------------------------------------------------------- | 22 | // ---------------------------------------------------------------------------- | ||
23 | // QT Includes | 23 | // QT Includes | ||
24 | 24 | | |||
25 | #include <QDomDocument> | | |||
26 | #include <QDomElement> | | |||
27 | | ||||
28 | // ---------------------------------------------------------------------------- | 25 | // ---------------------------------------------------------------------------- | ||
29 | // Project Includes | 26 | // Project Includes | ||
30 | 27 | | |||
31 | #include "mymoneyexception.h" | 28 | #include "mymoneyexception.h" | ||
32 | #include "mymoneystoragenames.h" | 29 | #include "mymoneystoragenames.h" | ||
33 | 30 | | |||
34 | using namespace MyMoneyStorageNodes; | 31 | using namespace MyMoneyStorageNodes; | ||
35 | 32 | | |||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | |||||
135 | 132 | | |||
136 | bool MyMoneyTag::operator < (const MyMoneyTag& right) const | 133 | bool MyMoneyTag::operator < (const MyMoneyTag& right) const | ||
137 | { | 134 | { | ||
138 | Q_D(const MyMoneyTag); | 135 | Q_D(const MyMoneyTag); | ||
139 | auto d2 = static_cast<const MyMoneyTagPrivate *>(right.d_func()); | 136 | auto d2 = static_cast<const MyMoneyTagPrivate *>(right.d_func()); | ||
140 | return d->m_name < d2->m_name; | 137 | return d->m_name < d2->m_name; | ||
141 | } | 138 | } | ||
142 | 139 | | |||
143 | void MyMoneyTag::writeXML(QDomDocument& document, QDomElement& parent) const | | |||
144 | { | | |||
145 | auto el = document.createElement(nodeNames[nnTag]); | | |||
146 | | ||||
147 | Q_D(const MyMoneyTag); | | |||
148 | d->writeBaseXML(document, el); | | |||
149 | | ||||
150 | el.setAttribute(d->getAttrName(Tag::Attribute::Name), d->m_name); | | |||
151 | el.setAttribute(d->getAttrName(Tag::Attribute::Closed), d->m_closed); | | |||
152 | if (d->m_tag_color.isValid()) | | |||
153 | el.setAttribute(d->getAttrName(Tag::Attribute::TagColor), d->m_tag_color.name()); | | |||
154 | if (!d->m_notes.isEmpty()) | | |||
155 | el.setAttribute(d->getAttrName(Tag::Attribute::Notes), d->m_notes); | | |||
156 | parent.appendChild(el); | | |||
157 | } | | |||
158 | | ||||
159 | bool MyMoneyTag::hasReferenceTo(const QString& /*id*/) const | 140 | bool MyMoneyTag::hasReferenceTo(const QString& /*id*/) const | ||
160 | { | 141 | { | ||
161 | return false; | 142 | return false; | ||
162 | } | 143 | } |