summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-21 11:30:13 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-21 11:30:13 (GMT)
commit977acc5975ee62ccb1cf6deea1e08649d9d891e2 (patch)
tree6c11b71726806ee912af40e208458cf7747647aa
parent65c42c343878d37183d6004c902e9344351f97d0 (diff)
small cleanups
-rw-r--r--src/document/katedocument.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp
index 0feb5a1..2f9a6bb 100644
--- a/src/document/katedocument.cpp
+++ b/src/document/katedocument.cpp
@@ -2480,17 +2480,15 @@ bool KTextEditor::DocumentPrivate::closeUrl()
emit modifiedOnDisk(this, m_modOnHd, m_modOnHdReason);
}
- {
- // remove all marks
- clearMarks();
+ // remove all marks
+ clearMarks();
- // clear the buffer
- m_buffer->clear();
+ // clear the buffer
+ m_buffer->clear();
- // clear undo/redo history
- m_undoManager->clearUndo();
- m_undoManager->clearRedo();
- }
+ // clear undo/redo history
+ m_undoManager->clearUndo();
+ m_undoManager->clearRedo();
// no, we are no longer modified
setModified(false);
@@ -2534,20 +2532,22 @@ void KTextEditor::DocumentPrivate::discardDataRecovery()
void KTextEditor::DocumentPrivate::setReadWrite(bool rw)
{
- if (isReadWrite() != rw) {
- KParts::ReadWritePart::setReadWrite(rw);
+ if (isReadWrite() == rw) {
+ return;
+ }
- foreach (KTextEditor::ViewPrivate *view, m_views) {
- view->slotUpdateUndo();
- view->slotReadWriteChanged();
- }
- emit readWriteChanged(this);
+ KParts::ReadWritePart::setReadWrite(rw);
+
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
+ view->slotUpdateUndo();
+ view->slotReadWriteChanged();
}
+
+ emit readWriteChanged(this);
}
void KTextEditor::DocumentPrivate::setModified(bool m)
{
-
if (isModified() != m) {
KParts::ReadWritePart::setModified(m);