Commit c7ec08aa authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Centralize connection for Core classes to Project instances in a Core::onProjectLoaded method

parent 8ba057f3
......@@ -95,6 +95,13 @@ Core::automaticBackup()
return m_automaticBackup;
}
void
Core::onProjectLoaded( Project* project )
{
m_automaticBackup->setProject( project );
m_recentProjects->setProject( project );
}
Settings*
Core::settings()
{
......
......@@ -26,6 +26,7 @@
class AutomaticBackup;
class EffectsEngine;
class NotificationZone;
class Project;
class RecentProjects;
class Settings;
class VlmcLogger;
......@@ -47,6 +48,8 @@ class Core : public Singleton<Core>
RecentProjects* recentProjects();
AutomaticBackup* automaticBackup();
void onProjectLoaded( Project* project );
private:
Core();
~Core();
......
......@@ -120,8 +120,7 @@ Project::load( const QString& fileName )
self->loadProject( fileName );
self->connectComponents();
Core::getInstance()->automaticBackup()->setProject( self );
Core::getInstance()->recentProjects()->setProject( self );
Core::getInstance()->onProjectLoaded( self );
return true;
}
......@@ -136,8 +135,7 @@ Project::create(const QString& projectName, const QString& projectPath )
self->newProject( projectName, projectPath );
self->connectComponents();
Core::getInstance()->automaticBackup()->setProject( self );
Core::getInstance()->recentProjects()->setProject( self );
Core::getInstance()->onProjectLoaded( self );
return true;
}
......
......@@ -40,7 +40,6 @@ class RecentProjects : public QObject
};
typedef QList<RecentProject> List;
explicit RecentProjects(Settings* vlmcSettings, QObject *parent = 0 );
void setProject(Project* projectManager );
......
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