Extend getExtensionFromPatternList reg exp filtering
Summary:
getExtensionFromPatternList turns a filter string such "*.cpp" etc into
an extension ".cpp".
It tries to filter out any filter string that could be a glob pattern.
However it didn't handle "[]" characters.
See https://phabricator.kde.org/D17677 and D17738
Test Plan:
Modified kfilewidgettest_gui test and confirmed
that "automatically select file extension" checkbox didn't
insert irrelevant chars in the filename.
Subscribers: kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D17743