This moves the removal code to the model.

It's very important when programming via Model/View, in gtk or qt,
to not mess with the model data outside of the model. We were
deleting stuff that the model controlled outside of the model, so
it thought that there was still data there. This fixes the deletion
part, but there are also lots of other parts that I'll tackle in
the next commits.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-15 21:08:25 -02:00 committed by Dirk Hohndel
parent 06bf0e1849
commit 8827ea6f5d
3 changed files with 31 additions and 15 deletions

View file

@ -200,6 +200,7 @@ public:
DiveTripModel(QObject* parent = 0);
Layout layout() const;
void setLayout(Layout layout);
void deleteSelectedDives();
private:
void setupModelData();