Commit 7c3a291e authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

ignore vanished files while restoring session

there is no point in bothering the user with error messages and/or
having ghost editors hanging around.

Task-number: QTCREATORBUG-2424
parent 98f679d7
......@@ -1831,8 +1831,10 @@ bool EditorManager::restoreState(const QByteArray &state)
if (!fileName.isEmpty() && !displayName.isEmpty()) {
QFileInfo fi(fileName);
if (!fi.exists())
continue;
QFileInfo rfi(autoSaveName(fileName));
if (fi.exists() && rfi.exists() && fi.lastModified() < rfi.lastModified()) {
if (rfi.exists() && fi.lastModified() < rfi.lastModified()) {
openEditor(fileName, QString::fromUtf8(id));
} else {
m_d->m_editorModel->addRestoredEditor(fileName, displayName, QString::fromUtf8(id));
......
......@@ -784,6 +784,8 @@ void SplitterOrView::restoreState(const QByteArray &state)
QByteArray id;
QByteArray editorState;
stream >> fileName >> id >> editorState;
if (!QFile::exists(fileName))
return;
IEditor *e = em->openEditor(view(), fileName, id, Core::EditorManager::IgnoreNavigationHistory
| Core::EditorManager::NoActivate);
......
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