From fbe1144eaf7e800a014c7a97b846835ba9f3bc7f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 18 May 2018 20:33:01 +0200 Subject: Dive pictures: use modelReset signal when reseting picture list In the old code a combination of removeRows()/insertRows() was used to signal a model reset. Replace this by a single, modelReset signal. This saves a call to plotPictures() and will allow us to be smarter in the future, when removing pictures. Reset-model and remove-items are semantically different. Signed-off-by: Berthold Stoeger --- profile-widget/profilewidget2.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index de7cebc87..85653d1fc 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1119,6 +1119,7 @@ void ProfileWidget2::setProfileState() connect(DivePictureModel::instance(), &DivePictureModel::dataChanged, this, &ProfileWidget2::updatePictures); connect(DivePictureModel::instance(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(plotPictures())); connect(DivePictureModel::instance(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(plotPictures())); + connect(DivePictureModel::instance(), &DivePictureModel::modelReset, this, &ProfileWidget2::plotPictures); #endif /* show the same stuff that the profile shows. */ -- cgit v1.2.3-70-g09d2