Add helper functions to identify the position of a dive in the dive list

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-03-02 04:41:36 -08:00
parent b275e604c1
commit 3b37844708
4 changed files with 20 additions and 0 deletions

View file

@ -882,6 +882,14 @@ void QMLManager::showMap(const QString& location)
}
}
// where in the QML dive list is that dive?
int QMLManager::getIndex(const QString &diveId)
{
int dive_id = diveId.toInt();
int idx = DiveListModel::instance()->getDiveIdx(dive_id);
return idx;
}
QString QMLManager::getNumber(const QString& diveId)
{
int dive_id = diveId.toInt();

View file

@ -103,6 +103,7 @@ public slots:
void finishSetup();
void openLocalThenRemote(QString url);
void showMap(const QString& location);
int getIndex(const QString& diveId);
QString getNumber(const QString& diveId);
QString getDate(const QString& diveId);
QString getCurrentPosition();