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>
remotes/origin/release/23.04
Juraj Oravec 3 years ago
parent 4926c7208c
commit 74cfccd69d
No known key found for this signature in database
GPG Key ID: 13660A3F1D9F093B
  1. 5
      src/lib/history/historymodel.cpp
  2. 1
      src/lib/history/historymodel.h
  3. 2
      src/lib/history/historytreeview.cpp

@ -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();
}

@ -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);

@ -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();

Loading…
Cancel
Save