diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-29 10:57:12 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-29 10:57:12 -0500 |
| commit | fac9e51b6ec4e41d777c176e9bb1fadc0f9bc906 (patch) | |
| tree | 4a140cfd55b2883ee9a69f5dc4a0a6876845aaa2 /sigmod/Store.cpp | |
| parent | 0f2a0fe8bcbeefa62d0fd4fae89f0de6610fe993 (diff) | |
| download | sigen-fac9e51b6ec4e41d777c176e9bb1fadc0f9bc906.tar.gz sigen-fac9e51b6ec4e41d777c176e9bb1fadc0f9bc906.tar.xz sigen-fac9e51b6ec4e41d777c176e9bb1fadc0f9bc906.zip | |
Finished up converting classes to use CHECK macros
Diffstat (limited to 'sigmod/Store.cpp')
| -rw-r--r-- | sigmod/Store.cpp | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/sigmod/Store.cpp b/sigmod/Store.cpp index f5778dd4..3bd260cf 100644 --- a/sigmod/Store.cpp +++ b/sigmod/Store.cpp @@ -53,7 +53,7 @@ void Sigmod::Store::validate() if (m_name.isEmpty()) emit(error("Name is empty")); if (m_item.size()) - TEST_LIST(setItem, item); + TEST_LIST(item); else emit(error("No items in the store")); TEST_END(); @@ -72,41 +72,14 @@ QDomElement Sigmod::Store::save() const return xml; } -void Sigmod::Store::setName(const QString& name) -{ - CHECK(name); -} - -void Sigmod::Store::setItem(const int item, const bool state) -{ - if (!sigmod()->itemById(item)) - emit(error(bounds("item", item))); - else if (state && !m_item.contains(item)) - { - m_item.append(item); - emit(changed()); - } - else if (m_item.contains(item)) - { - m_item.removeAll(item); - emit(changed()); - } -} - -QString Sigmod::Store::name() const -{ - return m_name; -} +SETTER(Store, QString&, Name, name) +SETTER_LIST(Store, Item, item) -bool Sigmod::Store::item(const int item) const -{ - return m_item.contains(item); -} +GETTER(Store, QString, name) +GETTER_LIST(Store, item) -QList<int> Sigmod::Store::items() const -{ - return m_item; -} +CHECK(Store, QString&, name) +CHECK_INDEX(Store, int, item, sigmod(), item) Sigmod::Store& Sigmod::Store::operator=(const Store& rhs) { |
