Fixed Recent file saving order.

This commit is contained in:
brunoherbelin
2020-05-24 20:08:07 +02:00
parent ddace961ae
commit 46cd20ba4e
2 changed files with 6 additions and 4 deletions

View File

@@ -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();
}
}

View File

@@ -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);