summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-04-15 14:30:30 (GMT)
committerAlexis Menard <alexis.menard@trolltech.com>2009-04-15 14:32:20 (GMT)
commitd07207c2fe77f5c4f732dddc34c0089f1e6b9f1d (patch)
treeb2fe31e3f69e7d02fbe5fe20d5c5e1d0fb168a16 /tests/auto
parenta1a3dd96aef2b2edd7eb7c563fabee124cdbfe5a (diff)
downloadQt-d07207c2fe77f5c4f732dddc34c0089f1e6b9f1d.zip
Qt-d07207c2fe77f5c4f732dddc34c0089f1e6b9f1d.tar.gz
Qt-d07207c2fe77f5c4f732dddc34c0089f1e6b9f1d.tar.bz2
QFileDialog : Fix filters that doesn't work if whitespaces at the end
The fix is basically remove the whitespaces at the end otherwise the reg exp will be wrong. Task-number: 240789 Reviewed-by: jasplin
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index bade586..695bfe7 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -681,6 +681,22 @@ void tst_QFiledialog::filters()
for (int i = views.at(0)->currentIndex(); i < views.at(0)->count(); ++i)
views.at(0)->setCurrentIndex(i);
QCOMPARE(spyFilterSelected.count(), 0);
+
+ //Let check if filters with whitespaces
+ QNonNativeFileDialog fd2;
+ QStringList expected;
+ expected << "C++ Source Files(*.cpp)";
+ expected << "Any(*.*)";
+ fd2.setFilter("C++ Source Files(*.cpp);;Any(*.*)");
+ QCOMPARE(expected, fd2.filters());
+ fd2.setFilter("C++ Source Files(*.cpp) ;;Any(*.*)");
+ QCOMPARE(expected, fd2.filters());
+ fd2.setFilter("C++ Source Files(*.cpp);; Any(*.*)");
+ QCOMPARE(expected, fd2.filters());
+ fd2.setFilter(" C++ Source Files(*.cpp);; Any(*.*)");
+ QCOMPARE(expected, fd2.filters());
+ fd2.setFilter("C++ Source Files(*.cpp) ;; Any(*.*)");
+ QCOMPARE(expected, fd2.filters());
}
void tst_QFiledialog::selectFilter()