mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Two more helper functions for the QML manager
I'm not sure this is the best way to do this - QML should be able to get to the model data directly (I hope?). But this seems to work and I need it to make Add Dive be semi-correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
763986b683
commit
ce2b910cdb
2 changed files with 22 additions and 0 deletions
|
@ -477,3 +477,23 @@ void QMLManager::showMap(QString location)
|
|||
QDesktopServices::openUrl(link);
|
||||
}
|
||||
}
|
||||
|
||||
QString QMLManager::getNumber(QString diveId)
|
||||
{
|
||||
int dive_id = diveId.toInt();
|
||||
struct dive *d = get_dive_by_uniq_id(dive_id);
|
||||
QString number;
|
||||
if (d)
|
||||
number = QString::number(d->number);
|
||||
return number;
|
||||
}
|
||||
|
||||
QString QMLManager::getDate(QString diveId)
|
||||
{
|
||||
int dive_id = diveId.toInt();
|
||||
struct dive *d = get_dive_by_uniq_id(dive_id);
|
||||
QString datestring;
|
||||
if (d)
|
||||
datestring = get_dive_date_string(d->when);
|
||||
return datestring;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ public slots:
|
|||
void clearGpsData();
|
||||
void finishSetup();
|
||||
void showMap(QString location);
|
||||
QString getNumber(QString diveId);
|
||||
QString getDate(QString diveId);
|
||||
|
||||
private:
|
||||
QString m_cloudUserName;
|
||||
|
|
Loading…
Reference in a new issue