diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-05-27 06:36:19 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-27 06:36:19 -0700 |
commit | d6e32b02f69b99796f83c9e964f63963ec4b1800 (patch) | |
tree | 2e8c8e22034a7000304e4776580b5f9defa9b901 /qt-ui/locationinformation.cpp | |
parent | bfee0a13f053829a34907eb0d27e5abe681f0e50 (diff) | |
download | subsurface-d6e32b02f69b99796f83c9e964f63963ec4b1800.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r-- | qt-ui/locationinformation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |