Move the creation of the dive plan to the model

The dive plan was bein created on the Profile, this
While this worked out, it created a bit of spaggethi
code, so now the model will take control of *everything*
on the planner.

I tested it quite a bit and doesn't seems to have appeared
a regression, wich is good.

Now that a dive plan is bein created, I can just save it. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-09-16 12:11:06 -03:00
parent bfe1ea0cb2
commit fad55b3047
2 changed files with 56 additions and 43 deletions

View file

@ -51,6 +51,8 @@ public slots:
void createPlan();
void remove(const QModelIndex& index);
void cancelPlan();
void createTemporaryPlan();
void deleteTemporaryPlan();
signals:
void planCreated();
@ -60,6 +62,8 @@ private:
explicit DivePlannerPointsModel(QObject* parent = 0);
struct diveplan diveplan;
QVector<divedatapoint> divepoints;
struct dive *tempDive;
void deleteTemporaryPlan(struct divedatapoint *dp);
};
class Button : public QObject, public QGraphicsRectItem {