Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1a3917b6 authored by David Faure's avatar David Faure

Add support for multiple name filters

kdialog --getopenfilename . 'C++ code (*.cpp *.h)|CMake (CMakeLists.txt)'
now works, we just replace '|' with '\n' internally because Qt splits on '\n'.
parent 0abc493d
......@@ -215,7 +215,8 @@ static KGuiItem configuredContinue(const QString &text)
static void setFileDialogFilter(QFileDialog &dlg, const QString &filter)
{
if (filter.contains("*")) {
dlg.setNameFilter(filter);
QString qtFilter = filter;
dlg.setNameFilter(qtFilter.replace('|','\n'));
} else if (!filter.isEmpty()) {
dlg.setMimeTypeFilters(filter.trimmed().split(' '));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment