Huge code cleanup.

This patch starts the cleanup that will take a few iterations to finish.
The current profile code uses QStateMachine, and it's much too verbose
for something we can do with less than a third of its lines of code.

I also added on the beginning of the redesign of the profile code for
planner, edit and a few other things that are going to be ported to
the new profile in the future, but not currently - I just lack the time
to make that work for the next release.

This commit basically:
 - moves all 'new' calls to the initializer-list
 - create a new 'setupItem' private method to concentrate the calls
   that any item will do

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-02-07 14:14:36 -02:00 committed by Dirk Hohndel
parent 361f8ede76
commit 6de9b329d1
2 changed files with 28 additions and 63 deletions

View file

@ -40,6 +40,7 @@ struct DiveReportedCeiling;
struct DiveCalculatedTissue;
struct PartialPressureGasItem;
struct PartialGasPressureAxis;
struct AbstractProfilePolygonItem;
class ProfileWidget2 : public QGraphicsView {
Q_OBJECT
@ -52,6 +53,7 @@ public:
ProfileWidget2(QWidget *parent);
void plotDives(QList<dive*> dives);
virtual bool eventFilter(QObject*, QEvent*);
void setupItem( AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, DivePlotDataModel *model, int vData, int hData, int zValue);
public slots: // Necessary to call from QAction's signals.
void settingsChanged();