[vlc-commits] [Git][videolan/vlc][master] qt: fix lua interface extension not loading

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Sep 6 18:28:02 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
a52a78e6 by Pierre Lamot at 2024-09-06T18:00:38+00:00
qt: fix lua interface extension not loading

extension_dialog_t is not a registered type in qt so the signal was failing.

It's usually dangerous to pass VLC C object in Qt signals regarding the lifetime
of these objects, so rather than registering the type, the object is passed
though lambda capture assumming that the current comment and code is correct.

- - - - -


2 changed files:

- modules/gui/qt/dialogs/extensions/extensions.cpp
- modules/gui/qt/dialogs/extensions/extensions.hpp


Changes:

=====================================
modules/gui/qt/dialogs/extensions/extensions.cpp
=====================================
@@ -54,9 +54,6 @@ ExtensionsDialogProvider::ExtensionsDialogProvider( qt_intf_t *_p_intf,
     assert(p_extensions_manager);
 
     vlc_dialog_provider_set_ext_callback( p_intf, DialogCallback, NULL );
-
-    connect( this, &ExtensionsDialogProvider::SignalDialog,
-             this, &ExtensionsDialogProvider::UpdateExtDialog );
 }
 
 ExtensionsDialogProvider::~ExtensionsDialogProvider()
@@ -144,7 +141,9 @@ void ExtensionsDialogProvider::ManageDialog( extension_dialog_t *p_dialog )
     ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf );
     assert( extMgr != NULL );
     if( !extMgr->isUnloading() )
-        emit SignalDialog( p_dialog ); // Safe because we signal Qt thread
+        QMetaObject::invokeMethod(this, [this, p_dialog](){
+            UpdateExtDialog( p_dialog );
+        }); // Safe because we signal Qt thread
     else
         UpdateExtDialog( p_dialog ); // This is safe, we're already in Qt thread
 }


=====================================
modules/gui/qt/dialogs/extensions/extensions.hpp
=====================================
@@ -66,9 +66,6 @@ private slots:
 public:
     void ManageDialog( extension_dialog_t *p_dialog );
 
-signals:
-    void SignalDialog( extension_dialog_t *p_dialog );
-
 private:
     ExtensionsDialogProvider( qt_intf_t *p_intf = nullptr,
                              extensions_manager_t *p_mgr = nullptr );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a52a78e6cd05217939e29abbc6ba88b73891f3ff

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a52a78e6cd05217939e29abbc6ba88b73891f3ff
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list