[vlmc-devel] [PATCH] Fix misconnection between Project::projectLoaded and RecentProjects::projectLoaded

Yikai Lu luyikei.qmltu at gmail.com
Tue Mar 8 06:41:08 CET 2016


However, since I don't know our policy of where to save project files, this fix might not be desirable.
---
 src/Main/Core.cpp              | 3 +--
 src/Project/RecentProjects.cpp | 5 +++--
 src/Project/RecentProjects.h   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Main/Core.cpp b/src/Main/Core.cpp
index a9fcf0b..b4d95c3 100644
--- a/src/Main/Core.cpp
+++ b/src/Main/Core.cpp
@@ -58,8 +58,7 @@ 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 ) ) );
-    connect( m_currentProject, SIGNAL( projectLoaded( QString, QString ) ),
-             m_recentProjects, SLOT( projectLoaded( QString, QString ) ) );
+    connect( m_currentProject, SIGNAL( projectLoaded( QString ) ), m_recentProjects, SLOT( projectLoaded( QString ) ) );
 }
 
 Core::~Core()
diff --git a/src/Project/RecentProjects.cpp b/src/Project/RecentProjects.cpp
index 0b9bbbd..9523b4c 100644
--- a/src/Project/RecentProjects.cpp
+++ b/src/Project/RecentProjects.cpp
@@ -39,12 +39,13 @@ RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
 }
 
 void
-RecentProjects::projectLoaded(const QString& projectName, const QString& projectFile)
+RecentProjects::projectLoaded(const QString& projectName )
 {
     removeFromRecentProjects( projectName );
     RecentProject project;
     project.name = projectName;
-    project.filePath = projectFile;
+    project.filePath = QString( "%1/%2" ).arg( VLMC_GET_STRING( "vlmc/WorkspaceLocation" ) )
+                                         .arg( QString(projectName).replace(' ', '_') );
     m_recentsProjects.prepend( project );
     while ( m_recentsProjects.count() > 15 )
         m_recentsProjects.removeLast();
diff --git a/src/Project/RecentProjects.h b/src/Project/RecentProjects.h
index aa864c3..58c3f25 100644
--- a/src/Project/RecentProjects.h
+++ b/src/Project/RecentProjects.h
@@ -51,7 +51,7 @@ class RecentProjects : public QObject
 
 
     public slots:
-        void            projectLoaded( const QString& projectName, const QString& projectFile );
+        void            projectLoaded( const QString& projectName );
 
     private slots:
         void            loadRecentProjects(const QVariant& recentProjects);
-- 
1.9.1



More information about the Vlmc-devel mailing list