Commit d156103d authored by Eike Ziller's avatar Eike Ziller
Browse files

Editor manager: Fix selected filter in Save as...



Make sure to ask mime database only for mime type of non-empty paths.

Change-Id: I5de896021c8438f17b1c5368674493337ccee0c4
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 6c493564
......@@ -1696,8 +1696,12 @@ bool EditorManagerPrivate::saveDocumentAs(IDocument *document)
Utils::MimeDatabase mdb;
const QString filter = Utils::MimeDatabase::allFiltersString();
QString selectedFilter =
mdb.mimeTypeForFile(document->filePath().toFileInfo()).filterString();
QString selectedFilter;
QString filePath = document->filePath().toString();
if (filePath.isEmpty())
filePath = document->defaultPath() + QLatin1Char('/') + document->suggestedFileName();
if (!filePath.isEmpty())
selectedFilter = mdb.mimeTypeForFile(filePath).filterString();
if (selectedFilter.isEmpty())
selectedFilter = mdb.mimeTypeForName(document->mimeType()).filterString();
const QString &absoluteFilePath =
......
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