summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r--desktop-widgets/locationinformation.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index 28f3fa619..f02b45bd0 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -136,6 +136,9 @@ void LocationInformationWidget::diveSiteChanged(struct dive_site *ds, int field)
case LocationInformationModel::DESCRIPTION:
ui.diveSiteDescription->setText(diveSite->description);
return;
+ case LocationInformationModel::NOTES:
+ ui.diveSiteNotes->setText(diveSite->notes);
+ return;
default:
return;
}
@@ -192,14 +195,6 @@ void LocationInformationWidget::acceptChanges()
// now update the diveSite
copy_taxonomy(&taxonomy, &diveSite->taxonomy);
- uiString = copy_qstring(ui.diveSiteNotes->document()->toPlainText());
- if (!same_string(uiString, diveSite->notes)) {
- free(diveSite->notes);
- diveSite->notes = uiString;
- } else {
- free(uiString);
- }
-
if (!ui.diveSiteCoordinates->text().isEmpty())
parseGpsText(ui.diveSiteCoordinates->text(), diveSite->location);
mark_divelist_changed(true);
@@ -300,10 +295,10 @@ void LocationInformationWidget::on_diveSiteName_editingFinished()
Command::editDiveSiteName(diveSite, ui.diveSiteName->text());
}
-void LocationInformationWidget::on_diveSiteNotes_textChanged()
+void LocationInformationWidget::on_diveSiteNotes_editingFinished()
{
- if (diveSite && !same_string(qPrintable(ui.diveSiteNotes->toPlainText()), diveSite->notes))
- markChangedWidget(ui.diveSiteNotes);
+ if (diveSite)
+ Command::editDiveSiteNotes(diveSite, ui.diveSiteNotes->toPlainText());
}
void LocationInformationWidget::resetPallete()