[vlmc-devel] Remove setProject from RecentProjects

Yikai Lu git at videolan.org
Mon Mar 7 13:48:08 CET 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Mar  7 20:43:44 2016 +0900| [21cf4af1fffc10ae1baaf0b77082e098e0ee3ee5] | committer: Hugo Beauzée-Luyssen

Remove setProject from RecentProjects

It is used only once. We don't have to do it as a function.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/21cf4af1fffc10ae1baaf0b77082e098e0ee3ee5
---

 src/Main/Core.cpp              |  4 ++--
 src/Project/RecentProjects.cpp | 11 -----------
 src/Project/RecentProjects.h   |  2 --
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/Main/Core.cpp b/src/Main/Core.cpp
index abbcd4d..a9fcf0b 100644
--- a/src/Main/Core.cpp
+++ b/src/Main/Core.cpp
@@ -58,8 +58,8 @@ Core::Core()
     connect( m_undoStack, SIGNAL( cleanChanged( bool ) ), m_currentProject, SLOT( cleanChanged( bool ) ) );
     connect( m_currentProject, SIGNAL( projectSaved() ), m_undoStack, SLOT( setClean() ) );
     connect( m_library, SIGNAL( cleanStateChanged( bool ) ), m_currentProject, SLOT( libraryCleanChanged( bool ) ) );
-
-    m_recentProjects->setProject( m_currentProject );
+    connect( m_currentProject, SIGNAL( projectLoaded( QString, QString ) ),
+             m_recentProjects, SLOT( projectLoaded( QString, QString ) ) );
 }
 
 Core::~Core()
diff --git a/src/Project/RecentProjects.cpp b/src/Project/RecentProjects.cpp
index 080950d..0b9bbbd 100644
--- a/src/Project/RecentProjects.cpp
+++ b/src/Project/RecentProjects.cpp
@@ -31,7 +31,6 @@
 RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
     : QObject(parent)
     , m_settings( vlmcSettings )
-    , m_project( NULL )
 {
 	SettingValue* recentProjects = vlmcSettings->createVar( SettingValue::String, "private/RecentsProjects", "",
                                                 "", "", SettingValue::Private );
@@ -40,16 +39,6 @@ RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
 }
 
 void
-RecentProjects::setProject( Project* project )
-{
-    if ( m_project != NULL )
-        disconnect( m_project, SIGNAL( projectLoaded( QString, QString ) ) );
-    m_project = project;
-    connect( project, SIGNAL( projectLoaded( QString, QString ) ),
-             this, SLOT( projectLoaded( QString, QString ) ) );
-}
-
-void
 RecentProjects::projectLoaded(const QString& projectName, const QString& projectFile)
 {
     removeFromRecentProjects( projectName );
diff --git a/src/Project/RecentProjects.h b/src/Project/RecentProjects.h
index 4bdf3e2..aa864c3 100644
--- a/src/Project/RecentProjects.h
+++ b/src/Project/RecentProjects.h
@@ -42,7 +42,6 @@ class RecentProjects : public QObject
 
         explicit RecentProjects(Settings* vlmcSettings, QObject *parent = 0 );
 
-        void            setProject(Project* projectManager );
         void            remove( const QString& projectFile );
         const List&     list() const;
 
@@ -59,7 +58,6 @@ class RecentProjects : public QObject
 
     private:
         Settings*       m_settings;
-        Project*        m_project;
         List            m_recentsProjects;
 
 };



More information about the Vlmc-devel mailing list