Connect & disconnect the PictureModel on the profile

Ignore the warnings for now, this patch connects and disconnects the (not
done yet) plotPictures() method.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-03 19:09:12 -03:00 committed by Dirk Hohndel
parent eb24d90c8e
commit ebe799e0a0

View file

@ -701,6 +701,11 @@ void ProfileWidget2::setProfileState()
return;
disconnectTemporaryConnections();
connect(DivePictureModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(plotPictures()));
connect(DivePictureModel::instance(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),this, SLOT(plotPictureS()));
connect(DivePictureModel::instance(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)),this, SLOT(plotPictures()));
/* show the same stuff that the profile shows. */
//TODO: Move the DC handling to another method.
MainWindow::instance()->enableDcShortcuts();
@ -1044,6 +1049,10 @@ void ProfileWidget2::disconnectTemporaryConnections()
disconnect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
this, SLOT(pointsRemoved(const QModelIndex &, int, int)));
disconnect(DivePictureModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(plotPictures()));
disconnect(DivePictureModel::instance(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),this, SLOT(plotPictureS()));
disconnect(DivePictureModel::instance(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)),this, SLOT(plotPictures()));
Q_FOREACH (QAction *action, actionsForKeys.values()) {
action->setShortcut(QKeySequence());
action->setShortcutContext(Qt::WidgetShortcut);