aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/divepixmapitem.cpp2
-rw-r--r--profile-widget/divepixmapitem.h2
-rw-r--r--profile-widget/profilewidget2.cpp8
-rw-r--r--profile-widget/profilewidget2.h2
-rw-r--r--qt-models/CMakeLists.txt2
5 files changed, 12 insertions, 4 deletions
diff --git a/profile-widget/divepixmapitem.cpp b/profile-widget/divepixmapitem.cpp
index c1ce3b6dd..4456d3e53 100644
--- a/profile-widget/divepixmapitem.cpp
+++ b/profile-widget/divepixmapitem.cpp
@@ -135,7 +135,9 @@ void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
}
+#ifndef SUBSURFACE_MOBILE
void DivePictureItem::removePicture()
{
DivePictureModel::instance()->removePicture(fileUrl, true);
}
+#endif
diff --git a/profile-widget/divepixmapitem.h b/profile-widget/divepixmapitem.h
index 6215d4ddd..b3fe3417a 100644
--- a/profile-widget/divepixmapitem.h
+++ b/profile-widget/divepixmapitem.h
@@ -24,7 +24,9 @@ public:
void setPixmap(const QPixmap& pix);
public slots:
void settingsChanged();
+#ifndef SUBSURFACE_MOBILE
void removePicture();
+#endif
void setFileUrl(const QString& s);
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 8cfdeadf7..97e69fb82 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -764,8 +764,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
DivePlannerPointsModel *model = DivePlannerPointsModel::instance();
model->deleteTemporaryPlan();
}
-#endif
plotPictures();
+#endif
// OK, how long did this take us? Anything above the second is way too long,
// so if we are calculation TTS / NDL then let's force that off.
@@ -1081,9 +1081,11 @@ void ProfileWidget2::setProfileState()
return;
disconnectTemporaryConnections();
+#ifndef SUBSURFACE_MOBILE
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()));
+#endif
/* show the same stuff that the profile shows. */
emit enableShortcuts();
@@ -1950,7 +1952,6 @@ void ProfileWidget2::keyEscAction()
if (plannerModel->isPlanner())
plannerModel->cancelPlan();
}
-#endif
void ProfileWidget2::plotPictures()
{
@@ -1990,6 +1991,7 @@ void ProfileWidget2::plotPictures()
pictures.push_back(item);
}
}
+#endif
void ProfileWidget2::dropEvent(QDropEvent *event)
{
@@ -2011,7 +2013,9 @@ void ProfileWidget2::dropEvent(QDropEvent *event)
}
}
copy_dive(current_dive, &displayed_dive);
+#ifndef SUBSURFACE_MOBILE
DivePictureModel::instance()->updateDivePictures();
+#endif
if (event->source() == this) {
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 5e64b369f..575680f68 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -104,10 +104,10 @@ slots: // Necessary to call from QAction's signals.
void actionRequestedReplot(bool triggered);
void setEmptyState();
void setProfileState();
- void plotPictures();
void setReplot(bool state);
void replot(dive *d = 0);
#ifndef SUBSURFACE_MOBILE
+ void plotPictures();
void setPlanState();
void setAddState();
void changeGas();
diff --git a/qt-models/CMakeLists.txt b/qt-models/CMakeLists.txt
index 4e3a5ca09..0f80740c6 100644
--- a/qt-models/CMakeLists.txt
+++ b/qt-models/CMakeLists.txt
@@ -3,13 +3,13 @@
# models used both mobile and desktop builds
set(SUBSURFACE_GENERIC_MODELS_LIB_SRCS
- divepicturemodel.cpp
diveplotdatamodel.cpp
diveimportedmodel.cpp
)
# models exclusively used in desktop builds
set(SUBSURFACE_DESKTOP_MODELS_LIB_SRCS
+ divepicturemodel.cpp
cleanertablemodel.cpp
models.cpp
tankinfomodel.cpp