File indexing completed on 2024-04-21 04:58:16

0001 /* This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2009 Pino Toscano <pino@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KONQ_HISTORYPROXYMODEL_H
0008 #define KONQ_HISTORYPROXYMODEL_H
0009 
0010 #include "ksortfilterproxymodel.h"
0011 
0012 class KonqHistorySettings;
0013 
0014 /**
0015  * Proxy model used for sorting and filtering the history model.
0016  *
0017  * It uses KSortFilterProxyModel instead of QSortFilterProxyModel so that one can
0018  * search in the history by typing parts of a page title (KSortFilterProxyModel keeps
0019  * parents of filtered items).
0020  */
0021 class KonqHistoryProxyModel : public KSortFilterProxyModel
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit KonqHistoryProxyModel(KonqHistorySettings *settings, QObject *parent = nullptr);
0027     ~KonqHistoryProxyModel() override;
0028 
0029     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0030 
0031 protected:
0032     bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
0033 
0034 private Q_SLOTS:
0035     void slotSettingsChanged();
0036 
0037 private:
0038     KonqHistorySettings *m_settings;
0039 };
0040 
0041 #endif // KONQ_HISTORYPROXYMODEL_H