diff options
author | Grace Karanja <gracie.karanja89@gmail.com> | 2015-08-18 12:03:30 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-31 15:47:48 -0700 |
commit | 390c10bb088ddbe8a679de8ac3289eb7d10bf8a9 (patch) | |
tree | 059a3aca6fca8f2ed6eb187d2762089714971ebd /qthelper.h | |
parent | 46cfe003f3cd1e6033707d1ee1b245f31d574c6c (diff) | |
download | subsurface-390c10bb088ddbe8a679de8ac3289eb7d10bf8a9.tar.gz |
QML UI: Remove unneeded MobileDive class
The MobileDive class in divelistmodel.h is a duplication of the
Dive class in templatelayout.h. This patch moves the Dive to
the qthelper file.
[Dirk Hohndel: merged with upstream master - let's hope I didn't
mess anything up]
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.h')
-rw-r--r-- | qthelper.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/qthelper.h b/qthelper.h index 073010d9f..f6c1cdb2b 100644 --- a/qthelper.h +++ b/qthelper.h @@ -9,6 +9,96 @@ #include <QTranslator> #include <QDir> +class Dive { +private: + int m_number; + int m_id; + int m_rating; + QString m_date; + timestamp_t m_timestamp; + QString m_time; + QString m_location; + QString m_duration; + QString m_depth; + QString m_divemaster; + QString m_buddy; + QString m_airTemp; + QString m_waterTemp; + QString m_notes; + QString m_tags; + QString m_gas; + QString m_sac; + QString m_weight; + QString m_suit; + QString m_cylinder; + QString m_trip; + struct dive *dive; + void put_date_time(); + void put_timestamp(); + void put_location(); + void put_duration(); + void put_depth(); + void put_divemaster(); + void put_buddy(); + void put_temp(); + void put_notes(); + void put_tags(); + void put_gas(); + void put_sac(); + void put_weight(); + void put_suit(); + void put_cylinder(); + void put_trip(); + +public: + Dive(struct dive *dive) + : dive(dive) + { + m_number = dive->number; + m_id = dive->id; + m_rating = dive->rating; + put_date_time(); + put_location(); + put_duration(); + put_depth(); + put_divemaster(); + put_buddy(); + put_temp(); + put_notes(); + put_tags(); + put_gas(); + put_sac(); + put_timestamp(); + put_weight(); + put_suit(); + put_cylinder(); + put_trip(); + } + Dive(); + ~Dive(); + int number() const; + int id() const; + int rating() const; + QString date() const; + timestamp_t timestamp() const; + QString time() const; + QString location() const; + QString duration() const; + QString depth() const; + QString divemaster() const; + QString buddy() const; + QString airTemp() const; + QString waterTemp() const; + QString notes() const; + QString tags() const; + QString gas() const; + QString sac() const; + QString weight() const; + QString suit() const; + QString cylinder() const; + QString trip() const; +}; + // global pointers for our translation extern QTranslator *qtTranslator, *ssrfTranslator; |