summaryrefslogtreecommitdiffstats
path: root/sigmod/Store.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-29 12:09:27 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-29 12:09:27 -0500
commit8e278873d4bd35a7cd7f3b6d9d7852fa422370b8 (patch)
tree9e97b71d30779c07c79ca166e1d704a3de4d5e4f /sigmod/Store.cpp
parente801b73a2f9cb845913cf546002c8f50eefc473c (diff)
Merged CHECK macro branch
Diffstat (limited to 'sigmod/Store.cpp')
-rw-r--r--sigmod/Store.cpp41
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)
{