diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-17 05:50:45 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:17 -0400 |
| commit | 9f1520c69e88113d9a1a06f91bbabe9cf5ddef9f (patch) | |
| tree | b2271eabae2529ebd4dc16b8728632978eeb67b3 /src/texteditor.cpp | |
| parent | 81815d202b4364847062ba248321474ef5a2d686 (diff) | |
split images tab stuff in ImagesTab
text editor: fixed modified flag not being set to false when loading an empty file
Diffstat (limited to 'src/texteditor.cpp')
| -rw-r--r-- | src/texteditor.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/texteditor.cpp b/src/texteditor.cpp index 78ce1610..99490b22 100644 --- a/src/texteditor.cpp +++ b/src/texteditor.cpp @@ -60,9 +60,19 @@ void TextEditor::setDefaultStyle() bool TextEditor::load(const QString& filename) { m_filename = filename; - setPlainText(MOBase::readFileText(filename, &m_encoding)); + clear(); + + const QString s = MOBase::readFileText(filename, &m_encoding); + + setPlainText(s); document()->setModified(false); + if (s.isEmpty()) { + // the modificationChanged even is not fired by the setModified() call + // above when the text being set is empty + onModified(false); + } + return true; } |
