Labels are now available in msg filtering.

This commit is contained in:
Martin Rotter 2020-10-26 12:13:01 +01:00
parent 7f49c2883b
commit 670235e37e
5 changed files with 22 additions and 7 deletions

View File

@ -289,3 +289,7 @@ QString MessageObject::feedCustomId() const {
int MessageObject::accountId() const {
return m_accountId;
}
QList<Label*> MessageObject::assignedLabels() const {
return m_message->m_assignedLabels;
}

View File

@ -118,6 +118,7 @@ inline DuplicationAttributeCheck operator&(DuplicationAttributeCheck lhs, Duplic
class MessageObject : public QObject {
Q_OBJECT
Q_PROPERTY(QList<Label*> assignedLabels READ assignedLabels)
Q_PROPERTY(QString feedCustomId READ feedCustomId)
Q_PROPERTY(int accountId READ accountId)
Q_PROPERTY(QString title READ title WRITE setTitle)
@ -138,6 +139,8 @@ class MessageObject : public QObject {
// value casted to int.
Q_INVOKABLE bool isDuplicateWithAttribute(int attribute_check) const;
QList<Label*> assignedLabels() const;
// Generic Message's properties bindings.
QString feedCustomId() const;
int accountId() const;

View File

@ -7,9 +7,12 @@
#include <QColor>
class Label : public RootItem {
class RSSGUARD_DLLSPEC Label : public RootItem {
Q_OBJECT
Q_PROPERTY(QString customId READ customId)
Q_PROPERTY(QColor color READ color)
public:
explicit Label(const QString& name, const QColor& color, RootItem* parent_item = nullptr);
explicit Label(RootItem* parent_item = nullptr);

View File

@ -21,6 +21,8 @@ class QAction;
class RSSGUARD_DLLSPEC RootItem : public QObject {
Q_OBJECT
Q_PROPERTY(QString title READ title)
public:
enum class ReadStatus {
Unread = 0,

View File

@ -6,6 +6,7 @@
#include "gui/feedmessageviewer.h"
#include "gui/feedsview.h"
#include "miscellaneous/application.h"
#include "services/abstract/label.h"
#if defined (Q_OS_MACOS)
extern void disableWindowTabbing();
@ -58,6 +59,8 @@ int main(int argc, char* argv[]) {
// Register needed metatypes.
qRegisterMetaType<QList<Message>>("QList<Message>");
qRegisterMetaType<QList<RootItem*>>("QList<RootItem*>");
qRegisterMetaType<QList<Label*>>("QList<Label*>");
qRegisterMetaType<Label*>("Label*");
// Add an extra path for non-system icon themes and set current icon theme
// and skin.