[vlmc-devel] ProjectManager: Use project name instead of project file in the recent project list.
Hugo Beauzée-Luyssen
git at videolan.org
Wed Sep 5 17:43:04 CEST 2012
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Sep 5 17:38:30 2012 +0300| [e03dbdb74f6cf207a05b8d0456381dd1196a2782] | committer: Hugo Beauzée-Luyssen
ProjectManager: Use project name instead of project file in the recent project list.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e03dbdb74f6cf207a05b8d0456381dd1196a2782
---
src/Gui/project/GuiProjectManager.cpp | 2 +-
src/Gui/wizard/WelcomePage.cpp | 6 +++---
src/Project/ProjectManager.cpp | 13 +++++++------
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/Gui/project/GuiProjectManager.cpp b/src/Gui/project/GuiProjectManager.cpp
index 9110298..cc216e0 100644
--- a/src/Gui/project/GuiProjectManager.cpp
+++ b/src/Gui/project/GuiProjectManager.cpp
@@ -146,7 +146,7 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
SettingsManager::getInstance()->setValue( "general/Workspace",
fInfo.absolutePath(), SettingsManager::Project);
- appendToRecentProject( outputFileName );
+ appendToRecentProject( projectName() );
if ( relocate == true )
Workspace::getInstance()->copyAllToWorkspace();
emit projectUpdated( projectName(), true );
diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
index 82126bd..21a12a0 100644
--- a/src/Gui/wizard/WelcomePage.cpp
+++ b/src/Gui/wizard/WelcomePage.cpp
@@ -179,11 +179,11 @@ WelcomePage::removeProject()
if ( selected.isEmpty() )
return;
- const QString fileName = selected.at( 0 )->data( FilePath ).toString();
- if ( fileName.isEmpty() )
+ const QString project = selected.at( 0 )->data( FilePath ).toString();
+ if ( project.isEmpty() )
return;
- GUIProjectManager::getInstance()->removeProject( fileName );
+ GUIProjectManager::getInstance()->removeProject( project );
loadRecentsProjects(); // Reload recent projects
}
diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index 1145b57..fee907e 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -118,7 +118,7 @@ ProjectManager::loadWorkflow()
loadTimeline( root );
if ( m_projectFile != NULL )
{
- appendToRecentProject( m_projectFile->fileName() );
+ appendToRecentProject( projectName() );
savedState = true;
}
else
@@ -170,10 +170,10 @@ ProjectManager::loadProject( const QString& fileName )
}
void
-ProjectManager::removeProject( const QString& fileName )
+ProjectManager::removeProject( const QString& project )
{
// Remove all occurence of fileName
- m_recentsProjects.removeAll( fileName );
+ m_recentsProjects.removeAll( project );
QSettings s;
s.setValue( "RecentsProjects", m_recentsProjects );
@@ -233,11 +233,11 @@ ProjectManager::createAutoSaveOutputFileName( const QString& baseName ) const
void
-ProjectManager::appendToRecentProject( const QString& projectFile )
+ProjectManager::appendToRecentProject( const QString& projectName )
{
// Append the item to the recents list
- m_recentsProjects.removeAll( projectFile );
- m_recentsProjects.prepend( projectFile );
+ m_recentsProjects.removeAll( projectName );
+ m_recentsProjects.prepend( projectName );
while ( m_recentsProjects.count() > 15 )
m_recentsProjects.removeLast();
@@ -248,6 +248,7 @@ ProjectManager::appendToRecentProject( const QString& projectFile )
QString
ProjectManager::projectName() const
{
+ //FIXME: Can this be true?
if ( m_projectName.isEmpty() == true )
{
if ( m_projectFile != NULL )
More information about the Vlmc-devel
mailing list