diff options
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qml/DiveDetailsView.qml | 3 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 10 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/qt-mobile/qml/DiveDetailsView.qml b/qt-mobile/qml/DiveDetailsView.qml index 60ae8dfaf..6c333596c 100644 --- a/qt-mobile/qml/DiveDetailsView.qml +++ b/qt-mobile/qml/DiveDetailsView.qml @@ -12,6 +12,7 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents Item { id: detailsView property int labelWidth: MobileComponents.Units.gridUnit * 10 + property string cylinder: manager.getCylinder(dive.id) width: parent.width height: mainLayout.implicitHeight + MobileComponents.Units.iconSizes.large Rectangle { @@ -169,7 +170,7 @@ Item { } MobileComponents.Label { id: txtWeight - //text: dive.weights + text: weight Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere Layout.alignment: Qt.AlignRight diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index a84e46dd4..d2b5c4702 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -708,3 +708,13 @@ QString QMLManager::getDate(QString diveId) datestring = get_dive_date_string(d->when); return datestring; } + +QString QMLManager::getCylinder(QString diveId) +{ + int dive_id = diveId.toInt(); + struct dive *d = get_dive_by_uniq_id(dive_id); + QString cylinder; + if (d) + cylinder = d->cylinder[0].type.description; + return cylinder; +} diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index 4e4646158..57b67c24a 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -84,6 +84,7 @@ public slots: QString getNumber(QString diveId); QString getDate(QString diveId); QString getCurrentPosition(); + QString getCylinder(QString diveId); void deleteGpsFix(quint64 when); void refreshDiveList(); |