summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-04-15 14:30:30 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-04-15 16:14:21 (GMT)
commit50d030e78386c7871a3e15029673db4591c8f8e5 (patch)
treebc425701e49833b58bddf5622114c3a1e49e9dcd /tests
parent5e397de5254005f26fb1b26f65e610653d39e9fa (diff)
downloadQt-50d030e78386c7871a3e15029673db4591c8f8e5.zip
Qt-50d030e78386c7871a3e15029673db4591c8f8e5.tar.gz
Qt-50d030e78386c7871a3e15029673db4591c8f8e5.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')
-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()