Commit 8fbd8c41 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Fix warning when saving documents with empty file names.



"QFileInfo::absolutePath: Constructed with empty filename"

Change-Id: Ib5d82681aafee54c309c2beb31c534a26e791737
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 86947cc2
......@@ -723,13 +723,16 @@ QString DocumentManager::getSaveAsFileName(const IDocument *document, const QStr
return QLatin1String("");
QString absoluteFilePath = document->filePath();
const QFileInfo fi(absoluteFilePath);
QString fileName = fi.fileName();
QString path = fi.absolutePath();
QString path;
QString fileName;
if (absoluteFilePath.isEmpty()) {
fileName = document->suggestedFileName();
const QString defaultPath = document->defaultPath();
if (!defaultPath.isEmpty())
path = defaultPath;
} else {
path = fi.absolutePath();
fileName = fi.fileName();
}
QString filterString;
......
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