From 3b37844708d0bcbac3dbec86a44d6dfff69639a0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 2 Mar 2016 04:41:36 -0800 Subject: Add helper functions to identify the position of a dive in the dive list Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 8 ++++++++ qt-mobile/qmlmanager.h | 1 + 2 files changed, 9 insertions(+) (limited to 'qt-mobile') diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 9a0a97f65..39b02e6a9 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -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(); diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index 41ca2271f..17fe699e4 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -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(); -- cgit v1.2.3-70-g09d2