X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fbufferviewfilter.h;h=c139ecb42d94cee33504edfd2305541400ac0ba1;hp=edda7ac85b35a23f76220a8b7934028842a280b6;hb=114eac810e1159fab7cc00834f380c909dd51a50;hpb=974b7adc16b798eda66e1fff1442b73b748f12f9 diff --git a/src/qtui/bufferviewfilter.h b/src/qtui/bufferviewfilter.h index edda7ac8..c139ecb4 100644 --- a/src/qtui/bufferviewfilter.h +++ b/src/qtui/bufferviewfilter.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "buffer.h" #include "buffertreemodel.h" @@ -46,23 +47,28 @@ public: }; Q_DECLARE_FLAGS(Modes, Mode); - BufferViewFilter(QAbstractItemModel *model, const Modes &mode, const QStringList &nets); + BufferViewFilter(QAbstractItemModel *model, const Modes &mode, const QList &nets); + + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); public slots: - void invalidateMe(); - void dropEvent(QDropEvent *); void removeBuffer(const QModelIndex &); - + void invalidateFilter_(); + +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; + bool lessThan(const QModelIndex &, const QModelIndex &) const; + private: + Modes mode; + QSet networks; + QSet buffers; + bool filterAcceptBuffer(const QModelIndex &) const; bool filterAcceptNetwork(const QModelIndex &) const; - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; - bool lessThan(const QModelIndex &, const QModelIndex &); void addBuffer(const uint &); - - Modes mode; - QStringList networks; - QList customBuffers; + }; Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)