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

ProjectManager: Use project name instead of project file in the recent project list.

parent 1e48b882
......@@ -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 );
......
......@@ -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
}
......
......@@ -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 )
......
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