mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
82d3f088a4
commit
b8092c07a4
7 changed files with 44 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ public:
|
|||
static LocationInformationModel *instance();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
|
||||
int32_t addDiveSite(const QString& name, int lat = 0, int lon = 0);
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue