From beeb748b2ce1d4aab60213778e9342ad330e1e07 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 8 Jan 2018 08:14:01 +0100 Subject: [PATCH] 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 --- src/plugins/platformthemes/flatpak/qflatpakfiledialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platformthemes/flatpak/qflatpakfiledialog.cpp b/src/plugins/platformthemes/flatpak/qflatpakfiledialog.cpp index 0dadb9a2f1..c51223186e 100644 --- a/src/plugins/platformthemes/flatpak/qflatpakfiledialog.cpp +++ b/src/plugins/platformthemes/flatpak/qflatpakfiledialog.cpp @@ -262,8 +262,8 @@ void QFlatpakFileDialog::exec() QRegularExpression regexp(QPlatformFileDialogHelper::filterRegExp); QRegularExpressionMatch match = regexp.match(filter); if (match.hasMatch()) { - QString userVisibleName = match.captured(0); - QStringList filterStrings = match.captured(1).split(QLatin1String(" ")); + QString userVisibleName = match.captured(1); + QStringList filterStrings = match.captured(2).split(QLatin1String(" ")); FilterConditionList filterConditions; for (const QString &filterString : filterStrings) {