Commit c9614cb5 authored by Eike Ziller's avatar Eike Ziller
Browse files

Avoid trying to create autosave files in read-only directories

Task-number: QTCREATORBUG-10958
Change-Id: I9cb4289f35f194bcbb5e242f064c67264bcf8676
Reviewed-by: default avatarOswald Buddenhagen <>
Reviewed-by: default avatarDavid Schulz <>
parent ad5b6e60
......@@ -1774,10 +1774,13 @@ void EditorManagerPrivate::autoSave()
foreach (IDocument *document, DocumentModel::openedDocuments()) {
if (!document->isModified() || !document->shouldAutoSave())
if (document->filePath().isEmpty()) // FIXME: save them to a dedicated directory
const QString saveName = autoSaveName(document->filePath().toString());
const QString savePath = QFileInfo(saveName).absolutePath();
if (document->filePath().isEmpty()
|| !QFileInfo(savePath).isWritable()) // FIXME: save them to a dedicated directory
QString errorString;
if (!document->autoSave(&errorString, autoSaveName(document->filePath().toString())))
if (!document->autoSave(&errorString, saveName))
errors << errorString;
if (!errors.isEmpty())
Supports Markdown
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