diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-25 12:16:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-25 14:03:13 +0100 |
commit | 27ab6710b6626517d1386cd90ca9065d3d36f370 (patch) | |
tree | 63ff68ac8f7dc6156f57f6dd3f5f190a96b8797d /framework/src/domain/controller.cpp | |
parent | ad10788ac3a60bffe053cec172e0e750f393905a (diff) | |
download | kube-27ab6710b6626517d1386cd90ca9065d3d36f370.tar.gz kube-27ab6710b6626517d1386cd90ca9065d3d36f370.zip |
Require a recipient for a mail.
Diffstat (limited to 'framework/src/domain/controller.cpp')
-rw-r--r-- | framework/src/domain/controller.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/framework/src/domain/controller.cpp b/framework/src/domain/controller.cpp index 515cfab0..226615ad 100644 --- a/framework/src/domain/controller.cpp +++ b/framework/src/domain/controller.cpp | |||
@@ -107,6 +107,9 @@ void ListPropertyController::add(const QVariantMap &value) | |||
107 | item->setData(value.value(k), mRoles[k]); | 107 | item->setData(value.value(k), mRoles[k]); |
108 | } | 108 | } |
109 | mModel->appendRow(QList<QStandardItem*>() << item); | 109 | mModel->appendRow(QList<QStandardItem*>() << item); |
110 | if (mModel->rowCount() <= 1) { | ||
111 | emit emptyChanged(); | ||
112 | } | ||
110 | emit added(id, value); | 113 | emit added(id, value); |
111 | } | 114 | } |
112 | 115 | ||
@@ -117,9 +120,17 @@ void ListPropertyController::remove(const QByteArray &id) | |||
117 | for (int row = 0; row < root->rowCount(); row++) { | 120 | for (int row = 0; row < root->rowCount(); row++) { |
118 | if (root->child(row, 0)->data(idRole).toByteArray() == id) { | 121 | if (root->child(row, 0)->data(idRole).toByteArray() == id) { |
119 | root->removeRow(row); | 122 | root->removeRow(row); |
120 | return; | 123 | break; |
121 | } | 124 | } |
122 | } | 125 | } |
126 | if (mModel->rowCount() <= 0) { | ||
127 | emit emptyChanged(); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | bool ListPropertyController::empty() const | ||
132 | { | ||
133 | return mModel->rowCount() == 0; | ||
123 | } | 134 | } |
124 | 135 | ||
125 | void ListPropertyController::clear() | 136 | void ListPropertyController::clear() |