[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: use correct key when removing the invalidated sg graphics api cache

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Apr 18 10:10:57 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d122762b by Fatih Uzunoglu at 2025-04-18T09:28:19+00:00
qt: use correct key when removing the invalidated sg graphics api cache

- - - - -
8e5c6d77 by Fatih Uzunoglu at 2025-04-18T09:28:19+00:00
qt: classify scene graph error critical and not warning

Note that fatal messages cause Qt to abort the program. I
think standard errors are best represented with critical
messages.

We never want Qt to abort the program itself, as in most
cases we can gracefully handle the situation (as done
here).

- - - - -


1 changed file:

- modules/gui/qt/qt.cpp


Changes:

=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -967,11 +967,12 @@ static void *Thread( void *obj )
     };
 
     static const char* const asyncRhiProbeCompletedProperty = "asyncRhiProbeCompleted";
+    // NOTE: `QSettings` accepts `QAnyStringView` starting from Qt 6.4, use `QLatin1String(View)`:
+    static constexpr QLatin1String graphicsApiKey {"graphics-api"};
     if (qEnvironmentVariableIsEmpty("QSG_RHI_BACKEND") &&
         qEnvironmentVariableIsEmpty("QT_QUICK_BACKEND") &&
         (QT_VERSION < QT_VERSION_CHECK(6, 4, 0) || !uint(qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER"))))
     {
-        static const char* const graphicsApiKey = "graphics-api";
         const QVariant graphicsApiValue = p_intf->mainSettings->value(graphicsApiKey);
         // settings value can be string (ini file), do not use `typeId()`:
         if (graphicsApiValue.isValid() && Q_LIKELY(graphicsApiValue.canConvert<int>()))
@@ -1053,7 +1054,7 @@ static void *Thread( void *obj )
                              &QQuickWindow::sceneGraphError,
                              &app,
                              [&app, mainCtx, settings](QQuickWindow::SceneGraphError error, const QString &message) {
-                                 qWarning() << "Compositor: Scene Graph Error: " << error << ", Message: " << message;
+                                 qCritical() << "Compositor: Scene Graph Error: " << error << ", Message: " << message;
                                  assert(mainCtx);
 #ifdef _WIN32
                                 // This is not really important, as with graceful exit the events in the queue should
@@ -1062,7 +1063,7 @@ static void *Thread( void *obj )
                                  if (!app.property(asyncRhiProbeCompletedProperty).toBool())
                                  {
                                      assert(settings);
-                                     settings->remove(asyncRhiProbeCompletedProperty);
+                                     settings->remove(graphicsApiKey);
                                      settings->sync();
                                  }
 #endif



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/30545194671b90b17c1f8fa61cd57ccc69964a43...8e5c6d770a0858d762109c44ad577030f2398a0f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/30545194671b90b17c1f8fa61cd57ccc69964a43...8e5c6d770a0858d762109c44ad577030f2398a0f
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