VirtualBox

Changeset 91336 in vbox


Ignore:
Timestamp:
Sep 22, 2021 7:46:54 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: A bit of refactoring for Add/New Cloud VM wizards; Some optimization.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp

    r91335 r91336  
    5454    AssertPtrReturnVoid(pParent);
    5555
    56     /* Block signals while updating: */
    57     pCombo->blockSignals(true);
    58 
    5956    /* Remember current item data to be able to restore it: */
    6057    QString strOldData;
    6158    if (pCombo->currentIndex() != -1)
    62         strOldData = pCombo->itemData(pCombo->currentIndex(), ProviderData_ShortName).toString();
     59        strOldData = pCombo->currentData(ProviderData_ShortName).toString();
    6360    /* Otherwise "OCI" should be the default one: */
    6461    else
    6562        strOldData = "OCI";
     63
     64    /* Block signals while updating: */
     65    pCombo->blockSignals(true);
    6666
    6767    /* Clear combo initially: */
     
    117117    AssertReturnVoid(comProvider.isNotNull());
    118118
    119     /* Block signals while updating: */
    120     pCombo->blockSignals(true);
    121 
    122119    /* Remember current item data to be able to restore it: */
    123120    QString strOldData;
    124121    if (pCombo->currentIndex() != -1)
    125         strOldData = pCombo->itemData(pCombo->currentIndex(), ProfileData_Name).toString();
     122        strOldData = pCombo->currentData(ProfileData_Name).toString();
    126123    else if (!strProfileName.isEmpty())
    127124        strOldData = strProfileName;
     125
     126    /* Block signals while updating: */
     127    pCombo->blockSignals(true);
    128128
    129129    /* Clear combo initially: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp

    r91335 r91336  
    5757    AssertPtrReturnVoid(pParent);
    5858
    59     /* Block signals while updating: */
    60     pCombo->blockSignals(true);
    61 
    6259    /* Remember current item data to be able to restore it: */
    6360    QString strOldData;
    6461    if (pCombo->currentIndex() != -1)
    65         strOldData = pCombo->itemData(pCombo->currentIndex(), ProviderData_ShortName).toString();
     62        strOldData = pCombo->currentData(ProviderData_ShortName).toString();
    6663    /* Otherwise "OCI" should be the default one: */
    6764    else
    6865        strOldData = "OCI";
     66
     67    /* Block signals while updating: */
     68    pCombo->blockSignals(true);
    6969
    7070    /* Clear combo initially: */
     
    120120    AssertReturnVoid(comProvider.isNotNull());
    121121
    122     /* Block signals while updating: */
    123     pCombo->blockSignals(true);
    124 
    125122    /* Remember current item data to be able to restore it: */
    126123    QString strOldData;
    127124    if (pCombo->currentIndex() != -1)
    128         strOldData = pCombo->itemData(pCombo->currentIndex(), ProfileData_Name).toString();
     125        strOldData = pCombo->currentData(ProfileData_Name).toString();
    129126    else if (!strProfileName.isEmpty())
    130127        strOldData = strProfileName;
     128
     129    /* Block signals while updating: */
     130    pCombo->blockSignals(true);
    131131
    132132    /* Clear combo initially: */
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