[vlc-commits] [Git][videolan/vlc][master] 5 commits: qt: do not discard result of `MainUI::setup()` in compositor_dummy

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jun 22 05:58:46 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
46779bdb by Fatih Uzunoglu at 2024-06-22T05:27:15+00:00
qt: do not discard result of `MainUI::setup()` in compositor_dummy

Otherwise we can not achieve graceful failure.

- - - - -
068bdc85 by Fatih Uzunoglu at 2024-06-22T05:27:15+00:00
qt: mark `MainUI::setup()` as nodiscard

- - - - -
04118fbf by Fatih Uzunoglu at 2024-06-22T05:27:15+00:00
qt: mark `Compositor::init()` as nodiscard

- - - - -
1ba3cfd6 by Fatih Uzunoglu at 2024-06-22T05:27:15+00:00
qt: mark `Compositor::makeMainInterface()` as nodiscard

- - - - -
07768349 by Fatih Uzunoglu at 2024-06-22T05:27:15+00:00
qt: mark `Compositor::setupVoutWindow()` as nodiscard

- - - - -


3 changed files:

- modules/gui/qt/maininterface/compositor.hpp
- modules/gui/qt/maininterface/compositor_dummy.cpp
- modules/gui/qt/maininterface/mainui.hpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor.hpp
=====================================
@@ -68,14 +68,14 @@ public:
 public:
     virtual ~Compositor() = default;
 
-    virtual bool init() = 0;
+    [[nodiscard]] virtual bool init() = 0;
 
-    virtual bool makeMainInterface(MainCtx* intf) = 0;
+    [[nodiscard]] virtual bool makeMainInterface(MainCtx* intf) = 0;
     virtual void destroyMainInterface() = 0;
 
     virtual void unloadGUI() = 0;
 
-    virtual bool setupVoutWindow(vlc_window_t *p_wnd, VoutDestroyCb destroyCb) = 0;
+    [[nodiscard]] virtual bool setupVoutWindow(vlc_window_t *p_wnd, VoutDestroyCb destroyCb) = 0;
 
     virtual Type type() const = 0;
 


=====================================
modules/gui/qt/maininterface/compositor_dummy.cpp
=====================================
@@ -52,7 +52,9 @@ bool CompositorDummy::makeMainInterface(MainCtx* mainCtx)
     m_intfWindowHandler = std::make_unique<InterfaceWindowHandler>(m_intf, m_mainCtx, m_qmlWidget.get(), nullptr);
 
     MainUI* ui = new MainUI(m_intf, m_mainCtx, m_qmlWidget.get(), m_qmlWidget.get());
-    ui->setup(m_qmlWidget->engine());
+    if (!ui->setup(m_qmlWidget->engine()))
+        return false;
+
     m_qmlWidget->setContent(QUrl(), ui->getComponent(), ui->createRootItem());
 
     if (m_qmlWidget->status() != QQuickView::Ready)


=====================================
modules/gui/qt/maininterface/mainui.hpp
=====================================
@@ -22,7 +22,7 @@ public:
     explicit MainUI(qt_intf_t *_p_intf, MainCtx* mainCtx, QWindow* interfaceWindow, QObject *parent = nullptr);
     ~MainUI();
 
-    bool setup(QQmlEngine* engine);
+    [[nodiscard]] bool setup(QQmlEngine* engine);
 
     inline QQmlComponent* getComponent() const {return m_component;}
     VLC_USED



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/931e9f34cec5cfbc939672e0691e41fde19e94f5...07768349dff3c22b3344585eea7ee651558dae98

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/931e9f34cec5cfbc939672e0691e41fde19e94f5...07768349dff3c22b3344585eea7ee651558dae98
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