forked from qt-creator/qt-creator
DocumentManager: Treat documents without path as temporary
Treat documents without path as temporary when trying to come up with a directory to open the file dialog in. Task-number: QTCREATORBUG-14131 Change-Id: I266fe6608b7c98b479f86412a0892413e1b99bb2 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -1257,8 +1257,9 @@ void readSettings()
|
||||
|
||||
QString DocumentManager::fileDialogInitialDirectory()
|
||||
{
|
||||
if (EditorManager::currentDocument() && !EditorManager::currentDocument()->isTemporary())
|
||||
return QFileInfo(EditorManager::currentDocument()->filePath().toString()).absolutePath();
|
||||
IDocument *doc = EditorManager::currentDocument();
|
||||
if (doc && !doc->isTemporary() && !doc->filePath().isEmpty())
|
||||
return doc->filePath().toFileInfo().absolutePath();
|
||||
if (!d->m_defaultLocationForNewFiles.isEmpty())
|
||||
return d->m_defaultLocationForNewFiles;
|
||||
return d->m_lastVisitedDirectory;
|
||||
|
Reference in New Issue
Block a user