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>
This commit is contained in:
Grace Karanja 2015-08-18 12:03:30 +03:00 committed by Dirk Hohndel
parent 46cfe003f3
commit 390c10bb08
6 changed files with 345 additions and 603 deletions

View file

@ -5,6 +5,7 @@
#include "mainwindow.h"
#include "printoptions.h"
#include "statistics.h"
#include "qthelper.h"
#include "helpers.h"
int getTotalWork(print_options *printOptions);
@ -31,76 +32,6 @@ signals:
void progressUpdated(int value);
};
class Dive {
private:
int m_number;
int m_id;
int m_rating;
QString m_date;
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;
struct dive *dive;
void put_date_time();
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();
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();
}
Dive();
~Dive();
int number() const;
int id() const;
int rating() const;
QString date() 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;
};
class YearInfo {
public:
stats_t *year;