Fix support for flatpak FileChooser portal

Properly parse filters. First captured substring in QRegularExpression
is at index 1, with index 0 you access the full captured string.

Change-Id: I68b6e314171536a08c606e5acd0f7211c1c3c254
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jan Grulich 2018-01-08 08:14:01 +01:00
parent 923dd4fe8f
commit beeb748b2c

View File

@ -262,8 +262,8 @@ void QFlatpakFileDialog::exec()
QRegularExpression regexp(QPlatformFileDialogHelper::filterRegExp); QRegularExpression regexp(QPlatformFileDialogHelper::filterRegExp);
QRegularExpressionMatch match = regexp.match(filter); QRegularExpressionMatch match = regexp.match(filter);
if (match.hasMatch()) { if (match.hasMatch()) {
QString userVisibleName = match.captured(0); QString userVisibleName = match.captured(1);
QStringList filterStrings = match.captured(1).split(QLatin1String(" ")); QStringList filterStrings = match.captured(2).split(QLatin1String(" "));
FilterConditionList filterConditions; FilterConditionList filterConditions;
for (const QString &filterString : filterStrings) { for (const QString &filterString : filterStrings) {