From 692cac1dc54d85550f975825be4330da1b3fd4a3 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Thu, 26 Nov 2015 19:02:43 +0100 Subject: [PATCH] Support wildcards for filtering torrent list and torrent content --- src/gui/properties/propertieswidget.cpp | 2 +- src/gui/torrentcontentfiltermodel.cpp | 1 - src/gui/transferlistwidget.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 49ff7e1d4..29e50dc81 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -857,7 +857,7 @@ void PropertiesWidget::filteredFilesChanged() { } void PropertiesWidget::filterText(const QString& filter) { - PropListModel->setFilterFixedString(filter); + PropListModel->setFilterRegExp(QRegExp(filter, Qt::CaseInsensitive, QRegExp::WildcardUnix)); if (filter.isEmpty()) { filesList->collapseAll(); filesList->expand(PropListModel->index(0, 0)); diff --git a/src/gui/torrentcontentfiltermodel.cpp b/src/gui/torrentcontentfiltermodel.cpp index dd1afa754..48c9e2e6b 100644 --- a/src/gui/torrentcontentfiltermodel.cpp +++ b/src/gui/torrentcontentfiltermodel.cpp @@ -38,7 +38,6 @@ TorrentContentFilterModel::TorrentContentFilterModel(QObject *parent): connect(m_model, SIGNAL(filteredFilesChanged()), this, SIGNAL(filteredFilesChanged())); setSourceModel(m_model); // Filter settings - setFilterCaseSensitivity(Qt::CaseInsensitive); setFilterKeyColumn(TorrentContentModelItem::COL_NAME); setFilterRole(Qt::DisplayRole); setDynamicSortFilter(true); diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index d8f2eb73d..80ce73b23 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -874,7 +874,7 @@ void TransferListWidget::applyTrackerFilter(const QStringList &hashes) void TransferListWidget::applyNameFilter(const QString& name) { - nameFilterModel->setFilterRegExp(QRegExp(QRegExp::escape(name), Qt::CaseInsensitive)); + nameFilterModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive, QRegExp::WildcardUnix)); } void TransferListWidget::applyStatusFilter(int f)