Changeset 101379 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Oct 6, 2023 8:45:30 AM (19 months ago)
- svn:sync-xref-src-repo-rev:
- 159382
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r101344 r101379 6881 6881 6882 6882 /** 6883 * Static function to convert a guest OS type ID suffix.6884 * 6885 * @param strOsTypeGuest OS type ID to convert.6886 * @param pszToReplaceSuffix to replace.6887 * @param pszReplacementWhat to replace the suffix with.6883 * Worker function that converts the suffix of a guest OS type ID. 6884 * 6885 * @param a_rstrOsType Guest OS type ID to convert. 6886 * @param a_pszToReplace Suffix to replace. 6887 * @param a_pszReplacement What to replace the suffix with. 6888 6888 */ 6889 6889 /* static */ 6890 void MachineConfigFile::convertGuestOSTypeSuffix(com::Utf8Str &strOsType, const char *pszToReplace, const char *pszReplacement) 6891 { 6892 size_t const cchToReplace = strlen(pszToReplace); 6893 if (strOsType.endsWith(pszToReplace, cchToReplace)) 6894 strOsType.replace(strOsType.length() - cchToReplace, cchToReplace, pszReplacement); 6895 } 6890 void MachineConfigFile::convertGuestOSTypeSuffix(com::Utf8Str &a_rstrOsType, 6891 const char *a_pszToReplace, const char *a_pszReplacement) 6892 { 6893 size_t const cchToReplace = strlen(a_pszToReplace); 6894 if (a_rstrOsType.endsWith(a_pszToReplace, cchToReplace)) 6895 a_rstrOsType.replace(a_rstrOsType.length() - cchToReplace, cchToReplace, a_pszReplacement); 6896 } 6897 6898 #ifdef GUEST_OS_ID_STYLE_PARTIAL_CLEANUP 6896 6899 6897 6900 /** … … 6926 6929 convertGuestOSTypeSuffix(str, "_x64", "_64"); 6927 6930 } 6931 6932 #else /* !GUEST_OS_ID_STYLE_PARTIAL_CLEANUP */ 6933 6934 /** 6935 * Undoes effects of the 'OSTYPEID_64' to 'OSTYPEID_x64' renaming attempt from 6936 * the VBox v7.1 development cycle on @a a_rstrOsType. 6937 * 6938 * @see @bugref{10384#c18} 6939 */ 6940 /* static */ 6941 void MachineConfigFile::convertGuestOSTypeFromDev1_20(Utf8Str &a_rstrOsType) 6942 { 6943 convertGuestOSTypeSuffix(a_rstrOsType, "_x64", "_64"); 6944 } 6945 6946 #endif /* !GUEST_OS_ID_STYLE_PARTIAL_CLEANUP */ 6947 6928 6948 6929 6949 /** … … 6948 6968 if (m->sv < SettingsVersion_v1_5) 6949 6969 convertGuestOSTypeFromPre1_5(machineUserData.strOsType); 6970 #ifdef GUEST_OS_ID_STYLE_PARTIAL_CLEANUP 6950 6971 if (m->sv <= SettingsVersion_v1_19) 6951 6972 convertGuestOSTypeFromPre1_20(machineUserData.strOsType); 6952 6973 #else 6974 if (m->sv == SettingsVersion_v1_20) 6975 convertGuestOSTypeFromDev1_20(machineUserData.strOsType); 6976 #endif 6953 6977 elmMachine.getAttributeValue("stateKeyId", strStateKeyId); 6954 6978 elmMachine.getAttributeValue("stateKeyStore", strStateKeyStore); … … 9118 9142 elmMachine.createChild("Description")->addContent(machineUserData.strDescription); 9119 9143 9144 #ifdef GUEST_OS_ID_STYLE_PARTIAL_CLEANUP 9120 9145 com::Utf8Str strOsType = machineUserData.strOsType; 9121 9146 if (m->sv < SettingsVersion_v1_20) 9122 9147 convertGuestOSTypeToPre1_20(strOsType); 9123 /* else use the unmodified guest OS type ID. */9124 9148 elmMachine.setAttribute("OSType", strOsType); 9149 #else 9150 elmMachine.setAttribute("OSType", machineUserData.strOsType); 9151 #endif 9125 9152 9126 9153 if (m->sv >= SettingsVersion_v1_19)
Note:
See TracChangeset
for help on using the changeset viewer.