]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Save changes in all open sequences on "Save all sequences" action
authorMichal Malý <madcatxster@devoid-pointer.net>
Sun, 1 Mar 2015 13:17:41 +0000 (14:17 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sun, 1 Mar 2015 13:17:41 +0000 (14:17 +0100)
datamanager.cpp

index 0e2b0ab5b0fff4f1e51bd5dbaae0f7350f129135..6209d8b9ab068828b6fb0215f3c65382b4b4713d 100644 (file)
@@ -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<Sequence> 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++;
+    }
   }
 }