[vlc-commits] [Git][videolan/vlc][master] qt: do the update check after handling the dialog provider

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jul 23 12:39:54 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a74a6980 by Steve Lhomme at 2024-07-23T11:31:22+00:00
qt: do the update check after handling the dialog provider

Otherwise it's crashing.

`UpdateDialog` is a `QVLCFrame` and at the same time, is a window.
All windows should be initialized after `b_isDialogProvider` is
determined, so that:

- The transient parent can be set, if the main window is shown.
- The transient parent is not set, if the main window is not shown.

Co-authored-by: Fatih Uzunoglu <fuzun54 at outlook.com>

- - - - -


1 changed file:

- modules/gui/qt/qt.cpp


Changes:

=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -971,22 +971,6 @@ static void *Thread( void *obj )
     p_intf->p_mainPlayerController = new PlayerController(p_intf);
     p_intf->p_mainPlaylistController = new vlc::playlist::PlaylistController(p_intf->p_playlist);
 
-#ifdef UPDATE_CHECK
-    /* Checking for VLC updates */
-    if( var_InheritBool( p_intf, "qt-updates-notif" ) &&
-        !var_InheritBool( p_intf, "qt-privacy-ask" ) )
-    {
-        int interval = var_InheritInteger( p_intf, "qt-updates-days" );
-        if( QDate::currentDate() >
-             getSettings()->value( "updatedate" ).toDate().addDays( interval ) )
-        {
-            /* The constructor of the update Dialog will do the 1st request */
-            UpdateDialog::getInstance( p_intf );
-            getSettings()->setValue( "updatedate", QDate::currentDate() );
-        }
-    }
-#endif
-
     /* Create the normal interface in non-DP mode */
 #ifdef _WIN32
     p_intf->p_mi = new MainCtxWin32(p_intf);
@@ -1045,6 +1029,22 @@ static void *Thread( void *obj )
     /* Explain how to show a dialog :D */
     p_intf->pf_show_dialog = ShowDialog;
 
+#ifdef UPDATE_CHECK
+    /* Checking for VLC updates */
+    if( var_InheritBool( p_intf, "qt-updates-notif" ) &&
+        !var_InheritBool( p_intf, "qt-privacy-ask" ) )
+    {
+        int interval = var_InheritInteger( p_intf, "qt-updates-days" );
+        if( QDate::currentDate() >
+             getSettings()->value( "updatedate" ).toDate().addDays( interval ) )
+        {
+            /* The constructor of the update Dialog will do the 1st request */
+            UpdateDialog::getInstance( p_intf );
+            getSettings()->setValue( "updatedate", QDate::currentDate() );
+        }
+    }
+#endif
+
     /* Tell the main LibVLC thread we are ready */
     {
         vlc::threads::mutex_locker locker (lock);



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

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