summaryrefslogtreecommitdiff
path: root/src/history/historymodels.h
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-09-24 17:47:01 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit29e891b3b146540d69a6377f1a557b246e8b8c68 (patch)
treed5cff4e1d2ad4179013aab4dcaf366597f7702ca /src/history/historymodels.h
parentsetting a decent minimum size... (diff)
downloadrekonq-29e891b3b146540d69a6377f1a557b246e8b8c68.tar.xz
rekonq new tab page restored :)
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