Commit 98e695e3 authored by con's avatar con
Browse files

Remember last "File -> Open" location, start with home directory.

In case we have no open document or "current file", the file dialog
was opening at the creator install location.
Reviewed-by: default avatarThorbjorn Lindeijer <>
Task-number: 249004
parent cb71de60
......@@ -1147,17 +1147,21 @@ bool EditorManager::openExternalEditor(const QString &fileName, const QString &e
QStringList EditorManager::getOpenFileNames() const
QString dir;
static QString dir = QDir::homePath();
if (m_d->fileFilters.isEmpty())
m_d->fileFilters = formatFileFilters(m_d->m_core, &m_d->selectedFilter);
if (IEditor *curEditor = currentEditor()) {
const QFileInfo fi(curEditor->file()->fileName());
QString currentFile = ICore::instance()->fileManager()->currentFile();
if (!currentFile.isEmpty()) {
const QFileInfo fi(currentFile);
dir = fi.absolutePath();
return QFileDialog::getOpenFileNames(m_d->m_core->mainWindow(), tr("Open File"),
QStringList files = QFileDialog::getOpenFileNames(m_d->m_core->mainWindow(), tr("Open File"),
dir, m_d->fileFilters, &m_d->selectedFilter);
if (!files.isEmpty())
dir = QFileInfo(;
return files;
void EditorManager::ensureEditorManagerVisible()
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