VirtualBox

Ignore:
Timestamp:
May 4, 2016 3:29:56 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​bugref:6769: Rework for New VM wizard (part 01): 1. Use the normalized machine base-name instead of user's machine name; 2. Small cleanup simplifying further changes.

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

Legend:

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

    r60362 r60837  
    104104        if (!m_strGroup.isEmpty())
    105105            groups << m_strGroup;
    106         m_machine = vbox.CreateMachine(QString(), field("name").toString(), groups, strTypeId, QString::null);
     106        m_machine = vbox.CreateMachine(QString() /* no file-path for now */,
     107                                       field("machineBaseName").toString(),
     108                                       groups, strTypeId, QString());
    107109        if (!vbox.isOk())
    108110        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r58958 r60837  
    220220    /* Get VBox: */
    221221    CVirtualBox vbox = vboxGlobal().virtualBox();
    222     /* Get default machines directory: */
    223     QString strDefaultMachinesFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
     222    /* Get default machine folder: */
     223    const QString strDefaultMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
    224224    /* Compose machine filename: */
    225     QString strMachineFilename = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(), m_strGroup, QString::null, strDefaultMachinesFolder);
     225    const QString strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
     226                                                                   m_strGroup,
     227                                                                   QString(),
     228                                                                   strDefaultMachineFolder);
    226229    /* Compose machine folder/basename: */
    227     QFileInfo fileInfo(strMachineFilename);
    228     QString strMachineFolder = fileInfo.absolutePath();
    229     QString strMachineBaseName = fileInfo.completeBaseName();
     230    const QFileInfo fileInfo(strMachineFilePath);
     231    const QString strMachineFolder = fileInfo.absolutePath();
     232    const QString strMachineBaseName = fileInfo.completeBaseName();
    230233
    231234    /* Make sure that folder doesn't exists: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r55401 r60837  
    4343    bool cleanupMachineFolder();
    4444
    45     /* Stuff for 'machineFolder' field: */
     45    /** Returns the machine folder value. */
    4646    QString machineFolder() const { return m_strMachineFolder; }
     47    /** Defines the @a strMachineFolder value. */
    4748    void setMachineFolder(const QString &strMachineFolder) { m_strMachineFolder = strMachineFolder; }
    4849
    49     /* Stuff for 'machineBaseName' field: */
     50    /** Returns the machine base-name value. */
    5051    QString machineBaseName() const { return m_strMachineBaseName; }
     52    /** Defines the @a strMachineBaseName value. */
    5153    void setMachineBaseName(const QString &strMachineBaseName) { m_strMachineBaseName = strMachineBaseName; }
    5254
    53     /* Variables: */
     55    /** Holds the machine folder value. */
    5456    QString m_strMachineFolder;
     57    /** Holds the machine base-name value. */
    5558    QString m_strMachineBaseName;
    5659
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