From 85d466fe0232707595e2a1c47e1519701de12f36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sun, 1 Mar 2015 14:17:41 +0100 Subject: [PATCH] Save changes in all open sequences on "Save all sequences" action --- datamanager.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/datamanager.cpp b/datamanager.cpp index 0e2b0ab..6209d8b 100644 --- a/datamanager.cpp +++ b/datamanager.cpp @@ -646,20 +646,19 @@ void DataManager::onSaveChanges() return; sr = m_activeSequence->selectedRun(); - sr->saveUserDataToJSON(); + saveSingleRunUserData(sr); } void DataManager::onSaveAllChanges() { - SingleRunsMap::iterator it; + for (NameSequencePair& p : m_sequences) { + std::shared_ptr s = p.second; + SingleRunsMap::iterator it = s->begin(); - if (m_activeSequence == nullptr) - return; - - it = m_activeSequence->begin(); - while (it != m_activeSequence->end()) { - it->second->saveUserDataToJSON(); - it++; + while (it != s->end()) { + saveSingleRunUserData(it->second); + it++; + } } } -- 2.43.5