Commit ad3edc9e authored by Halla Rempt's avatar Halla Rempt
Browse files

Don't remove *. from the suffixes returned by KoMimeDatabase

Following commit

commit bdb2e7fc
Author: Dmitry Kazakov <>
Date:   Fri Sep 22 21:39:56 2017 +0300

    KisMimeDatabase should contain suffixes without '*.' prefix

This code should be adapted as well. The problem is that the file
dialogs need *.suffix to filter the files, and return that as the
chosen filter as well. QFileDialog until Qt 5.9 didn't have
a QString QFileDialog::selectedMimeTypeFilter() const method...

If we make 5.9 our minimum version, we can rewrite KoFileDialog to
be logical and consistent.
parent fdf26b66
......@@ -119,7 +119,7 @@ void KoFileDialog::setMimeTypeFilters(const QStringList &mimeTypeList, QString d
QString defaultFilter;
if (!defaultMimeType.isEmpty()) {
QString suffix = KisMimeDatabase::suffixesForMimeType(defaultMimeType).first().remove("*.");
QString suffix = KisMimeDatabase::suffixesForMimeType(defaultMimeType).first();
if (!d->proposedFileName.isEmpty()) {
d->proposedFileName = QFileInfo(d->proposedFileName).baseName() + "." + suffix;
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