forked from qt-creator/qt-creator
provide default implementation of IFile::reloadBehavior()
there only two classes of files anyway: regularly editable ones which may ask for interaction, and "background" files which always operate silently. the regular case is the more complex one, so put that into the base class.
This commit is contained in:
@@ -609,18 +609,6 @@ bool BaseTextDocument::reload(QString *errorString)
|
||||
return true;
|
||||
}
|
||||
|
||||
Core::IFile::ReloadBehavior BaseTextDocument::reloadBehavior(ChangeTrigger state, ChangeType type) const
|
||||
{
|
||||
if (type == TypePermissions)
|
||||
return BehaviorSilent;
|
||||
if (type == TypeContents) {
|
||||
if (state == TriggerInternal && !isModified())
|
||||
return BehaviorSilent;
|
||||
return BehaviorAsk;
|
||||
}
|
||||
return BehaviorAsk;
|
||||
}
|
||||
|
||||
bool BaseTextDocument::reload(QString *errorString, ReloadFlag flag, ChangeType type)
|
||||
{
|
||||
if (flag == FlagIgnore)
|
||||
|
||||
Reference in New Issue
Block a user