modernize: Use nullptr
[quassel.git] / src / uisupport / bufferviewfilter.h
index 5cf0cce..69f8928 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -18,8 +18,9 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BUFFERVIEWFILTER_H_
-#define BUFFERVIEWFILTER_H_
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QAction>
 #include <QDropEvent>
@@ -34,7 +35,7 @@
 /*****************************************
  * Buffer View Filter
  *****************************************/
-class BufferViewFilter : public QSortFilterProxyModel
+class UISUPPORT_EXPORT BufferViewFilter : public QSortFilterProxyModel
 {
     Q_OBJECT
 
@@ -51,7 +52,7 @@ 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);
@@ -69,6 +70,8 @@ public:
 
     QList<QAction *> 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;
@@ -93,6 +96,7 @@ private:
     QSet<BufferId> _toAdd;
     QSet<BufferId> _toTempRemove;
     QSet<BufferId> _toRemove;
+    QString _filterString;
 
     bool filterAcceptBuffer(const QModelIndex &) const;
     bool filterAcceptNetwork(const QModelIndex &) const;
@@ -103,5 +107,3 @@ private:
 
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)
-
-#endif // BUFFERVIEWFILTER_H_