Changeset 66377 in vbox
- Timestamp:
- Mar 31, 2017 10:54:32 AM (8 years ago)
- 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 751 751 } 752 752 753 SFoldersNameList UIMachineSettingsSF::usedList(bool fIncludeSelected)753 QStringList UIMachineSettingsSF::usedList(bool fIncludeSelected) 754 754 { 755 755 /* Make the used names list: */ 756 SFoldersNameList list;756 QStringList list; 757 757 QTreeWidgetItemIterator it(mTwFolders); 758 758 while (*it) 759 759 { 760 760 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); 766 762 ++it; 767 763 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h
r66345 r66377 33 33 typedef UISettingsCache<UIDataSettingsSharedFolder> UISettingsCacheSharedFolder; 34 34 typedef UISettingsCachePool<UIDataSettingsSharedFolders, UISettingsCacheSharedFolder> UISettingsCacheSharedFolders; 35 typedef QPair<QString, UISharedFolderType> SFolderName;36 typedef QList<SFolderName> SFoldersNameList;37 35 38 36 … … 121 119 /** Returns the tree-view root item for corresponding shared folder @a type. */ 122 120 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); 125 123 126 124 /** Returns whether the corresponding @a sharedFolderType supported. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp
r62493 r66377 33 33 UIMachineSettingsSFDetails::UIMachineSettingsSFDetails(DialogType type, 34 34 bool fEnableSelector, /* for "permanent" checkbox */ 35 const SFoldersNameList &usedNames,35 const QStringList &usedNames, 36 36 QWidget *pParent /* = 0 */) 37 37 : QIWithRetranslateUI2<QIDialog>(pParent) … … 140 140 void UIMachineSettingsSFDetails::sltValidate() 141 141 { 142 UISharedFolderType resultType = m_fUsePermanent && !mCbPermanent->isChecked() ? ConsoleType : MachineType;143 SFolderName pair = qMakePair(mLeName->text(), resultType);144 145 142 mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!mPsPath->path().isEmpty() && 146 143 QDir(mPsPath->path()).exists() && 147 144 !mLeName->text().trimmed().isEmpty() && 148 145 !mLeName->text().contains(" ") && 149 !m_usedNames.contains (pair));146 !m_usedNames.contains(mLeName->text())); 150 147 } 151 148 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h
r62493 r66377 41 41 UIMachineSettingsSFDetails(DialogType type, 42 42 bool fEnableSelector, /* for "permanent" checkbox */ 43 const SFoldersNameList &usedNames,43 const QStringList &usedNames, 44 44 QWidget *pParent = 0); 45 45 … … 70 70 private: 71 71 72 DialogType 73 bool 74 SFoldersNameListm_usedNames;72 DialogType m_type; 73 bool m_fUsePermanent; 74 QStringList m_usedNames; 75 75 }; 76 76
Note:
See TracChangeset
for help on using the changeset viewer.