VirtualBox

Changeset 102812 in vbox for trunk


Ignore:
Timestamp:
Jan 10, 2024 11:43:56 AM (13 months ago)
Author:
vboxsync
Message:

FE/Qt: More cleanup for UITools; Move model connections to appropriate place from model to parent.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.cpp

    r102811 r102812  
    146146    connect(m_pToolsModel, &UIToolsModel::sigClose,
    147147            this, &UITools::close);
     148    connect(m_pToolsModel, &UIToolsModel::sigSelectionChanged,
     149            this, &UITools::sigSelectionChanged);
     150    connect(m_pToolsModel, &UIToolsModel::sigExpandingStarted,
     151            this, &UITools::sigExpandingStarted);
     152    connect(m_pToolsModel, &UIToolsModel::sigExpandingFinished,
     153            this, &UITools::sigExpandingFinished);
    148154    connect(m_pToolsModel, &UIToolsModel::sigItemMinimumWidthHintChanged,
    149155            m_pToolsView, &UIToolsView::sltMinimumWidthHintChanged);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r102811 r102812  
    449449    /* Prepare handlers: */
    450450    prepareHandlers();
    451     /* Prepare connections: */
    452     prepareConnections();
    453451    /* Apply language settings: */
    454452    retranslateUi();
     
    539537    m_pMouseHandler = new UIToolsHandlerMouse(this);
    540538    m_pKeyboardHandler = new UIToolsHandlerKeyboard(this);
    541 }
    542 
    543 void UIToolsModel::prepareConnections()
    544 {
    545     AssertPtrReturnVoid(m_pTools);
    546     {
    547         /* Setup parent connections: */
    548         connect(this, &UIToolsModel::sigSelectionChanged,
    549                 m_pTools, &UITools::sigSelectionChanged);
    550         connect(this, &UIToolsModel::sigExpandingStarted,
    551                 m_pTools, &UITools::sigExpandingStarted);
    552         connect(this, &UIToolsModel::sigExpandingFinished,
    553                 m_pTools, &UITools::sigExpandingFinished);
    554     }
    555539}
    556540
     
    604588}
    605589
    606 void UIToolsModel::cleanupConnections()
    607 {
    608     /* Disconnect selection-changed signal prematurelly: */
    609     disconnect(this, &UIToolsModel::sigSelectionChanged,
    610                m_pTools, &UITools::sigSelectionChanged);
    611 }
    612 
    613590void UIToolsModel::cleanupHandlers()
    614591{
     
    634611void UIToolsModel::cleanup()
    635612{
    636     /* Cleanup connections: */
    637     cleanupConnections();
    638613    /* Cleanup handlers: */
    639614    cleanupHandlers();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h

    r102811 r102812  
    228228        /** Prepares handlers. */
    229229        void prepareHandlers();
    230         /** Prepares connections. */
    231         void prepareConnections();
    232230        /** Loads settings. */
    233231        void loadSettings();
     
    236234        static void loadLastToolTypes(UIToolType &enmTypeGlobal, UIToolType &enmTypeMachine);
    237235
    238         /** Cleanups connections. */
    239         void cleanupConnections();
    240         /** Cleanups connections. */
     236        /** Cleanups handlers. */
    241237        void cleanupHandlers();
    242238        /** Cleanups items. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette