summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-01-30 22:27:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-30 17:03:03 -0800
commitf16f4e2f6e98b84d8a92d384662d66899dff47a0 (patch)
treebb33633580ed6bc5cfec9928adb1884368538662
parent129b54093b38293ede4a88d49432099b98d5eccd (diff)
downloadsubsurface-f16f4e2f6e98b84d8a92d384662d66899dff47a0.tar.gz
Don't go to edit mode if the dive notes field didn't change.
The maintab view should be consistent; some fields just go to edit mode whenever they acquire focus and most of them wait till their values are changed. Change the dive notes field to be consistent with the other fields and only enter edit mode if its value is changed. [Dirk Hohndel: changed to use same_string()] Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index c247b77d0..5fc0eb0ad 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1159,9 +1159,13 @@ void MainTab::on_notes_textChanged()
if (editMode == IGNORE || acceptingEdit == true)
return;
if (currentTrip) {
+ if (same_string(displayedTrip.notes, ui.notes->toPlainText().toUtf8().data()))
+ return;
free(displayedTrip.notes);
displayedTrip.notes = strdup(ui.notes->toPlainText().toUtf8().data());
} else {
+ if (same_string(displayed_dive.notes, ui.notes->toPlainText().toUtf8().data()))
+ return;
free(displayed_dive.notes);
if (ui.notes->toHtml().indexOf("<table") != -1)
displayed_dive.notes = strdup(ui.notes->toHtml().toUtf8().data());