From ebe799e0a02723a6499e60da66e62ea18aceb52b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 3 Jun 2014 19:09:12 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 54af27ba3..a63c83d68 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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); -- cgit v1.2.3-70-g09d2