aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/srceditor.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-08-19 19:08:06 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-08-19 19:20:54 +0200
commitaa8aef6ea9bc2823119ca06936aff9828c75d83e (patch)
treeacdfe9ece8f9b0bbefc92b8b1d773d358db2aca8 /qtmips_gui/srceditor.cpp
parentdb9dd171c658a1ea232abde229da7d59a737eff4 (diff)
downloadqtmips-aa8aef6ea9bc2823119ca06936aff9828c75d83e.tar.gz
qtmips-aa8aef6ea9bc2823119ca06936aff9828c75d83e.tar.bz2
qtmips-aa8aef6ea9bc2823119ca06936aff9828c75d83e.zip
Action to execute external make command and ask for unsaved sources.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/srceditor.cpp')
-rw-r--r--qtmips_gui/srceditor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qtmips_gui/srceditor.cpp b/qtmips_gui/srceditor.cpp
index 8b0000d..18da3b5 100644
--- a/qtmips_gui/srceditor.cpp
+++ b/qtmips_gui/srceditor.cpp
@@ -116,6 +116,8 @@ bool SrcEditor::saveFile(QString filename) {
writer.setFormat("plaintext");
bool success = writer.write(document());
setFileName(filename);
+ if (success)
+ document()->setModified(false);
return success;
}
@@ -123,3 +125,7 @@ void SrcEditor::setCursorToLine(int ln) {
QTextCursor cursor(document()->findBlockByLineNumber(ln-1));
setTextCursor(cursor);
}
+
+bool SrcEditor::isModified() const {
+ return document()->isModified();
+}