mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36: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:
parent
cdcdd3379e
commit
85f9990104
@ -561,3 +561,8 @@ bool HistoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sour
|
|||||||
return (index.data(HistoryModel::UrlStringRole).toString().contains(m_pattern, Qt::CaseInsensitive) ||
|
return (index.data(HistoryModel::UrlStringRole).toString().contains(m_pattern, Qt::CaseInsensitive) ||
|
||||||
index.data(HistoryModel::TitleRole).toString().contains(m_pattern, Qt::CaseInsensitive));
|
index.data(HistoryModel::TitleRole).toString().contains(m_pattern, Qt::CaseInsensitive));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HistoryFilterModel::isPatternEmpty() const
|
||||||
|
{
|
||||||
|
return m_pattern.isEmpty();
|
||||||
|
}
|
||||||
|
@ -89,6 +89,7 @@ class FALKON_EXPORT HistoryFilterModel : public QSortFilterProxyModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit HistoryFilterModel(QAbstractItemModel* parent);
|
explicit HistoryFilterModel(QAbstractItemModel* parent);
|
||||||
|
bool isPatternEmpty() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void setFilterFixedString(const QString &pattern);
|
void setFilterFixedString(const QString &pattern);
|
||||||
|
@ -111,7 +111,7 @@ void HistoryTreeView::removeSelectedItems()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index.data(HistoryModel::IsTopLevelRole).toBool()) {
|
if ((index.data(HistoryModel::IsTopLevelRole).toBool()) && (m_filter->isPatternEmpty())) {
|
||||||
qint64 start = index.data(HistoryModel::TimestampStartRole).toLongLong();
|
qint64 start = index.data(HistoryModel::TimestampStartRole).toLongLong();
|
||||||
qint64 end = index.data(HistoryModel::TimestampEndRole).toLongLong();
|
qint64 end = index.data(HistoryModel::TimestampEndRole).toLongLong();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user