From 29e891b3b146540d69a6377f1a557b246e8b8c68 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 24 Sep 2012 17:47:01 +0200 Subject: rekonq new tab page restored :) --- src/history/historymodels.h | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'src/history/historymodels.h') 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 #include #include +#include // 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 -- cgit v1.2.1