diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-03-11 15:09:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-15 10:45:24 +0100 |
commit | 7b8d4cdb1098547ab2d2cc5337cae0496bb4ef61 (patch) | |
tree | 6bc3e30b350eb35639eb7caa037c892f221d4a9d /src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | |
parent | 037bc9b6385dce564fddeb70b7e50589c9fb03e0 (diff) |
Windows native file dialog: Allow for omitting name filter description.
Task-number: QTBUG-37329
Change-Id: I644595a292e5b1890b2088b68be595bfcdba9d4d
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 0951009cf0..f70b5b4e2b 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1195,7 +1195,7 @@ static QList<FilterSpec> filterSpecs(const QStringList &filters, const QRegExp filterSeparatorRE(QStringLiteral("[;\\s]+")); const QString separator = QStringLiteral(";"); Q_ASSERT(filterSeparatorRE.isValid()); - // Split filter specification as 'Texts (*.txt[;] *.doc)' + // Split filter specification as 'Texts (*.txt[;] *.doc)', '*.txt[;] *.doc' // into description and filters specification as '*.txt;*.doc' foreach (const QString &filterString, filters) { const int openingParenPos = filterString.lastIndexOf(QLatin1Char('(')); @@ -1203,8 +1203,10 @@ static QList<FilterSpec> filterSpecs(const QStringList &filters, filterString.indexOf(QLatin1Char(')'), openingParenPos + 1) : -1; FilterSpec filterSpec; filterSpec.filter = closingParenPos == -1 ? - QString(QLatin1Char('*')) : + filterString : filterString.mid(openingParenPos + 1, closingParenPos - openingParenPos - 1).trimmed(); + if (filterSpec.filter.isEmpty()) + filterSpec.filter += QLatin1Char('*'); filterSpec.filter.replace(filterSeparatorRE, separator); filterSpec.description = filterString; if (hideFilterDetails && openingParenPos != -1) { // Do not show pattern in description |