Make IFile::isReadOnly consistent.

It is supposed to refer to the property of the file on disk (if there is
any).

Task-number: QTCREATORBUG-4998
Change-Id: Iaed62c17d124b364aecec4d1f910046bade42d40
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Eike Ziller
2012-02-14 12:10:29 +01:00
parent d7b0ceac8a
commit f916d38dce
35 changed files with 36 additions and 238 deletions

View File

@@ -607,10 +607,10 @@ static QList<IFile *> saveModifiedFilesHelper(const QList<IFile *> &files,
if (name.isEmpty())
name = file->suggestedFileName();
// There can be several FileInterfaces pointing to the same file
// Select one that is not readonly.
if (!(modifiedFilesMap.key(name, 0)
&& file->isReadOnly()))
// There can be several IFiles pointing to the same file
// Prefer one that is not readonly
// (even though it *should* not happen that the IFiles are inconsistent with readonly)
if (!modifiedFilesMap.key(name, 0) || !file->isReadOnly())
modifiedFilesMap.insert(file, name);
}
}