From 46cd20ba4ed036a3f1e191a6c1e4333b5a6312e0 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Sun, 24 May 2020 20:08:07 +0200 Subject: [PATCH] Fixed Recent file saving order. --- Mixer.cpp | 5 ++++- Settings.cpp | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Mixer.cpp b/Mixer.cpp index 5a8d321..369b30d 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -149,7 +149,7 @@ Mixer::Mixer() : session_(nullptr), back_session_(nullptr), current_view_(nullpt // auto load if Settings ask to if ( Settings::application.recentSessions.load_at_start && Settings::application.recentSessions.filenames.size() > 0 ) - open( Settings::application.recentSessions.filenames.back() ); + open( Settings::application.recentSessions.filenames.front() ); else // initializes with a new empty session clear(); @@ -291,7 +291,10 @@ void Mixer::insertSource(Source *s) // set a default depth to the new source layer_.setDepth(s); + // update view to show source created current_view_->update(0); +// current_view_->makeVisible(s); + current_view_->restoreSettings(); } } diff --git a/Settings.cpp b/Settings.cpp index 9d394fd..1dc4e27 100644 --- a/Settings.cpp +++ b/Settings.cpp @@ -104,7 +104,7 @@ void Settings::Save() XMLElement *fileNode = xmlDoc.NewElement("path"); XMLText *text = xmlDoc.NewText( (*it).c_str() ); fileNode->InsertEndChild( text ); - recentsession->InsertEndChild(fileNode); + recentsession->InsertFirstChild(fileNode); }; recent->InsertEndChild(recentsession); @@ -112,11 +112,10 @@ void Settings::Save() recentmedia->SetAttribute("path", application.recentImport.path.c_str()); for(auto it = application.recentImport.filenames.begin(); it != application.recentImport.filenames.end(); it++) { - XMLElement *fileNode = xmlDoc.NewElement("path"); XMLText *text = xmlDoc.NewText( (*it).c_str() ); fileNode->InsertEndChild( text ); - recentmedia->InsertEndChild(fileNode); + recentmedia->InsertFirstChild(fileNode); } recent->InsertEndChild(recentmedia);