Commit 648ed77d authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

Clear Library and MainWorkflow when a project is closed

Clearing only in postLoad causes a problem when a new project is created, which will call save() first.
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 41158d88
......@@ -69,7 +69,6 @@ Library::preSave()
void
Library::postLoad()
{
clear();
for ( const auto& var : m_settings->value( "medias" )->get().toList() )
createMediaFromVariant( var );
......
......@@ -59,6 +59,8 @@ Core::Core()
connect( m_library, &Library::cleanStateChanged, m_currentProject, &Project::libraryCleanChanged );
connect( m_currentProject, SIGNAL( projectLoaded( QString, QString ) ),
m_recentProjects, SLOT( projectLoaded( QString, QString ) ) );
connect( m_currentProject, &Project::projectClosed, m_library, &Library::clear );
connect( m_currentProject, &Project::projectClosed, m_workflow, &MainWorkflow::clear );
m_timer.start();
}
......
......@@ -337,7 +337,6 @@ MainWorkflow::preSave()
void
MainWorkflow::postLoad()
{
clear();
QVariantList l = m_settings->value( "tracks" )->get().toList();
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
m_tracks[i]->loadFromVariant( l[i] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment