| 185 | } |
| 186 | |
| 187 | void modifiedOnDisk(KTextEditor::Document* document, bool /*isModified*/, |
| 188 | KTextEditor::Document::ModifiedOnDiskReason reason) |
| 189 | { |
| 190 | bool dirty = false; |
| 191 | switch (reason) |
| 192 | { |
| 193 | case KTextEditor::Document::OnDiskUnmodified: |
| 194 | break; |
| 195 | case KTextEditor::Document::OnDiskModified: |
| 196 | case KTextEditor::Document::OnDiskCreated: |
| 197 | case KTextEditor::Document::OnDiskDeleted: |
| 198 | dirty = true; |
| 199 | break; |
| 200 | } |
| 201 | |
| 202 | // In some cases, the VCS (e.g. git) can know whether the old contents are "valuable", i.e. |
| 203 | // not retrieveable from the VCS. If that is not the case, then the document can safely be |
| 204 | // reloaded without displaying a dialog asking the user. |
| 205 | if ( dirty ) { |
| 206 | queryCanRecreateFromVcs(document); |
| 207 | } |
| 208 | setStatus(document, dirty); |
| 209 | } |
| 210 | |
| 211 | void cleanContextMenu() |
| 212 | { |