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>
This commit is contained in:
parent
037bc9b638
commit
7b8d4cdb10
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user