Commit 6373d704 authored by luyikei's avatar luyikei

Core: Remove newProject and loadProject

They just wrap the functions of project, which is already public. We should keep Core as simple as possible.
parent 4ec757c1
......@@ -425,7 +425,7 @@ MainWindow::on_actionLoad_Project_triggered()
folder, tr( "VLMC project file(*.vlmc)" ) );
if ( fileName.isEmpty() == true )
return ;
Core::instance()->loadProject( fileName );
Core::instance()->project()->load( fileName );
}
void
......@@ -865,7 +865,7 @@ MainWindow::updateRecentProjects()
);
connect( action, &QAction::triggered, this, [this, file]()
{
Core::instance()->loadProject( file );
Core::instance()->project()->load( file );
} );
}
m_ui.actionRecent_Projects->setMenu( menu );
......
......@@ -58,7 +58,7 @@ bool
OpenPage::validatePage()
{
if ( WelcomePage::projectPath().isEmpty() == false )
return Core::instance()->loadProject( WelcomePage::projectPath() );
return Core::instance()->project()->load( WelcomePage::projectPath() );
return false;
}
......
......@@ -103,7 +103,7 @@ ProjectWizard::accept()
//If he was creating a project, the current page will be the video/audio settings one.
if ( currentId() == Page_Video )
{
Core::instance()->newProject
Core::instance()->project()->newProject
(
field( "projectName" ).toString(),
QString( "%1/%2.vlmc" )
......
......@@ -104,22 +104,6 @@ Core::recentProjects()
return m_recentProjects;
}
bool
Core::loadProject(const QString& fileName)
{
if ( fileName.isEmpty() == true )
return false;
//FIXME: What if the project was unsaved, and the user wants to cancel the operation?
return m_currentProject->load( fileName );
}
bool
Core::newProject( const QString& projectName, const QString& projectPath )
{
m_currentProject->newProject( projectName, projectPath );
return true;
}
Settings*
Core::settings()
{
......
......@@ -56,9 +56,6 @@ class Core : public MeyersSingleton<Core>
*/
qint64 runtime();
bool loadProject( const QString& fileName );
bool newProject( const QString& projectName, const QString& projectPath );
private:
Core();
~Core();
......
......@@ -180,7 +180,7 @@ VLMCGuimain( const QString& projectFile )
w.show();
if ( projectFile.isEmpty() == false )
Core::instance()->loadProject( projectFile );
Core::instance()->project()->load( projectFile );
auto res = qApp->exec();
Core::instance()->settings()->save();
......
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