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:
Dirk Hohndel 2015-12-26 20:02:23 -08:00
parent 763986b683
commit ce2b910cdb
2 changed files with 22 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;