summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-10-27 12:00:12 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-18 06:31:44 +0800
commit37e7602a1e62f85bec0ad2bc12d838175df8968b (patch)
tree31e5db0fb10b47885af716a9738889e784b679cd
parent76a68f71a4c25297dd65266e1ad5f2da4d80bac1 (diff)
downloadsubsurface-37e7602a1e62f85bec0ad2bc12d838175df8968b.tar.gz
Verify that copy is done
Naturally the paste button should be disabled, if this is the case, but it still makes sense to do this check. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
-rw-r--r--mobile-widgets/qmlmanager.cpp4
-rw-r--r--mobile-widgets/qmlmanager.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 573517e70..9124434e0 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1346,6 +1346,10 @@ void QMLManager::pasteDiveData(int id)
appendTextToLog("trying to paste to non-existing dive");
return;
}
+ if (!m_copyPasteDive) {
+ appendTextToLog("dive to paste is not selected");
+ return;
+ }
selective_copy_dive(m_copyPasteDive, d, what, false);
changesNeedSaving();
}
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index ca638e02c..1f2790854 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -226,7 +226,7 @@ private:
bool m_btEnabled;
void updateAllGlobalLists();
QString m_pluggedInDeviceName;
- struct dive *m_copyPasteDive;
+ struct dive *m_copyPasteDive = NULL;
struct dive_components what;
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)