VirtualBox

Changeset 90076 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 7, 2021 2:18:28 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145573
Message:

FE/Qt: bugref:9996. Some cleaning

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.cpp

    r90075 r90076  
    167167{
    168168    return m_mediumFormat;
    169 }
    170 
    171 QString UIWizardNewVMDiskPageBasic::mediumPath() const
    172 {
    173     return UIWizardNewVMDiskPage::absoluteFilePath(UIWizardNewVMDiskPage::toFileName(m_strDefaultName,
    174                                                                                      m_strDefaultExtension), m_strDefaultPath);
    175169}
    176170
     
    389383
    390384    /* We set the medium name and path according to machine name/path and do not allow user change these in the guided mode: */
    391     const QString &strDefaultName = pWizard->machineBaseName();
    392     m_strDefaultName = strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName;
    393     m_strDefaultPath = pWizard->machineFolder();
     385    QString strDefaultName = pWizard->machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : pWizard->machineBaseName();
     386    const QString &strMachineFolder = pWizard->machineFolder();
     387    QString strMediumPath = UIWizardNewVMDiskPage::absoluteFilePath(UIWizardNewVMDiskPage::toFileName(strDefaultName,
     388                                                                                                      m_strDefaultExtension),
     389                                                                    strMachineFolder);
     390    newVMWizardPropertySet(MediumPath, strMediumPath);
     391
    394392    /* Set the recommended disk size if user has already not done so: */
    395393    if (m_pMediumSizeEditor && !m_userModifiedParameters.contains("MediumSize"))
     
    398396        m_pMediumSizeEditor->setMediumSize(iRecommendedSize);
    399397        m_pMediumSizeEditor->blockSignals(false);
     398        newVMWizardPropertySet(MediumSize, iRecommendedSize);
    400399    }
    401400}
     
    444443    {
    445444        /* Check if the path we will be using for hard drive creation exists: */
    446         const QString strMediumPath(mediumPath());
     445        const QString &strMediumPath = pWizard->mediumPath();
    447446        fResult = !QFileInfo(strMediumPath).exists();
    448447        if (!fResult)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.h

    r90074 r90076  
    7979
    8080    UIWizardNewVMDiskPageBasic();
    81     /** For the guide wizard mode medium path, name and extention is static and we have
    82       * no UI element for this. thus override. */
    83     virtual QString mediumPath() const /*override */;
    8481    CMediumFormat mediumFormat() const;
    8582
     
    136133    SelectedDiskSource m_enmSelectedDiskSource;
    137134    bool m_fRecommendedNoDisk;
    138     QString m_strDefaultName;
    139     QString m_strDefaultPath;
     135
    140136    QString m_strDefaultExtension;
    141137    QSet<QString> m_userModifiedParameters;
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