fixed search filter

This commit is contained in:
csoler 2019-03-12 15:59:54 +01:00
parent 59b1d44e5b
commit c9561c2684
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
3 changed files with 94 additions and 100 deletions

View file

@ -76,6 +76,16 @@ public:
QUICK_VIEW_USER = 100
};
enum FilterType {
FILTER_TYPE_NONE = 0x00,
FILTER_TYPE_SUBJECT = 0x01, // These numbers have been carefuly chosen to match the ones in rsmsgs.h
FILTER_TYPE_FROM = 0x02,
FILTER_TYPE_DATE = 0x03,
FILTER_TYPE_CONTENT = 0x04,
FILTER_TYPE_TAGS = 0x05,
FILTER_TYPE_ATTACHMENTS = 0x06,
};
enum Roles{ SortRole = Qt::UserRole+1,
StatusRole = Qt::UserRole+2,
UnreadRole = Qt::UserRole+3,
@ -95,9 +105,9 @@ public:
void setCurrentBox(BoxName bn) ;
void setQuickViewFilter(QuickViewFilter fn) ;
void setFilter(int column, const QStringList& strings) ;
const RsMessageId& currentMessageId() const;
void setFilter(FilterType filter_type, const QStringList& strings) ;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
@ -170,7 +180,7 @@ private:
BoxName mCurrentBox ;
QuickViewFilter mQuickViewFilter ;
QStringList mFilterStrings;
int mFilterColumn;
FilterType mFilterType;
bool mFilteringEnabled;
std::vector<Rs::Msgs::MsgInfoSummary> mMessages;