Changeset 77041 in vbox
- Timestamp:
- Jan 30, 2019 12:48:39 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r76942 r77041 60 60 , m_iMaximumSnapshotNameWidth(0) 61 61 { 62 /* Prepare: */63 62 prepare(); 64 63 } … … 82 81 , m_iMaximumSnapshotNameWidth(0) 83 82 { 84 /* Prepare: */85 83 prepare(); 86 84 } … … 88 86 UIChooserItemMachine::~UIChooserItemMachine() 89 87 { 90 /* If that item is focused: */ 91 if (model()->focusItem() == this) 92 { 93 /* Unset the focus: */ 94 model()->setFocusItem(0); 95 } 96 /* If that item is in selection list: */ 97 if (model()->currentItems().contains(this)) 98 { 99 /* Remove item from the selection list: */ 100 model()->removeFromCurrentItems(this); 101 } 102 /* If that item is in navigation list: */ 103 if (model()->navigationList().contains(this)) 104 { 105 /* Remove item from the navigation list: */ 106 model()->removeFromNavigationList(this); 107 } 108 109 /* Remove item from the parent: */ 110 AssertMsg(parentItem(), ("No parent set for machine-item!")); 111 parentItem()->removeItem(this); 88 cleanup(); 112 89 } 113 90 … … 613 590 614 591 /* Add item to the parent: */ 615 Assert Msg(parentItem(), ("No parent set for machine-item!"));592 AssertPtrReturnVoid(parentItem()); 616 593 parentItem()->addItem(this, m_iPosition); 617 594 setZValue(parentItem()->zValue() + 1); … … 634 611 /* Apply language settings: */ 635 612 retranslateUi(); 613 } 614 615 void UIChooserItemMachine::cleanup() 616 { 617 /* If that item is focused: */ 618 if (model()->focusItem() == this) 619 { 620 /* Unset the focus: */ 621 model()->setFocusItem(0); 622 } 623 /* If that item is in selection list: */ 624 if (model()->currentItems().contains(this)) 625 { 626 /* Remove item from the selection list: */ 627 model()->removeFromCurrentItems(this); 628 } 629 /* If that item is in navigation list: */ 630 if (model()->navigationList().contains(this)) 631 { 632 /* Remove item from the navigation list: */ 633 model()->removeFromNavigationList(this); 634 } 635 636 /* Remove item from the parent: */ 637 AssertPtrReturnVoid(parentItem()); 638 parentItem()->removeItem(this); 636 639 } 637 640 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h
r76935 r77041 220 220 /** Prepares all. */ 221 221 void prepare(); 222 /** Cleanups all. */ 223 void cleanup(); 222 224 /** @} */ 223 225
Note:
See TracChangeset
for help on using the changeset viewer.