From 7339cc0c0a0c63576f38f0bc96c15f28967b92d1 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 30 Mar 2017 13:51:09 +0200 Subject: Indicate if the outbox is not empty ..we could of course also just hide the outbox if empty. --- framework/domain/outboxmodel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'framework/domain/outboxmodel.cpp') diff --git a/framework/domain/outboxmodel.cpp b/framework/domain/outboxmodel.cpp index b82c1c6b..68a0e8be 100644 --- a/framework/domain/outboxmodel.cpp +++ b/framework/domain/outboxmodel.cpp @@ -40,6 +40,8 @@ OutboxModel::OutboxModel(QObject *parent) query.request(); query.request(); runQuery(query); + connect(this, &QAbstractItemModel::rowsInserted, this, &OutboxModel::countChanged); + connect(this, &QAbstractItemModel::rowsRemoved, this, &OutboxModel::countChanged); } OutboxModel::~OutboxModel() @@ -96,3 +98,7 @@ void OutboxModel::runQuery(const Sink::Query &query) setSourceModel(m_model.data()); } +int OutboxModel::count() const +{ + return rowCount(); +} -- cgit v1.2.3