VirtualBox

Changeset 101074 in vbox


Ignore:
Timestamp:
Sep 8, 2023 3:40:55 PM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159033
Message:

FE/Qt: bugref:10384: A bit of coding style and logic adjustments for r159023.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r101064 r101074  
    375375    if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration)
    376376    {
    377         CPlatform comPlatform                    = comMachine.GetPlatform();
    378         KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    379         switch (platformArch)
     377        const CPlatform comPlatform = comMachine.GetPlatform();
     378        switch (comPlatform.GetArchitecture())
    380379        {
    381380            case KPlatformArchitecture_x86:
     
    417416            }
    418417#endif
     418
    419419            default:
    420420                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r101072 r101074  
    746746            if (fSuccess)
    747747            {
    748                 // Must update long mode CPU feature bit when os type changed:
    749                 CVirtualBox vbox = uiCommon().virtualBox();
    750                 // Should we check global object getters?
    751                 const CGuestOSType &comNewType = vbox.GetGuestOSType(newGeneralData.m_strGuestOsTypeId);
    752 
    753                 CPlatform comPlatform                    = m_machine.GetPlatform();
    754                 KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    755                 switch (platformArch)
     748                /* Update long mode CPU feature bit when OS type changed: */
     749                const CPlatform comPlatform = m_machine.GetPlatform();
     750                switch (comPlatform.GetArchitecture())
    756751                {
    757752                    case KPlatformArchitecture_x86:
    758753                    {
    759754                        CPlatformX86 comPlatformX86 = comPlatform.GetX86();
     755                        const CGuestOSType &comNewType = uiCommon().virtualBox().GetGuestOSType(newGeneralData.m_strGuestOsTypeId);
    760756                        comPlatformX86.SetCPUProperty(KCPUPropertyTypeX86_LongMode, comNewType.GetIs64Bit());
    761757                        fSuccess = comPlatformX86.isOk();
     758                        /// @todo convey error info ..
    762759                        break;
    763760                    }
     
    772769                    }
    773770#endif
     771
    774772                    default:
    775773                        break;
    776774                }
    777                 /// @todo convey error info ..
    778775            }
    779776        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r101072 r101074  
    300300    oldSystemData.m_cCPUCount = oldSystemData.m_fSupportedHwVirtEx ? m_machine.GetCPUCount() : 1;
    301301    oldSystemData.m_iCPUExecCap = m_machine.GetCPUExecutionCap();
    302 
    303     KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    304     switch (platformArch)
     302    switch (comPlatform.GetArchitecture())
    305303    {
    306304        case KPlatformArchitecture_x86:
    307305        {
    308306            CPlatformX86 comPlatformX86 = comPlatform.GetX86();
    309 
    310307            oldSystemData.m_fEnabledPAE = comPlatformX86.GetCPUProperty(KCPUPropertyTypeX86_PAE);
    311308            oldSystemData.m_fEnabledNestedHwVirtEx = comPlatformX86.GetCPUProperty(KCPUPropertyTypeX86_HWVirt);
     
    313310            break;
    314311        }
    315 
    316312#ifdef VBOX_WITH_VIRT_ARMV8
    317313        case KPlatformArchitecture_ARM:
     
    10531049            fSuccess = m_machine.isOk();
    10541050        }
    1055 
    1056         CPlatform comPlatform                    = m_machine.GetPlatform();
    1057         KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    1058         switch (platformArch)
    1059         {
    1060             case KPlatformArchitecture_x86:
    1061             {
    1062                 CPlatformX86 comPlatformX86 = comPlatform.GetX86();
    1063 
    1064                 /* Save whether PAE is enabled: */
    1065                 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledPAE != oldSystemData.m_fEnabledPAE)
     1051        if (fSuccess)
     1052        {
     1053            const CPlatform comPlatform = m_machine.GetPlatform();
     1054            switch (comPlatform.GetArchitecture())
     1055            {
     1056                case KPlatformArchitecture_x86:
    10661057                {
    1067                     comPlatformX86.SetCPUProperty(KCPUPropertyTypeX86_PAE, newSystemData.m_fEnabledNestedPaging);
    1068                     fSuccess = comPlatformX86.isOk();
    1069                     /// @todo convey error info ..
     1058                    CPlatformX86 comPlatformX86 = comPlatform.GetX86();
     1059
     1060                    /* Save whether PAE is enabled: */
     1061                    if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledPAE != oldSystemData.m_fEnabledPAE)
     1062                    {
     1063                        comPlatformX86.SetCPUProperty(KCPUPropertyTypeX86_PAE, newSystemData.m_fEnabledNestedPaging);
     1064                        fSuccess = comPlatformX86.isOk();
     1065                        /// @todo convey error info ..
     1066                    }
     1067                    /* Save whether Nested HW Virt Ex is enabled: */
     1068                    if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedHwVirtEx != oldSystemData.m_fEnabledNestedHwVirtEx)
     1069                    {
     1070                        comPlatformX86.SetCPUProperty(KCPUPropertyTypeX86_HWVirt, newSystemData.m_fEnabledNestedPaging);
     1071                        fSuccess = comPlatformX86.isOk();
     1072                        /// @todo convey error info ..
     1073                    }
     1074
     1075                    break;
    10701076                }
    1071                 /* Save whether Nested HW Virt Ex is enabled: */
    1072                 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedHwVirtEx != oldSystemData.m_fEnabledNestedHwVirtEx)
     1077
     1078#ifdef VBOX_WITH_VIRT_ARMV8
     1079                case KPlatformArchitecture_ARM:
    10731080                {
    1074                     comPlatformX86.SetCPUProperty(KCPUPropertyTypeX86_HWVirt, newSystemData.m_fEnabledNestedPaging);
    1075                     fSuccess = comPlatformX86.isOk();
    1076                     /// @todo convey error info ..
     1081                    /** @todo BUGBUG ARM stuff goes here. */
     1082                    break;
    10771083                }
    1078 
    1079                 break;
    1080             }
    1081 
    1082 #ifdef VBOX_WITH_VIRT_ARMV8
    1083             case KPlatformArchitecture_ARM:
    1084             {
    1085                 /** @todo BUGBUG ARM stuff goes here. */
    1086                 break;
    1087             }
    10881084#endif
    1089             default:
    1090                 break;
    1091         }
    1092 
     1085
     1086                default:
     1087                    break;
     1088            }
     1089        }
    10931090        /* Save CPU execution cap: */
    10941091        if (fSuccess && newSystemData.m_iCPUExecCap != oldSystemData.m_iCPUExecCap)
     
    11281125            fSuccess = m_machine.isOk();
    11291126        }
    1130 
    1131         CPlatform comPlatform                     = m_machine.GetPlatform();
    1132         KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    1133         switch (platformArch)
    1134         {
    1135             case KPlatformArchitecture_x86:
    1136             {
    1137                 CPlatformX86 comPlatformX86 = comPlatform.GetX86();
    1138 
    1139                 /* Save whether the nested paging is enabled: */
    1140                 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedPaging != oldSystemData.m_fEnabledNestedPaging)
     1127        if (fSuccess)
     1128        {
     1129            const CPlatform comPlatform = m_machine.GetPlatform();
     1130            switch (comPlatform.GetArchitecture())
     1131            {
     1132                case KPlatformArchitecture_x86:
    11411133                {
    1142                     comPlatformX86.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, newSystemData.m_fEnabledNestedPaging);
    1143                     fSuccess = comPlatformX86.isOk();
    1144                     /// @todo convey error info ..
     1134                    CPlatformX86 comPlatformX86 = comPlatform.GetX86();
     1135
     1136                    /* Save whether the nested paging is enabled: */
     1137                    if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedPaging != oldSystemData.m_fEnabledNestedPaging)
     1138                    {
     1139                        comPlatformX86.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, newSystemData.m_fEnabledNestedPaging);
     1140                        fSuccess = comPlatformX86.isOk();
     1141                        /// @todo convey error info ..
     1142                    }
     1143
     1144                    break;
    11451145                }
    11461146
    1147                 break;
    1148             }
    1149 
    11501147#ifdef VBOX_WITH_VIRT_ARMV8
    1151             case KPlatformArchitecture_ARM:
    1152             {
    1153                 /** @todo BUGBUG ARM stuff goes here. */
    1154                 break;
    1155             }
     1148                case KPlatformArchitecture_ARM:
     1149                {
     1150                    /** @todo BUGBUG ARM stuff goes here. */
     1151                    break;
     1152                }
    11561153#endif
    1157             default:
    1158                 break;
    1159          }
     1154
     1155                default:
     1156                    break;
     1157             }
     1158        }
    11601159
    11611160         /* Show error message if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp

    r101064 r101074  
    17681768    /* Prepare report: */
    17691769    QStringList aReport;
    1770 
    1771     KPlatformArchitecture const platformArch = comPlatform.GetArchitecture();
    1772     switch (platformArch)
     1770    switch (comPlatform.GetArchitecture())
    17731771    {
    17741772        case KPlatformArchitecture_x86:
     
    17911789            if (comPlatformX86.GetCPUProperty(KCPUPropertyTypeX86_PAE))
    17921790                aReport << QApplication::translate("UIDetails", "PAE/NX", "details (system)");
     1791
    17931792            break;
    17941793        }
     
    18011800        }
    18021801#endif
     1802
    18031803        default:
    18041804            break;
    18051805    }
    1806 
    18071806    /* Paravirtualization Interface? */
    18081807    switch (comMachine.GetEffectiveParavirtProvider())
Note: See TracChangeset for help on using the changeset viewer.

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