forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user