Windows: Trim filter specification of the native file dialog.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Tue, 15 May 2012 13:15:34 +0000 (15:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 May 2012 16:08:11 +0000 (18:08 +0200)
In the event customer code (namely Qt Creator) does not pass a
clean specification (corresponding to 4.8 behaviour).

Change-Id: I8271e3a45bea4bea912fcdf0b7c0aae6c022c6a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

index b4a6834..8b8da82 100644 (file)
@@ -870,7 +870,8 @@ void QWindowsNativeFileDialogBase::setNameFilters(const QStringList &filters)
         const int closingParenPos = openingParenPos != -1 ?
             filterString.indexOf(QLatin1Char(')'), openingParenPos + 1) : -1;
         QString filterSpec = closingParenPos == -1 ?
-            QString(QLatin1Char('*')) : filterString.mid(openingParenPos + 1, closingParenPos - openingParenPos - 1);
+                    QString(QLatin1Char('*')) :
+                    filterString.mid(openingParenPos + 1, closingParenPos - openingParenPos - 1).trimmed();
         filterSpec.replace(filterSeparatorRE, separator);
         if (m_hideFiltersDetails) {
             // Do not show pattern in description