[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: fix handling of uninitialized model

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Sep 5 14:40:59 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0dc8903d by Prince Gupta at 2023-09-05T13:51:07+00:00
qt: fix handling of uninitialized model

- - - - -
158b9c7f by Prince Gupta at 2023-09-05T13:51:07+00:00
qt: use qDeleteAll

- - - - -


1 changed file:

- modules/gui/qt/menus/custom_menus.cpp


Changes:

=====================================
modules/gui/qt/menus/custom_menus.cpp
=====================================
@@ -538,15 +538,11 @@ void RecentMenu::onDataChanged(const QModelIndex& topLeft, const QModelIndex& bo
 
 void RecentMenu::onModelReset()
 {
-    for (QAction * action : m_actions)
-    {
-        delete action;
-    }
-
+    qDeleteAll(m_actions);
     m_actions.clear();
 
     int nb_rows = m_model->rowCount();
-    if (nb_rows == 0)
+    if (nb_rows == 0 || nb_rows == -1)
         setEnabled(false);
     else
         onRowInserted({}, 0, nb_rows - 1);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dcd2210b346eacb767155b1e086d9fe65a1d663c...158b9c7f733ce13ed5dbe5186020bfe871c3598f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dcd2210b346eacb767155b1e086d9fe65a1d663c...158b9c7f733ce13ed5dbe5186020bfe871c3598f
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