summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/controller.cpp')
-rw-r--r--framework/src/domain/controller.cpp13
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
131bool ListPropertyController::empty() const
132{
133 return mModel->rowCount() == 0;
123} 134}
124 135
125void ListPropertyController::clear() 136void ListPropertyController::clear()