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:
Oswald Buddenhagen
2011-04-15 11:53:46 +02:00
parent 801e5a2fdd
commit 9e7a4c7d4f
11 changed files with 10 additions and 62 deletions

View File

@@ -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)