Windows: Fix trailing blank in native file dialog filter
Strip trailing blanks when not filtering by suffix. Amends 76735f3fa0fdf772aa4fba9a9aaa241415eaf922. Pick-to: 5.15 Fixes: QTBUG-85423 Task-number: QTBUG-42405 Change-Id: Ic13a4e7718f7f1935b1fc329a7beaf1d357fd44d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
f02dde3d74
commit
ffb8464cef
@ -1087,8 +1087,11 @@ void QWindowsNativeFileDialogBase::setNameFilters(const QStringList &filters)
|
||||
const QString &filter = specs[i].filter;
|
||||
if (!m_hideFiltersDetails && !filter.startsWith(u"*.")) {
|
||||
const int pos = description.lastIndexOf(u'(');
|
||||
if (pos > 0)
|
||||
if (pos > 0) {
|
||||
description.truncate(pos);
|
||||
while (!description.isEmpty() && description.back().isSpace())
|
||||
description.chop(1);
|
||||
}
|
||||
}
|
||||
// Add to buffer.
|
||||
comFilterSpec[i].pszName = ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user