summaryrefslogtreecommitdiff
path: root/src/history/historymodels.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/history/historymodels.h')
-rw-r--r--src/history/historymodels.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/history/historymodels.h b/src/history/historymodels.h
index 44569fa2..be0cb442 100644
--- a/src/history/historymodels.h
+++ b/src/history/historymodels.h
@@ -26,8 +26,8 @@
* ============================================================ */
-#ifndef HISTORYMODELS_H
-#define HISTORYMODELS_H
+#ifndef HISTORY_MODELS_H
+#define HISTORY_MODELS_H
// Rekonq Includes
@@ -40,6 +40,7 @@
#include <QHash>
#include <QAbstractTableModel>
#include <QAbstractProxyModel>
+#include <QSortFilterProxyModel>
// Forward Declarations
class HistoryManager;
@@ -176,4 +177,28 @@ private:
};
-#endif // HISTORYMODELS_H
+// ----------------------------------------------------------------------------------------------------------------------
+
+
+/**
+ * QSortFilterProxyModel hides all children which parent doesn't
+ * match the filter. This class is used to change this behavior.
+ * If a url matches the filter it'll be shown,
+ * even if it's parent doesn't match it.
+ */
+class UrlFilterProxyModel : public QSortFilterProxyModel
+{
+ Q_OBJECT
+
+public:
+ explicit UrlFilterProxyModel(QObject *parent = 0);
+
+protected:
+ virtual bool filterAcceptsRow(const int source_row, const QModelIndex &source_parent) const;
+
+ // returns true if index or any of his children match the filter
+ bool recursiveMatch(const QModelIndex &index) const;
+};
+
+
+#endif // HISTORY_MODELS_H