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

Project: Do not depend on the workspace location to create a project

parent e44c2ff2
...@@ -176,11 +176,11 @@ Project::loadProject( const QString &fileName ) ...@@ -176,11 +176,11 @@ Project::loadProject( const QString &fileName )
} }
void void
Project::newProject( const QString &projectName, const QString &workspacePath ) Project::newProject( const QString &projectName, const QString& projectPath )
{ {
m_projectName = projectName; m_projectName = projectName;
//Current project file has already been delete/nulled by closeProject() //Current project file has already been delete/nulled by closeProject()
m_projectFile = new QFile( workspacePath + '/' + "project.vlmc" ); m_projectFile = new QFile( projectPath + "/project.vlmc" );
save(); save();
emit projectLoaded( projectName, m_projectFile->fileName() ); emit projectLoaded( projectName, m_projectFile->fileName() );
} }
...@@ -234,8 +234,8 @@ Project::saveAs() ...@@ -234,8 +234,8 @@ Project::saveAs()
{ {
if ( m_projectManagerUi == NULL ) if ( m_projectManagerUi == NULL )
return ; return ;
const QString& fileName = m_projectManagerUi->getProjectFileDestination( QFileInfo fInfo( *m_projectFile );
m_settings->value( "vlmc/Workspace" )->get().toString() ); const QString& fileName = m_projectManagerUi->getProjectFileDestination( fInfo.absolutePath() );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
return ; return ;
saveProject( fileName ); saveProject( fileName );
......
...@@ -90,7 +90,7 @@ class Project : public QObject, public Singleton<Project> ...@@ -90,7 +90,7 @@ class Project : public QObject, public Singleton<Project>
QString name(); QString name();
bool closeProject(); bool closeProject();
void saveProject( const QString& filename ); void saveProject( const QString& filename );
void newProject( const QString& projectName, const QString &workspacePath ); void newProject( const QString& projectName, const QString& projectPath );
private slots: private slots:
......
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