VirtualBox

Changeset 101316 in vbox


Ignore:
Timestamp:
Sep 29, 2023 1:40:05 PM (12 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10523. Changing return type of UIGuestOSTypeManager::guestOSTypeManager.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r101315 r101316  
    317317    /** @name COM: Guest OS Type stuff.
    318318     * @{ */
    319         const UIGuestOSTypeManager *guestOSTypeManager() const { return m_pGuestOSTypeManager; }
    320         UIGuestOSTypeManager &guestOSTypeManager2() const { return *m_pGuestOSTypeManager; }
     319        const UIGuestOSTypeManager &guestOSTypeManager() const { return *m_pGuestOSTypeManager; }
    321320    /** @} */
    322321
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r101315 r101316  
    119119        const QString strAnchorType = QString("os_type");
    120120        const QString strOsTypeId = comMachine.GetOSTypeId();
    121         const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    122         QString strOsTypeDescription;
    123         if (pManager)
    124             strOsTypeDescription = pManager->getDescription(strOsTypeId);
    125121        table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"),
    126122                                 QString("<a href=#%1,%2>%3</a>")
    127123                                     .arg(strAnchorType,
    128124                                          strOsTypeId,
    129                                           strOsTypeDescription));
     125                                          uiCommon().guestOSTypeManager().getDescription(strOsTypeId)));
    130126    }
    131127
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r101315 r101316  
    848848    }
    849849
    850     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    851     AssertReturn(pManager, false);
    852 
    853     const KStorageBus enmRecommendedDvdBus = pManager->getRecommendedDVDStorageBus(osTypeId());
    854     const KStorageControllerType enmRecommendedDvdType = pManager->getRecommendedDVDStorageController(osTypeId());
     850    const KStorageBus enmRecommendedDvdBus = uiCommon().guestOSTypeManager().getRecommendedDVDStorageBus(osTypeId());
     851    const KStorageControllerType enmRecommendedDvdType = uiCommon().guestOSTypeManager().getRecommendedDVDStorageController(osTypeId());
    855852
    856853    /* Search for an attachment of required bus & type: */
     
    13051302
    13061303    /* Auto GA update is currently for Windows and Linux guests only */
    1307     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    1308     AssertReturn(pManager, false);
    1309 
    1310     bool fIsWindowOrLinux = pManager->isLinux(uimachine()->osTypeId()) || pManager->isWindows(uimachine()->osTypeId());
     1304    bool fIsWindowOrLinux = uiCommon().guestOSTypeManager().isLinux(uimachine()->osTypeId())
     1305                         || uiCommon().guestOSTypeManager().isWindows(uimachine()->osTypeId());
    13111306
    13121307    if (!fIsWindowOrLinux)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r101315 r101316  
    352352    else
    353353    {
    354         const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    355         if (pManager)
    356             strOSType = pManager->getDescription(strOSType);
     354        strOSType = uiCommon().guestOSTypeManager().getDescription(strOSType);
    357355    }
    358356   updateInfoRow(InfoRow_GuestOSType, QString("%1").arg(m_strGuestOSTypeLabel), strOSType);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r101294 r101316  
    164164    AssertReturn(m_pComboFamily, false);
    165165
    166     const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    167     AssertReturn(pGuestOSTypeManager, false);
    168     // const UIGuestOSType &type = pGuestOSTypeManager->findGuestTypeById(strTypeId);
    169     // if (!type.isOk())
    170     //     return false;
    171 
    172166    int iFamilyComboIndex = -1;
    173167    /* We already have to have an item in the family combo box for this family id: */
     
    175169    {
    176170        QString strComboFamilyId = m_pComboFamily->itemData(i, FamilyID).toString();
    177         if (!strComboFamilyId.isEmpty() && strComboFamilyId == pGuestOSTypeManager->getFamilyId(strTypeId))
     171        if (!strComboFamilyId.isEmpty() && strComboFamilyId == uiCommon().guestOSTypeManager().getFamilyId(strTypeId))
    178172            iFamilyComboIndex = i;
    179173    }
     
    185179
    186180    /* If variant is not empty then try to select correct index. This will populate type combo: */
    187     QString strVariant = pGuestOSTypeManager->getVariant(strTypeId);
     181    QString strVariant = uiCommon().guestOSTypeManager().getVariant(strTypeId);
    188182    if (!strVariant.isEmpty())
    189183    {
     
    314308    AssertReturnVoid(m_pComboFamily);
    315309    AssertReturnVoid(m_pComboVariant);
    316     const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    317     AssertReturnVoid(pGuestOSTypeManager);
    318310
    319311    m_strFamilyId = m_pComboFamily->itemData(index, FamilyID).toString();
     
    327319    m_pComboVariant->clear();
    328320
    329     const QStringList variantList = pGuestOSTypeManager->getVariantListForFamilyId(m_strFamilyId);
     321    const QStringList variantList = uiCommon().guestOSTypeManager().getVariantListForFamilyId(m_strFamilyId);
    330322
    331323    if (variantList.isEmpty())
     
    334326        m_pLabelVariant->setEnabled(false);
    335327        /* If variant list is empty the all the types of the family are added to typ selection combo: */
    336         populateTypeCombo(pGuestOSTypeManager->getTypeListForFamilyId(m_strFamilyId));
     328        populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForFamilyId(m_strFamilyId));
    337329    }
    338330    else
     
    350342            m_pComboVariant->setCurrentIndex(iOracleIndex);
    351343
    352         populateTypeCombo(pGuestOSTypeManager->getTypeListForVariant(m_pComboVariant->currentText()));
     344        populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForVariant(m_pComboVariant->currentText()));
    353345    }
    354346    m_pComboVariant->blockSignals(false);
     
    360352void UINameAndSystemEditor::sltVariantChanged(const QString &strVariant)
    361353{
    362     const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    363     AssertReturnVoid(pGuestOSTypeManager);
    364354    m_strVariant = strVariant;
    365     populateTypeCombo(pGuestOSTypeManager->getTypeListForVariant(strVariant));
     355    populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForVariant(strVariant));
    366356}
    367357
     
    650640    AssertPtrReturnVoid(m_pComboFamily);
    651641
    652     const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    653     AssertPtrReturnVoid(pGuestOSTypeManager);
    654 
    655642    /* Acquire family IDs: */
    656     const UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo &families = pGuestOSTypeManager->getFamilies();
     643    const UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo &families = uiCommon().guestOSTypeManager().getFamilies();
    657644
    658645    /* For each known family ID: */
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp

    r101315 r101316  
    12971297            /* Operating System: */
    12981298            ++iRowCount;
    1299             const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    1300             if (pManager)
    1301                 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Operating System", "details (general)"),
    1302                                                          empReport(pManager->getDescription(comMachine.GetOSTypeId()),
    1303                                                                    pManager->getDescription(comMachineOld.GetOSTypeId())));
     1299            strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Operating System", "details (general)"),
     1300                                                     empReport(uiCommon().guestOSTypeManager().getDescription(comMachine.GetOSTypeId()),
     1301                                                               uiCommon().guestOSTypeManager().getDescription(comMachineOld.GetOSTypeId())));
    13041302
    13051303            /* Location of the settings file: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r101315 r101316  
    538538                        value = strTmp; break;
    539539                    }
    540                     case KVirtualSystemDescriptionType_OS:
    541                     {
    542                         const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    543                         if (pManager)
    544                             value = pManager->getDescription(m_strConfigValue);
    545                         break;
    546                     }
     540                    case KVirtualSystemDescriptionType_OS:               value = uiCommon().guestOSTypeManager().getDescription(m_strConfigValue); break;
    547541                    case KVirtualSystemDescriptionType_Memory:           value = m_strConfigValue + " " + UICommon::tr("MB", "size suffix MBytes=1024 KBytes"); break;
    548542                    case KVirtualSystemDescriptionType_SoundCard:        value = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.cpp

    r101285 r101316  
    8181    if (m_strOSTypeId == strOSTypeId)
    8282        return;
    83     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    84     AssertReturnVoid(pManager);
    85 
    8683    m_strOSTypeId = strOSTypeId;
    8784
     
    9188#endif
    9289
    93     setText(pManager->getDescription(m_strOSTypeId));
     90    setText(uiCommon().guestOSTypeManager().getDescription(m_strOSTypeId));
    9491}
    9592
     
    116113    m_pMainMenu->clear();
    117114
    118     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    119     AssertReturnVoid(pManager);
    120     UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo familyList = pManager->getFamilies();
     115    UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo familyList = uiCommon().guestOSTypeManager().getFamilies();
    121116
    122117    for (int i = 0; i < familyList.size(); ++i)
     
    124119        const QPair<QString, QString> &familyInfo = familyList[i];
    125120        QMenu *pSubMenu = m_pMainMenu->addMenu(familyInfo.second);
    126         QStringList variantList = pManager->getVariantListForFamilyId(familyInfo.first);
     121        QStringList variantList = uiCommon().guestOSTypeManager().getVariantListForFamilyId(familyInfo.first);
    127122
    128123        if (variantList.isEmpty())
    129             createOSTypeMenu(pManager->getTypeListForFamilyId(familyInfo.first), pSubMenu);
     124            createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForFamilyId(familyInfo.first), pSubMenu);
    130125        else
    131126        {
    132127            foreach (const QString &strVariant, variantList)
    133                 createOSTypeMenu(pManager->getTypeListForVariant(strVariant), pSubMenu->addMenu(strVariant));
     128                createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForVariant(strVariant), pSubMenu->addMenu(strVariant));
    134129        }
    135130    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r101278 r101316  
    9393    setPixmapName(":/wizard_new_welcome_bg.png");
    9494#endif /* VBOX_WS_MAC */
    95     /* Register classes: */
    96     qRegisterMetaType<CGuestOSType>();
    97 
    9895    connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel);
    9996
     
    279276    QUuid uMachineId = m_machine.GetId();
    280277    CSession session = uiCommon().openSession(uMachineId);
    281     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    282     if (!session.isNull() && pManager)
     278    if (!session.isNull())
    283279    {
    284280        CMachine machine = session.GetMachine();
    285281        if (!m_virtualDisk.isNull())
    286282        {
    287             KStorageBus enmHDDBus = pManager->getRecommendedHDStorageBus(m_guestOSTypeId);
     283            KStorageBus enmHDDBus = uiCommon().guestOSTypeManager().getRecommendedHDStorageBus(m_guestOSTypeId);
    288284            CStorageController comHDDController = m_machine.GetStorageControllerByInstance(enmHDDBus, 0);
    289285            if (!comHDDController.isNull())
     
    297293
    298294        /* Attach optical drive: */
    299         KStorageBus enmDVDBus = pManager->getRecommendedDVDStorageBus(m_guestOSTypeId);
     295        KStorageBus enmDVDBus = uiCommon().guestOSTypeManager().getRecommendedDVDStorageBus(m_guestOSTypeId);
    300296        CStorageController comDVDController = m_machine.GetStorageControllerByInstance(enmDVDBus, 0);
    301297        if (!comDVDController.isNull())
     
    318314
    319315        /* Attach an empty floppy drive if recommended */
    320         if (pManager->getRecommendedFloppy(m_guestOSTypeId))
     316        if (uiCommon().guestOSTypeManager().getRecommendedFloppy(m_guestOSTypeId))
    321317        {
    322318            CStorageController comFloppyController = m_machine.GetStorageControllerByInstance(KStorageBus_Floppy, 0);
     
    795791QString UIWizardNewVM::getGuestOSTypeDescription() const
    796792{
    797     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    798     if (!pManager)
    799         return QString();
    800     return pManager->getDescription(m_guestOSTypeId);
     793    return uiCommon().guestOSTypeManager().getDescription(m_guestOSTypeId);
    801794}
    802795
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp

    r101278 r101316  
    265265
    266266    LONG64 iRecommendedSize = 0;
    267     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    268     if (pManager && !m_userModifiedParameters.contains("SelectedDiskSource"))
    269     {
    270         iRecommendedSize = pManager->getRecommendedHDD(pWizard->guestOSTypeId());
     267
     268    if (!m_userModifiedParameters.contains("SelectedDiskSource"))
     269    {
     270        iRecommendedSize = uiCommon().guestOSTypeManager().getRecommendedHDD(pWizard->guestOSTypeId());
    271271        if (iRecommendedSize != 0)
    272272        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r101272 r101316  
    343343{
    344344    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
    345     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    346345    AssertReturnVoid(pWizard);
    347     AssertReturnVoid(pManager);
    348346
    349347    QString strTypeId = pWizard->guestOSTypeId();
    350348    /* Get recommended 'ram' field value: */
    351     ULONG recommendedRam = pManager->getRecommendedRAM(strTypeId);
     349    ULONG recommendedRam = uiCommon().guestOSTypeManager().getRecommendedRAM(strTypeId);
    352350
    353351    if (m_pHardwareWidgetContainer)
     
    363361
    364362        /* Set Firmware Type of the widget and the wizard: */
    365         KFirmwareType fwType = pManager->getRecommendedFirmware(strTypeId);
     363        KFirmwareType fwType = uiCommon().guestOSTypeManager().getRecommendedFirmware(strTypeId);
    366364        if (!m_userModifiedParameters.contains("EFIEnabled"))
    367365        {
     
    371369
    372370        /* Initialize CPU count:*/
    373         int iCPUCount = pManager->getRecommendedCPUCount(strTypeId);
     371        int iCPUCount = uiCommon().guestOSTypeManager().getRecommendedCPUCount(strTypeId);
    374372        if (!m_userModifiedParameters.contains("CPUCount"))
    375373        {
     
    380378    }
    381379
    382     LONG64 iRecommendedDiskSize = pManager->getRecommendedHDD(strTypeId);
     380    LONG64 iRecommendedDiskSize = uiCommon().guestOSTypeManager().getRecommendedHDD(strTypeId);
    383381    /* Prepare initial disk choice: */
    384382    if (!m_userModifiedParameters.contains("SelectedDiskSource"))
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp

    r101278 r101316  
    8989
    9090    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
    91     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    92 
    93     if (pManager && pWizard && m_pHardwareWidgetContainer)
     91    if (pWizard && m_pHardwareWidgetContainer)
    9492    {
    9593        const QString &strTypeId = pWizard->guestOSTypeId();
     
    9896        if (!m_userModifiedParameters.contains("MemorySize"))
    9997        {
    100             ULONG recommendedRam = pManager->getRecommendedRAM(strTypeId);
     98            ULONG recommendedRam = uiCommon().guestOSTypeManager().getRecommendedRAM(strTypeId);
    10199            m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
    102100            pWizard->setMemorySize(recommendedRam);
     
    104102        if (!m_userModifiedParameters.contains("CPUCount"))
    105103        {
    106             ULONG recommendedCPUs = pManager->getRecommendedCPUCount(strTypeId);
     104            ULONG recommendedCPUs = uiCommon().guestOSTypeManager().getRecommendedCPUCount(strTypeId);
    107105            m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs);
    108106            pWizard->setCPUCount(recommendedCPUs);
     
    110108        if (!m_userModifiedParameters.contains("EFIEnabled"))
    111109        {
    112             KFirmwareType fwType = pManager->getRecommendedFirmware(strTypeId);
     110            KFirmwareType fwType = uiCommon().guestOSTypeManager().getRecommendedFirmware(strTypeId);
    113111            m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
    114112            pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp

    r101315 r101316  
    550550    else if (!pWizard->detectedOSTypeId().isEmpty())
    551551    {
    552         const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    553         QString strType;
    554         if (pManager)
    555             strType = pManager->getDescription(pWizard->detectedOSTypeId());
     552        QString strType = uiCommon().guestOSTypeManager().getDescription(pWizard->detectedOSTypeId());
    556553        if (!pWizard->isUnattendedInstallSupported())
    557554            strMessage = UIWizardNewVM::tr("Detected OS type: %1. %2")
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp

    r101278 r101316  
    355355    pNameRoot->addChild(UIWizardNewVM::tr("Machine Folder"), pWizard->machineFolder());
    356356    pNameRoot->addChild(UIWizardNewVM::tr("ISO Image"), pWizard->ISOFilePath());
    357     const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();
    358     if (pManager)
    359         pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pManager->getDescription(pWizard->guestOSTypeId()));
     357    pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), uiCommon().guestOSTypeManager().getDescription(pWizard->guestOSTypeId()));
    360358
    361359    const QString &ISOPath = pWizard->ISOFilePath();
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