Browse Source

Support wildcards for filtering torrent list and torrent content

adaptive-webui-19844
vlakoff 9 years ago
parent
commit
692cac1dc5
  1. 2
      src/gui/properties/propertieswidget.cpp
  2. 1
      src/gui/torrentcontentfiltermodel.cpp
  3. 2
      src/gui/transferlistwidget.cpp

2
src/gui/properties/propertieswidget.cpp

@ -857,7 +857,7 @@ void PropertiesWidget::filteredFilesChanged() {
} }
void PropertiesWidget::filterText(const QString& filter) { void PropertiesWidget::filterText(const QString& filter) {
PropListModel->setFilterFixedString(filter); PropListModel->setFilterRegExp(QRegExp(filter, Qt::CaseInsensitive, QRegExp::WildcardUnix));
if (filter.isEmpty()) { if (filter.isEmpty()) {
filesList->collapseAll(); filesList->collapseAll();
filesList->expand(PropListModel->index(0, 0)); filesList->expand(PropListModel->index(0, 0));

1
src/gui/torrentcontentfiltermodel.cpp

@ -38,7 +38,6 @@ TorrentContentFilterModel::TorrentContentFilterModel(QObject *parent):
connect(m_model, SIGNAL(filteredFilesChanged()), this, SIGNAL(filteredFilesChanged())); connect(m_model, SIGNAL(filteredFilesChanged()), this, SIGNAL(filteredFilesChanged()));
setSourceModel(m_model); setSourceModel(m_model);
// Filter settings // Filter settings
setFilterCaseSensitivity(Qt::CaseInsensitive);
setFilterKeyColumn(TorrentContentModelItem::COL_NAME); setFilterKeyColumn(TorrentContentModelItem::COL_NAME);
setFilterRole(Qt::DisplayRole); setFilterRole(Qt::DisplayRole);
setDynamicSortFilter(true); setDynamicSortFilter(true);

2
src/gui/transferlistwidget.cpp

@ -874,7 +874,7 @@ void TransferListWidget::applyTrackerFilter(const QStringList &hashes)
void TransferListWidget::applyNameFilter(const QString& name) 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) void TransferListWidget::applyStatusFilter(int f)

Loading…
Cancel
Save