VirtualBox

Changeset 66377 in vbox


Ignore:
Timestamp:
Mar 31, 2017 10:54:32 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Machine settings: Shared Folders page: Folder names should be unique among both folder types, not just among each of them.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp

    r66345 r66377  
    751751}
    752752
    753 SFoldersNameList UIMachineSettingsSF::usedList(bool fIncludeSelected)
     753QStringList UIMachineSettingsSF::usedList(bool fIncludeSelected)
    754754{
    755755    /* Make the used names list: */
    756     SFoldersNameList list;
     756    QStringList list;
    757757    QTreeWidgetItemIterator it(mTwFolders);
    758758    while (*it)
    759759    {
    760760        if ((*it)->parent() && (fIncludeSelected || !(*it)->isSelected()))
    761         {
    762             SFTreeViewItem *pItem = static_cast <SFTreeViewItem*>(*it);
    763             UISharedFolderType type = (UISharedFolderType)pItem->parentItem()->text(1).toInt();
    764             list << qMakePair(pItem->getText(0), type);
    765         }
     761            list << static_cast<SFTreeViewItem*>(*it)->getText(0);
    766762        ++it;
    767763    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h

    r66345 r66377  
    3333typedef UISettingsCache<UIDataSettingsSharedFolder> UISettingsCacheSharedFolder;
    3434typedef UISettingsCachePool<UIDataSettingsSharedFolders, UISettingsCacheSharedFolder> UISettingsCacheSharedFolders;
    35 typedef QPair<QString, UISharedFolderType> SFolderName;
    36 typedef QList<SFolderName> SFoldersNameList;
    3735
    3836
     
    121119    /** Returns the tree-view root item for corresponding shared folder @a type. */
    122120    SFTreeViewItem *root(UISharedFolderType type);
    123     /** Returns a list of used shared folder names paired with their types. */
    124     SFoldersNameList usedList(bool aIncludeSelected);
     121    /** Returns a list of used shared folder names. */
     122    QStringList usedList(bool fIncludeSelected);
    125123
    126124    /** Returns whether the corresponding @a sharedFolderType supported. */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp

    r62493 r66377  
    3333UIMachineSettingsSFDetails::UIMachineSettingsSFDetails(DialogType type,
    3434                                                       bool fEnableSelector, /* for "permanent" checkbox */
    35                                                        const SFoldersNameList &usedNames,
     35                                                       const QStringList &usedNames,
    3636                                                       QWidget *pParent /* = 0 */)
    3737   : QIWithRetranslateUI2<QIDialog>(pParent)
     
    140140void UIMachineSettingsSFDetails::sltValidate()
    141141{
    142     UISharedFolderType resultType = m_fUsePermanent && !mCbPermanent->isChecked() ? ConsoleType : MachineType;
    143     SFolderName pair = qMakePair(mLeName->text(), resultType);
    144 
    145142    mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!mPsPath->path().isEmpty() &&
    146143                                                         QDir(mPsPath->path()).exists() &&
    147144                                                         !mLeName->text().trimmed().isEmpty() &&
    148145                                                         !mLeName->text().contains(" ") &&
    149                                                          !m_usedNames.contains (pair));
     146                                                         !m_usedNames.contains(mLeName->text()));
    150147}
    151148
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h

    r62493 r66377  
    4141    UIMachineSettingsSFDetails(DialogType type,
    4242                               bool fEnableSelector, /* for "permanent" checkbox */
    43                                const SFoldersNameList &usedNames,
     43                               const QStringList &usedNames,
    4444                               QWidget *pParent = 0);
    4545
     
    7070private:
    7171
    72     DialogType       m_type;
    73     bool             m_fUsePermanent;
    74     SFoldersNameList m_usedNames;
     72    DialogType   m_type;
     73    bool         m_fUsePermanent;
     74    QStringList m_usedNames;
    7575};
    7676
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