X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.h;h=c97cc7a17a9916faa693304c4344e5d54eb3b174;hp=f53662a1a550a3d40efa55395617f08445afaeab;hb=HEAD;hpb=92fc8c5b119111a35ab8423c3cbde5b2a022badf diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index f53662a1..c97cc7a1 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -29,8 +29,8 @@ #include #include -#include "types.h" #include "bufferviewconfig.h" +#include "types.h" /***************************************** * Buffer View Filter @@ -40,7 +40,8 @@ class UISUPPORT_EXPORT BufferViewFilter : public QSortFilterProxyModel Q_OBJECT public: - enum Mode { + enum Mode + { NoActive = 0x01, NoInactive = 0x02, SomeNets = 0x04, @@ -52,31 +53,31 @@ public: }; Q_DECLARE_FLAGS(Modes, Mode) - BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0); + BufferViewFilter(QAbstractItemModel* model, BufferViewConfig* config = nullptr); - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); + Qt::ItemFlags flags(const QModelIndex& index) const override; + bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override; - QVariant data(const QModelIndex &index, int role) const; - QVariant checkedState(const QModelIndex &index) const; + QVariant data(const QModelIndex& index, int role) const override; + QVariant checkedState(const QModelIndex& index) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - bool setCheckedState(const QModelIndex &index, Qt::CheckState state); + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; + bool setCheckedState(const QModelIndex& index, Qt::CheckState state); - void setConfig(BufferViewConfig *config); - inline BufferViewConfig *config() const { return _config; } + void setConfig(BufferViewConfig* config); + inline BufferViewConfig* config() const { return _config; } - virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; - QList actions(const QModelIndex &index); + QList actions(const QModelIndex& index); void setFilterString(const QString string); protected: - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; - bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; - bool bufferLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; - bool networkLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; + bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const override; + bool bufferLessThan(const QModelIndex& source_left, const QModelIndex& source_right) const; + bool networkLessThan(const QModelIndex& source_left, const QModelIndex& source_right) const; signals: void configChanged(); @@ -98,12 +99,11 @@ private: QSet _toRemove; QString _filterString; - bool filterAcceptBuffer(const QModelIndex &) const; - bool filterAcceptNetwork(const QModelIndex &) const; - void addBuffer(const BufferId &bufferId) const; - void addBuffers(const QList &bufferIds) const; - static bool bufferIdLessThan(const BufferId &, const BufferId &); + bool filterAcceptBuffer(const QModelIndex&) const; + bool filterAcceptNetwork(const QModelIndex&) const; + void addBuffer(const BufferId& bufferId) const; + void addBuffers(const QList& bufferIds) const; + static bool bufferIdLessThan(const BufferId&, const BufferId&); }; - Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)