From 06c8e658aaae87473e5b433215618d018664dbda Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 28 Aug 2012 18:36:10 +0300 Subject: [PATCH] Correctly escape transfer list filter value typed by user --- src/transferlistwidget.cpp | 4 ++-- src/transferlistwidget.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index a70f7b7e0..438165b51 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -859,8 +859,8 @@ void TransferListWidget::applyLabelFilter(QString label) { labelFilterModel->setFilterRegExp(QRegExp("^" + QRegExp::escape(label) + "$", Qt::CaseSensitive)); } -void TransferListWidget::applyNameFilter(QString name) { - nameFilterModel->setFilterRegExp(QRegExp(name, Qt::CaseInsensitive)); +void TransferListWidget::applyNameFilter(const QString& name) { + nameFilterModel->setFilterRegExp(QRegExp(QRegExp::escape(name), Qt::CaseInsensitive)); } void TransferListWidget::applyStatusFilter(int f) { diff --git a/src/transferlistwidget.h b/src/transferlistwidget.h index 27b04725c..98fd23530 100644 --- a/src/transferlistwidget.h +++ b/src/transferlistwidget.h @@ -78,7 +78,7 @@ public slots: void previewSelectedTorrents(); void hidePriorityColumn(bool hide); void displayDLHoSMenu(const QPoint&); - void applyNameFilter(QString name); + void applyNameFilter(const QString& name); void applyStatusFilter(int f); void applyLabelFilter(QString label); void previewFile(QString filePath);