[vlc-commits] [Git][videolan/vlc][3.0.x] qt: plugins: reset selection when reloading extensions

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Feb 17 09:34:58 UTC 2023



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
96df5fd9 by Alexandre Janniaux at 2023-02-17T09:17:48+00:00
qt: plugins: reset selection when reloading extensions

When selecting an extension and reloading them afterwards, the selection
points to invalid data but still represent a valid index for Qt, so the
button More Information is still clickable and will lead to a crash.

Reset the selection when reloading to prevent that.

Fixes #27830

Cherry-picked from commit 4cca6109e2a003c5e7260a9d760b2feee22ed036 via
manual backport.

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/dialogs/plugins.cpp
=====================================
@@ -218,6 +218,13 @@ bool PluginTreeItem::operator< ( const QTreeWidgetItem & other ) const
     return text( col ) < other.text( col );
 }
 
+void ExtensionTab::reloadExtensions()
+{
+    extList->clearSelection();
+    ExtensionsManager *EM = ExtensionsManager::getInstance( p_intf );
+    EM->reloadExtensions();
+}
+
 /* Extensions tab */
 ExtensionTab::ExtensionTab( intf_thread_t *p_intf_ )
         : QVLCFrame( p_intf_ )
@@ -259,7 +266,7 @@ ExtensionTab::ExtensionTab( intf_thread_t *p_intf_ )
     QPushButton *reload = new QPushButton( QIcon( ":/update.svg" ),
                                            qtr( "Reload extensions" ),
                                            this );
-    CONNECT( reload, clicked(), EM, reloadExtensions() );
+    CONNECT( reload, clicked(), this, reloadExtensions() );
     CONNECT( reload, clicked(), this, updateButtons() );
     CONNECT( extList->selectionModel(),
              selectionChanged( const QItemSelection &, const QItemSelection & ),


=====================================
modules/gui/qt/dialogs/plugins.hpp
=====================================
@@ -118,6 +118,7 @@ private:
 private slots:
     void moreInformation();
     void updateButtons();
+    void reloadExtensions();
 
 private:
     QListView *extList;



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/96df5fd9570b13e9be72f0836bc69ae47a39038e
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