diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-06-01 16:58:23 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-01 13:24:37 -0700 |
commit | b8092c07a4b4d7715d825641e458be5fa56972d6 (patch) | |
tree | 81d7604b2f53fe234d83a09a3645616a681e9ba1 /qt-models/divelocationmodel.cpp | |
parent | 82d3f088a40545624f0d1ac61ca990e05325081c (diff) | |
download | subsurface-b8092c07a4b4d7715d825641e458be5fa56972d6.tar.gz |
Create a new DiveSite when user clicks on add
Also reorganized a bit of the code, and renamed a few misleading methods.
[Dirk Hohndel: remove some C++11 code]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelocationmodel.cpp')
-rw-r--r-- | qt-models/divelocationmodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index c335f7039..3f8c486fe 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -49,3 +49,14 @@ void LocationInformationModel::update() endInsertRows(); } } + +int32_t LocationInformationModel::addDiveSite(const QString& name, int lon, int lat) +{ + degrees_t latitude, longitude; + latitude.udeg = lat; + longitude.udeg = lon; + + int32_t uuid = create_dive_site_with_gps(name.toUtf8().data(), latitude, longitude); + update(); + return uuid; +} |