VirtualBox

Changeset 86606 in vbox


Ignore:
Timestamp:
Oct 16, 2020 1:55:09 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Small code refactoring for Chooser pane, registration stuff.

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

Legend:

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

    r86605 r86606  
    691691}
    692692
    693 void UIChooserAbstractModel::sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
    694                                                        const CCloudMachine &comMachine, bool fSelect)
     693void UIChooserAbstractModel::sltCloudMachineRegistered(const QString &strProviderShortName,
     694                                                       const QString &strProfileName,
     695                                                       const CCloudMachine &comMachine,
     696                                                       bool fSelect)
    695697{
    696698    /* Search for profile node: */
     
    698700    QList<UIChooserNode*> profileNodes;
    699701    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
    700     AssertReturnVoid(!profileNodes.isEmpty());
    701     UIChooserNode *pProfileNode = profileNodes.first();
    702     AssertPtrReturnVoid(pProfileNode);
     702    UIChooserNode *pProfileNode = profileNodes.value(0);
     703    if (!pProfileNode)
     704        return;
    703705
    704706    /* Add new machine-item: */
     
    712714}
    713715
    714 void UIChooserAbstractModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName, const QString &strProfileName,
    715                                                                 const QUuid &uMachineId, const bool fRegistered)
     716void UIChooserAbstractModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName,
     717                                                                const QString &strProfileName,
     718                                                                const QUuid &uMachineId,
     719                                                                const bool fRegistered)
    716720{
    717721    /* Search for profile node: */
     
    719723    QList<UIChooserNode*> profileNodes;
    720724    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
    721     AssertReturnVoid(!profileNodes.isEmpty());
    722     UIChooserNode *pProfileNode = profileNodes.first();
    723     AssertPtrReturnVoid(pProfileNode);
     725    UIChooserNode *pProfileNode = profileNodes.value(0);
     726    if (!pProfileNode)
     727        return;
    724728
    725729    /* Existing VM unregistered? */
     
    759763    if (pTask->type() != UITask::Type_CloudListMachines)
    760764        return;
    761 
    762     /* Cast task to corresponding sub-class: */
    763765    UITaskCloudListMachines *pAcquiringTask = qobject_cast<UITaskCloudListMachines*>(pTask);
    764766    AssertPtrReturnVoid(pAcquiringTask);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r86605 r86606  
    168168          * @param  strProfileName        Brings profile name.
    169169          * @param  fSelect               Brings whether registered machine should be selected. */
    170         virtual void sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
    171                                                const CCloudMachine &comMachine, bool fSelect);
     170        virtual void sltCloudMachineRegistered(const QString &strProviderShortName,
     171                                               const QString &strProfileName,
     172                                               const CCloudMachine &comMachine,
     173                                               bool fSelect);
    172174        /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId.
    173175          * @param  strProviderShortName  Brings provider short name.
    174176          * @param  strProfileName        Brings profile name. */
    175         virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName, const QString &strProfileName,
    176                                                         const QUuid &uMachineId, const bool fRegistered);
     177        virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName,
     178                                                        const QString &strProfileName,
     179                                                        const QUuid &uMachineId,
     180                                                        const bool fRegistered);
    177181
    178182        /** Handles list cloud machines task complete signal. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r86605 r86606  
    11541154}
    11551155
    1156 void UIChooserModel::sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
    1157                                                const CCloudMachine &comMachine, bool fSelect)
     1156void UIChooserModel::sltCloudMachineRegistered(const QString &strProviderShortName,
     1157                                               const QString &strProfileName,
     1158                                               const CCloudMachine &comMachine,
     1159                                               bool fSelect)
    11581160{
    11591161    /* Call to base-class: */
     
    11741176}
    11751177
    1176 void UIChooserModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName, const QString &strProfileName,
    1177                                                         const QUuid &uMachineId, const bool fRegistered)
     1178void UIChooserModel::sltCloudMachineRegistrationChanged(const QString &strProviderShortName,
     1179                                                        const QString &strProfileName,
     1180                                                        const QUuid &uMachineId,
     1181                                                        const bool fRegistered)
    11781182{
    11791183    /* Existing VM unregistered => make sure no item with passed uMachineId is selected: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r86605 r86606  
    280280          * @param  strProfileName        Brings profile name.
    281281          * @param  fSelect               Brings whether registered machine should be selected. */
    282         virtual void sltCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
    283                                                const CCloudMachine &comMachine, bool fSelect);
     282        virtual void sltCloudMachineRegistered(const QString &strProviderShortName,
     283                                               const QString &strProfileName,
     284                                               const CCloudMachine &comMachine,
     285                                               bool fSelect) /* override */;
    284286        /** Handles cloud machine registering/unregistering for machine with certain @a uMachineId.
    285287          * @param  strProviderShortName  Brings provider short name.
    286288          * @param  strProfileName        Brings profile name. */
    287         virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName, const QString &strProfileName,
    288                                                         const QUuid &uMachineId, const bool fRegistered) /* override */;
     289        virtual void sltCloudMachineRegistrationChanged(const QString &strProviderShortName,
     290                                                        const QString &strProfileName,
     291                                                        const QUuid &uMachineId,
     292                                                        const bool fRegistered) /* override */;
    289293
    290294        /** Handles list cloud machines task complete signal. */
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