Skip to content

Don't truncate filter name containing parenthesis

When extracting the part of the string that contains the filter name, use the part in front of the last parenthesis, not the first one, since otherwise the name gets truncated if it contains parenthesis itself, e.g. in a call like

QFileDialog dialog;
dialog.setNameFilters({"ODF Spreadsheet (.ods) (*.ods)"});

This is in line with the fact that QPlatformFileDialogHelper::cleanFilterList just considers those extensions in the last set of parenthesis and aligns the behavior with the non-native QFileDialog implementation that the Qt library itself provides, as well as the KF 5 implementation.

BUG: 483350

Merge request reports

Loading