Changeset 47833 in vbox for trunk/src/VBox
- Timestamp:
- Aug 19, 2013 8:08:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r44528 r47833 26 26 #include <QSpinBox> 27 27 #include <QComboBox> 28 #include <QDir> 28 29 29 30 /* GUI includes: */ … … 621 622 /* Query all items with the type HardDiskImage and which 622 623 * are child's of this item. */ 623 QModelIndexList list = pModel->match(c0Index, HardwareItem::TypeRole, KVirtualSystemDescriptionType_HardDiskImage, -1, Qt::MatchExactly | Qt::MatchWrap | Qt::MatchRecursive); 624 QModelIndexList list = pModel->match(c0Index, 625 HardwareItem::TypeRole, 626 KVirtualSystemDescriptionType_HardDiskImage, 627 -1, 628 Qt::MatchExactly | Qt::MatchWrap | Qt::MatchRecursive); 624 629 for (int i = 0; i < list.count(); ++i) 625 630 { … … 630 635 /* Replace any occurrence of the old VM name with 631 636 * the new VM name. */ 632 pModel->setData(hdIndex, hdIndex.data(Qt::EditRole).toString().replace(m_strConfigValue, e->text()), Qt::EditRole); 637 { 638 QStringList splittedOriginalPath = hdIndex.data(Qt::EditRole).toString().split(QDir::separator()); 639 QStringList splittedNewPath; 640 641 foreach (QString a, splittedOriginalPath) 642 { 643 (a.compare(m_strConfigValue) == 0) ? splittedNewPath << e->text() : splittedNewPath << a; 644 } 645 646 QString newPath = splittedNewPath.join(QDir::separator()); 647 648 pModel->setData(hdIndex, 649 newPath, 650 Qt::EditRole); 651 } 633 652 } 634 653 m_strConfigValue = e->text();
Note:
See TracChangeset
for help on using the changeset viewer.