1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26:34 +01:00

History: Don't delete all items under dates when filtering

BUG: 466936
FIXED-IN: 23.04.0

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2023-03-25 03:11:26 +01:00
parent cdcdd3379e
commit 85f9990104
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
3 changed files with 7 additions and 1 deletions

View File

@ -561,3 +561,8 @@ bool HistoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sour
return (index.data(HistoryModel::UrlStringRole).toString().contains(m_pattern, Qt::CaseInsensitive) ||
index.data(HistoryModel::TitleRole).toString().contains(m_pattern, Qt::CaseInsensitive));
}
bool HistoryFilterModel::isPatternEmpty() const
{
return m_pattern.isEmpty();
}

View File

@ -89,6 +89,7 @@ class FALKON_EXPORT HistoryFilterModel : public QSortFilterProxyModel
Q_OBJECT
public:
explicit HistoryFilterModel(QAbstractItemModel* parent);
bool isPatternEmpty() const;
public Q_SLOTS:
void setFilterFixedString(const QString &pattern);

View File

@ -111,7 +111,7 @@ void HistoryTreeView::removeSelectedItems()
continue;
}
if (index.data(HistoryModel::IsTopLevelRole).toBool()) {
if ((index.data(HistoryModel::IsTopLevelRole).toBool()) && (m_filter->isPatternEmpty())) {
qint64 start = index.data(HistoryModel::TimestampStartRole).toLongLong();
qint64 end = index.data(HistoryModel::TimestampEndRole).toLongLong();