[vlmc-devel] Project: Do not depend on the workspace location to create a project

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 1 23:16:24 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr  1 23:55:08 2014 +0300| [2563dd6ddb98997ae3402a397f307e71dff7aae6] | committer: Hugo Beauzée-Luyssen

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

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=2563dd6ddb98997ae3402a397f307e71dff7aae6
---

 src/Project/Project.cpp |    8 ++++----
 src/Project/Project.h   |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index d6af900..f436756 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -176,11 +176,11 @@ Project::loadProject( const QString &fileName )
 }
 
 void
-Project::newProject( const QString &projectName, const QString &workspacePath )
+Project::newProject( const QString &projectName, const QString& projectPath )
 {
     m_projectName = projectName;
     //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();
     emit projectLoaded( projectName, m_projectFile->fileName() );
 }
@@ -234,8 +234,8 @@ Project::saveAs()
 {
     if ( m_projectManagerUi == NULL )
         return ;
-    const QString& fileName = m_projectManagerUi->getProjectFileDestination(
-                m_settings->value( "vlmc/Workspace" )->get().toString() );
+    QFileInfo fInfo( *m_projectFile );
+    const QString& fileName = m_projectManagerUi->getProjectFileDestination( fInfo.absolutePath() );
     if ( fileName.isEmpty() )
         return ;
     saveProject( fileName );
diff --git a/src/Project/Project.h b/src/Project/Project.h
index adc2a81..fad6726 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -90,7 +90,7 @@ class Project : public QObject, public Singleton<Project>
         QString             name();
         bool                closeProject();
         void                saveProject( const QString& filename );
-        void                newProject( const QString& projectName, const QString &workspacePath );
+        void                newProject( const QString& projectName, const QString& projectPath );
 
 
     private slots:



More information about the Vlmc-devel mailing list