[vlmc-devel] Fix misconnection between projectUpdated(QVariant) and projectUpdated( QString)

Yikai Lu git at videolan.org
Tue Mar 8 13:01:21 CET 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Mar  8 14:17:33 2016 +0900| [4c99b220f42b54cb6c21cbd33dac14a57c906e40] | committer: Hugo Beauzée-Luyssen

Fix misconnection between projectUpdated(QVariant) and projectUpdated(QString)

I fix this by creating a proxy slot.

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

> https://code.videolan.org/videolan/vlmc/commit/4c99b220f42b54cb6c21cbd33dac14a57c906e40
---

 src/Project/Project.cpp | 8 +++++++-
 src/Project/Project.h   | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index fc9fda5..20ab0ca 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -216,7 +216,7 @@ Project::initSettings()
                                     QT_TRANSLATE_NOOP( "PreferenceWidget", "Project name" ),
                                     QT_TRANSLATE_NOOP( "PreferenceWidget", "The project name" ),
                                     SettingValue::NotEmpty );
-    connect( pName, SIGNAL( changed( QVariant ) ), this, SIGNAL( projectUpdated( QVariant ) ) );
+    connect( pName, SIGNAL( changed( QVariant ) ), this, SLOT( projectUpdated( QVariant ) ) );
 }
 
 void
@@ -315,6 +315,12 @@ Project::libraryCleanChanged(bool val)
 }
 
 void
+Project::projectUpdated(const QVariant &projectName)
+{
+    emit projectUpdated( projectName.toString() );
+}
+
+void
 Project::autoSaveRequired()
 {
     if ( m_projectFile == NULL )
diff --git a/src/Project/Project.h b/src/Project/Project.h
index 3d53d05..42c0db7 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -84,6 +84,7 @@ class Project : public QObject
     public slots:
         void                cleanChanged( bool val );
         void                libraryCleanChanged( bool val );
+        void                projectUpdated( const QVariant& projectName); // Proxy slot for projectUpdated(QString)
         void                autoSaveRequired();
         void                autoSaveEnabledChanged( const QVariant& enabled );
         void                autoSaveIntervalChanged( const QVariant& interval );



More information about the Vlmc-devel mailing list