summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-02-01 21:25:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-02 07:06:56 -0800
commit414b9807e6470506cd5103acdb9a86d233eda572 (patch)
tree294aad805c175fac482bdf4477cbe9a4dcdbc93a
parente1db5f21b15b2d5ac9845f9f85bf433020bc35f0 (diff)
downloadsubsurface-414b9807e6470506cd5103acdb9a86d233eda572.tar.gz
Do not go to edit mode if nothing changed
Fixes #804 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 7335711e9..00aae5f29 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -980,6 +980,10 @@ void MainTab::on_buddy_textChanged()
{
if (editMode == IGNORE || acceptingEdit == true)
return;
+
+ if (same_string(displayed_dive.buddy, ui.buddy->toPlainText().toUtf8().data()))
+ return;
+
QStringList text_list = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts);
for (int i = 0; i < text_list.size(); i++)
text_list[i] = text_list[i].trimmed();
@@ -993,6 +997,10 @@ void MainTab::on_divemaster_textChanged()
{
if (editMode == IGNORE || acceptingEdit == true)
return;
+
+ if (same_string(displayed_dive.divemaster, ui.divemaster->toPlainText().toUtf8().data()))
+ return;
+
QStringList text_list = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts);
for (int i = 0; i < text_list.size(); i++)
text_list[i] = text_list[i].trimmed();
@@ -1102,8 +1110,15 @@ void MainTab::saveTags()
void MainTab::on_tagWidget_textChanged()
{
+ char buf[1024];
+
if (editMode == IGNORE || acceptingEdit == true)
return;
+
+ taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
+ if (same_string(buf, ui.tagWidget->toPlainText().toUtf8().data()))
+ return;
+
markChangedWidget(ui.tagWidget);
}