Skip to content
Snippets Groups Projects
Commit a52a78e6 authored by Pierre Lamot's avatar Pierre Lamot Committed by Felix Paul Kühne
Browse files

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.
parent e1560198
No related branches found
No related tags found
1 merge request!5857qt: fix lua interface extension not loading
Pipeline #511024 passed with stage
in 24 minutes and 10 seconds
......@@ -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
}
......
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment