[vlmc-devel] ProjectManager: Avoid having one clean state and one dirty state.

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 31 17:59:20 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 31 00:02:40 2014 +0300| [76bcfc6eb1b75974128af3bc184a476317f62e37] | committer: Hugo Beauzée-Luyssen

ProjectManager: Avoid having one clean state and one dirty state.

Stick to clean state for all components

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

 src/Project/ProjectManager.cpp |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index 121b579..1c602e8 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -49,7 +49,7 @@ const QString   ProjectManager::backupSuffix = "~";
 
 ProjectManager::ProjectManager( Settings* projectSettings, Settings* vlmcSettings )
     : m_projectFile( NULL )
-    , m_needSave( false )
+    , m_isClean( true )
     , m_libraryCleanState( true )
     , m_projectSettings( projectSettings )
     , m_vlmcSettings( vlmcSettings )
@@ -233,7 +233,7 @@ ProjectManager::loadEmergencyBackup()
     if ( QFile::exists( lastProject ) == true )
     {
         loadProject(  lastProject );
-        m_needSave = true;
+        m_isClean = false;
         return true;
     }
     return false;
@@ -276,8 +276,8 @@ ProjectManager::cleanChanged( bool val )
 {
     // This doesn't have to be different since we can force needSave = true when loading
     // a backup project file. This definitely needs testing though
-    m_needSave = val;
-    if ( m_libraryCleanState == m_needSave )
+    m_isClean = val;
+    if ( m_libraryCleanState == m_isClean )
         emit cleanStateChanged( val );
 }
 
@@ -286,7 +286,7 @@ ProjectManager::libraryCleanChanged(bool val)
 {
     Q_ASSERT( m_libraryCleanState != val);
     m_libraryCleanState = val;
-    if ( m_libraryCleanState == m_needSave )
+    if ( m_libraryCleanState == m_isClean )
         emit cleanStateChanged( val );
 }
 
@@ -370,7 +370,7 @@ ProjectManager::loadProject( const QString &fileName )
         //saves its project, vlmc will ask him where to save it.
         delete m_projectFile;
         m_projectFile = NULL;
-        m_needSave = true;
+        m_isClean = true;
     }
 
     QDomElement     root = m_domDocument->documentElement();
@@ -408,7 +408,7 @@ ProjectManager::closeProject()
     }
     delete m_projectFile;
     m_projectFile = NULL;
-    m_needSave = false;
+    m_isClean = true;
     m_projectName = QString();
     //This one is for the mainwindow, to update the title bar
     Project::getInstance()->undoStack()->clear();



More information about the Vlmc-devel mailing list