From 37e7602a1e62f85bec0ad2bc12d838175df8968b Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sat, 27 Oct 2018 12:00:12 +0300 Subject: 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 --- mobile-widgets/qmlmanager.cpp | 4 ++++ mobile-widgets/qmlmanager.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'mobile-widgets') 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) -- cgit v1.2.3-70-g09d2