From f16f4e2f6e98b84d8a92d384662d66899dff47a0 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 30 Jan 2015 22:27:16 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui') 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("toHtml().toUtf8().data()); -- cgit v1.2.3-70-g09d2