VirtualBox

Changeset 86788 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 2, 2020 6:40:54 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: A bit of cleanup for prepare/cleanup cascade.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r86787 r86788  
    353353*********************************************************************************************************************************/
    354354
    355 UIChooserAbstractModel:: UIChooserAbstractModel(UIChooser *pParent)
     355UIChooserAbstractModel::UIChooserAbstractModel(UIChooser *pParent)
    356356    : QObject(pParent)
    357357    , m_pParent(pParent)
     
    359359{
    360360    prepare();
     361}
     362
     363UIChooserAbstractModel::~UIChooserAbstractModel()
     364{
     365    cleanup();
    361366}
    362367
     
    948953            this, &UIChooserAbstractModel::sltCloudMachineRegistered);
    949954
    950     /* Setup global connections: */
     955    /* Global connections: */
    951956    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
    952957            this, &UIChooserAbstractModel::sltLocalMachineStateChanged);
     
    974979            this, &UIChooserAbstractModel::sltHandleCloudProviderUninstall);
    975980
    976     /* Setup group saving connections: */
     981    /* Group saving connections: */
    977982    connect(this, &UIChooserAbstractModel::sigStartGroupSaving,
    978983            this, &UIChooserAbstractModel::sltStartGroupSaving,
    979984            Qt::QueuedConnection);
    980985
    981     /* Setup extra-data connections: */
     986    /* Extra-data connections: */
    982987    connect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange,
    983988            this, &UIChooserAbstractModel::sltHandleCloudProfileManagerCumulativeChange);
     989}
     990
     991void UIChooserAbstractModel::cleanupConnections()
     992{
     993    /* Cloud thread-pool connections: */
     994    disconnect(uiCommon().threadPoolCloud(), &UIThreadPool::sigTaskComplete,
     995               this, &UIChooserAbstractModel::sltHandleCloudListMachinesTaskComplete);
     996
     997    /* Cloud VM registration connections: */
     998    disconnect(&uiCommon(), &UICommon::sigCloudMachineUnregistered,
     999               this, &UIChooserAbstractModel::sltCloudMachineUnregistered);
     1000    disconnect(&uiCommon(), &UICommon::sigCloudMachineRegistered,
     1001               this, &UIChooserAbstractModel::sltCloudMachineRegistered);
     1002
     1003    /* Global connections: */
     1004    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
     1005               this, &UIChooserAbstractModel::sltLocalMachineStateChanged);
     1006    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange,
     1007               this, &UIChooserAbstractModel::sltLocalMachineDataChanged);
     1008    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered,
     1009               this, &UIChooserAbstractModel::sltLocalMachineRegistrationChanged);
     1010    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSessionStateChange,
     1011               this, &UIChooserAbstractModel::sltSessionStateChanged);
     1012    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotTake,
     1013               this, &UIChooserAbstractModel::sltSnapshotChanged);
     1014    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotDelete,
     1015               this, &UIChooserAbstractModel::sltSnapshotChanged);
     1016    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotChange,
     1017               this, &UIChooserAbstractModel::sltSnapshotChanged);
     1018    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore,
     1019               this, &UIChooserAbstractModel::sltSnapshotChanged);
     1020    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProviderListChanged,
     1021               this, &UIChooserAbstractModel::sltHandleCloudProfileManagerCumulativeChange);
     1022    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered,
     1023               this, &UIChooserAbstractModel::sltHandleCloudProfileManagerCumulativeChange);
     1024    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileChanged,
     1025               this, &UIChooserAbstractModel::sltHandleCloudProfileManagerCumulativeChange);
     1026    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProviderUninstall,
     1027               this, &UIChooserAbstractModel::sltHandleCloudProviderUninstall);
     1028
     1029    /* Group saving connections: */
     1030    disconnect(this, &UIChooserAbstractModel::sigStartGroupSaving,
     1031               this, &UIChooserAbstractModel::sltStartGroupSaving);
     1032
     1033    /* Extra-data connections: */
     1034    disconnect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange,
     1035               this, &UIChooserAbstractModel::sltHandleCloudProfileManagerCumulativeChange);
     1036}
     1037
     1038void UIChooserAbstractModel::cleanup()
     1039{
     1040    cleanupConnections();
    9841041}
    9851042
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r86787 r86788  
    7474    /** Constructs abstract Chooser-model passing @a pParent to the base-class. */
    7575    UIChooserAbstractModel(UIChooser *pParent);
     76    /** Destructs abstract Chooser-model. */
     77    virtual ~UIChooserAbstractModel() /* override */;
    7678
    7779    /** @name General stuff.
     
    247249        /** Prepares connections. */
    248250        void prepareConnections();
     251
     252        /** Cleanups connections. */
     253        void cleanupConnections();
     254        /** Cleanups all. */
     255        void cleanup();
    249256    /** @} */
    250257
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