forked from qt-creator/qt-creator
Fix warning when saving documents with empty file names.
"QFileInfo::absolutePath: Constructed with empty filename" Change-Id: Ib5d82681aafee54c309c2beb31c534a26e791737 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user