[vlmc-devel] commit: ProjectManager: Use the absolute file path when adding a project to the recent projects. ( Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Sat Mar 13 15:42:25 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Sat Mar 13 15:39:29 2010 +0100| [7b4b334b2439bd447a4cb1487702ffcce3a0eed4] | committer: Hugo Beauzee-Luyssen 

ProjectManager: Use the absolute file path when adding a project to the recent projects.

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

 src/Project/ProjectManager.cpp |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index e9c2e0f..3ee659d 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -158,7 +158,7 @@ void    ProjectManager::loadProject( const QString& fileName )
     m_needSave = false;
 
     if ( ProjectManager::isBackupFile( fileName ) == false )
-        appendToRecentProject( fileName );
+        appendToRecentProject( QFileInfo( *m_projectFile ).absoluteFilePath() );
     else
     {
         //Delete the project file representation, so the next time the user
@@ -328,15 +328,14 @@ bool    ProjectManager::isBackupFile( const QString& projectFile )
 
 void    ProjectManager::appendToRecentProject( const QString& projectFile )
 {
-        // Append the item to the recents list
-        m_recentsProjects.removeAll( projectFile );
-        m_recentsProjects.prepend( projectFile );
-        while ( m_recentsProjects.count() > 15 )
-            m_recentsProjects.removeLast();
-
-        QSettings s;
-        s.setValue( "RecentsProjects", m_recentsProjects );
-        s.sync();
+    // Append the item to the recents list
+    m_recentsProjects.removeAll( projectFile );
+    m_recentsProjects.prepend( projectFile );
+    while ( m_recentsProjects.count() > 15 )
+        m_recentsProjects.removeLast();
+
+    QSettings s;
+    s.setValue( "RecentsProjects", m_recentsProjects );
 }
 
 void    ProjectManager::automaticSaveEnabledChanged( const QVariant& val )



More information about the Vlmc-devel mailing list