From d6e32b02f69b99796f83c9e964f63963ec4b1800 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 27 May 2015 06:36:19 -0700 Subject: Start editing new site regardless what the user does first It doesn't matter if we first enter coordinates, name, description or notes. If there is no currentDs we need to handle that gracefully. Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index b96d4e46d..5f17e6f29 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -242,13 +242,13 @@ void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString void LocationInformationWidget::on_diveSiteDescription_textChanged(const QString& text) { - if (!same_string(qPrintable(text), currentDs->description)) + if (!currentDs || !same_string(qPrintable(text), currentDs->description)) markChangedWidget(ui.diveSiteDescription); } void LocationInformationWidget::on_diveSiteName_textChanged(const QString& text) { - if (!same_string(qPrintable(text), currentDs->name)) { + if (!currentDs || !same_string(qPrintable(text), currentDs->name)) { free(displayed_dive_site.name); displayed_dive_site.name = copy_string(qPrintable(text)); markChangedWidget(ui.diveSiteName); @@ -258,7 +258,7 @@ void LocationInformationWidget::on_diveSiteName_textChanged(const QString& text) void LocationInformationWidget::on_diveSiteNotes_textChanged() { - if (!same_string(qPrintable(ui.diveSiteNotes->toPlainText()), currentDs->notes)) + if (! currentDs || !same_string(qPrintable(ui.diveSiteNotes->toPlainText()), currentDs->notes)) markChangedWidget(ui.diveSiteNotes); } -- cgit v1.2.3-70-g09d2