[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt/MainInterface: default initialize member variables

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Oct 28 12:43:23 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
a9d901ea by Prince Gupta at 2021-10-28T12:29:07+00:00
qt/MainInterface: default initialize member variables

fixes undefined sanitizers warnings -
../../modules/gui/qt/maininterface/main_interface.cpp:283:19: runtime
error: load of value 190, which is not a valid value for type 'bool'
.... etc

- - - - -
93cf0b18 by Prince Gupta at 2021-10-28T12:29:07+00:00
qml/MainInterface: remove unused function

fixes associated compile time warning

- - - - -


2 changed files:

- modules/gui/qt/maininterface/main_interface.cpp
- modules/gui/qt/maininterface/main_interface.hpp


Changes:

=====================================
modules/gui/qt/maininterface/main_interface.cpp
=====================================
@@ -104,12 +104,6 @@ namespace
 template <typename T>
 T loadVLCOption(vlc_object_t *obj, const char *name);
 
-template <>
-float loadVLCOption<float>(vlc_object_t *obj, const char *name)
-{
-    return var_InheritFloat(obj, name);
-}
-
 template <>
 int loadVLCOption<int>(vlc_object_t *obj, const char *name)
 {
@@ -127,14 +121,6 @@ bool loadVLCOption<bool>(vlc_object_t *obj, const char *name)
 MainInterface::MainInterface(qt_intf_t *_p_intf)
     : p_intf(_p_intf)
 {
-    /* Variables initialisation */
-    lastWinScreen        = NULL;
-    sysTray              = NULL;
-
-    b_hideAfterCreation  = false; // --qt-start-minimized
-    playlistVisible      = false;
-    playlistWidthFactor  = 4.0;
-
     /**
      *  Configuration and settings
      *  Pre-building of interface


=====================================
modules/gui/qt/maininterface/main_interface.hpp
=====================================
@@ -250,8 +250,8 @@ protected:
     bool m_showRemainingTime = false;
 
     /* */
-    QSettings           *settings;
-    QSystemTrayIcon     *sysTray;
+    QSettings           *settings = nullptr;
+    QSystemTrayIcon     *sysTray = nullptr;
     std::unique_ptr<QMenu> systrayMenu;
 
     QString              input_name;
@@ -259,28 +259,28 @@ protected:
     /* Status and flags */
     QPoint              lastWinPosition;
     QSize               lastWinSize;  /// To restore the same window size when leaving fullscreen
-    QScreen             *lastWinScreen;
+    QScreen             *lastWinScreen = nullptr;
 
     QSize               pendingResize; // to be applied when fullscreen is disabled
 
     QMap<QWidget *, QSize> stackWidgetsSizes;
 
     /* Flags */
-    double               m_intfUserScaleFactor;
-    double               m_intfScaleFactor;
-    int                  i_notificationSetting; /// Systray Notifications
-    bool                 b_hideAfterCreation;
-    bool                 b_minimalView;         ///< Minimal video
-    bool                 b_playlistDocked;
+    double               m_intfUserScaleFactor = 1.;
+    double               m_intfScaleFactor = 1.;
+    int                  i_notificationSetting = 0; /// Systray Notifications
+    bool                 b_hideAfterCreation = false; /// --qt-start-minimized
+    bool                 b_minimalView = false;         ///< Minimal video
+    bool                 b_playlistDocked = false;
     QWindow::Visibility  m_windowVisibility = QWindow::Windowed;
-    bool                 b_interfaceOnTop;      ///keep UI on top
+    bool                 b_interfaceOnTop = false;      ///keep UI on top
 #ifdef QT5_HAS_WAYLAND
-    bool                 b_hasWayland;
+    bool                 b_hasWayland = false;
 #endif
-    bool                 b_hasMedialibrary;
+    bool                 b_hasMedialibrary = false;
     MediaLib*            m_medialib = nullptr;
-    bool                 m_gridView;
-    ColorSchemeModel*    m_colorScheme;
+    bool                 m_gridView = false;
+    ColorSchemeModel*    m_colorScheme = nullptr;
     bool                 m_clientSideDecoration = false;
     bool                 m_hasToolbarMenu = false;
     bool                 m_canShowVideoPIP = false;
@@ -288,12 +288,12 @@ protected:
     QUrl                 m_dialogFilepath; /* Last path used in dialogs */
 
     /* States */
-    bool                 playlistVisible;       ///< Is the playlist visible ?
-    double               playlistWidthFactor;   ///< playlist size: root.width / playlistScaleFactor
+    bool                 playlistVisible = false;       ///< Is the playlist visible ?
+    double               playlistWidthFactor = 4.;   ///< playlist size: root.width / playlistScaleFactor
 
-    VLCVarChoiceModel* m_extraInterfaces;
+    VLCVarChoiceModel* m_extraInterfaces = nullptr;
 
-    ControlbarProfileModel* m_controlbarProfileModel;
+    ControlbarProfileModel* m_controlbarProfileModel = nullptr;
 
     bool m_useAcrylicBackground = true;
     bool m_hasAcrylicSurface = false;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/64ff40e2d6e8712547b8db827c59b404cbc9d503...93cf0b18e09fdf2294fd03438f878df0ef95048e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/64ff40e2d6e8712547b8db827c59b404cbc9d503...93cf0b18e09fdf2294fd03438f878df0ef95048e
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list