From fc7aafe08f922fb15d077304b130071bb9e69392 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 26 Feb 2018 14:38:03 +0100 Subject: Finishing test log view + proper message display in log view --- framework/src/domain/maillistmodel.cpp | 33 +++++++++++++++++++++++++++++++++ framework/src/domain/maillistmodel.h | 4 ++++ 2 files changed, 37 insertions(+) (limited to 'framework') diff --git a/framework/src/domain/maillistmodel.cpp b/framework/src/domain/maillistmodel.cpp index e2f52d13..64621d2c 100644 --- a/framework/src/domain/maillistmodel.cpp +++ b/framework/src/domain/maillistmodel.cpp @@ -400,3 +400,36 @@ bool MailListModel::showInbox() const { return false; } + +void MailListModel::setEntityId(const QString &id) +{ + qDebug() << "Fixing mail ID: " << id << " and running mail query"; + using namespace Sink::ApplicationDomain; + Sink::Query query; + query.setFlags(Sink::Query::LiveQuery); + query.filter(id.toUtf8()); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + query.request(); + mFetchMails = true; + mFetchedMails.clear(); + // Latest mail at the top + sort(0, Qt::DescendingOrder); + runQuery(query); +} + +QString MailListModel::entityId() const +{ + return {}; +} diff --git a/framework/src/domain/maillistmodel.h b/framework/src/domain/maillistmodel.h index f83656b9..a6965915 100644 --- a/framework/src/domain/maillistmodel.h +++ b/framework/src/domain/maillistmodel.h @@ -33,6 +33,7 @@ class MailListModel : public QSortFilterProxyModel Q_PROPERTY (QVariant mail READ mail WRITE setMail) Q_PROPERTY (bool showDrafts READ showDrafts WRITE setShowDrafts) Q_PROPERTY (bool showInbox READ showInbox WRITE setShowInbox) + Q_PROPERTY (QString entityId READ entityId WRITE setEntityId) Q_PROPERTY (QString filter READ filter WRITE setFilter) @@ -93,6 +94,9 @@ public: void setShowInbox(bool); bool showInbox() const; + void setEntityId(const QString &id); + QString entityId() const; + private: void fetchMail(Sink::ApplicationDomain::Mail::Ptr mail); -- cgit v1.2.3