diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-16 19:54:22 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-16 20:03:39 +0200 |
commit | 39a2a9dab5244bc9114eb006a71d04c43ca4be53 (patch) | |
tree | a2ac6ef35dbef68f434d3eb5d11a4d7a25643e21 /framework/src/accounts/accountsmodel.cpp | |
parent | e300ef292f3b54de48958ccfef88129f0ae6bf0e (diff) | |
download | kube-39a2a9dab5244bc9114eb006a71d04c43ca4be53.tar.gz kube-39a2a9dab5244bc9114eb006a71d04c43ca4be53.zip |
Avoid running queries with empty ids
Diffstat (limited to 'framework/src/accounts/accountsmodel.cpp')
-rw-r--r-- | framework/src/accounts/accountsmodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/src/accounts/accountsmodel.cpp b/framework/src/accounts/accountsmodel.cpp index f98e8ca3..8b46f4d3 100644 --- a/framework/src/accounts/accountsmodel.cpp +++ b/framework/src/accounts/accountsmodel.cpp | |||
@@ -85,7 +85,11 @@ void AccountsModel::runQuery(const Sink::Query &query) | |||
85 | void AccountsModel::setAccountId(const QByteArray &accountId) | 85 | void AccountsModel::setAccountId(const QByteArray &accountId) |
86 | { | 86 | { |
87 | qWarning() << "Setting account id" << accountId; | 87 | qWarning() << "Setting account id" << accountId; |
88 | //Get all folders of an account | 88 | if (accountId.isEmpty()) { |
89 | setSourceModel(nullptr); | ||
90 | mModel.clear(); | ||
91 | return; | ||
92 | } | ||
89 | Sink::Query query; | 93 | Sink::Query query; |
90 | query.filter(accountId); | 94 | query.filter(accountId); |
91 | query.setFlags(Query::LiveQuery); | 95 | query.setFlags(Query::LiveQuery); |