Changeset 10852 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Jul 24, 2008 10:09:51 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSnapshotsWgt.h
r9729 r10852 66 66 void machineStateChanged (const VBoxMachineStateChangeEvent &aE); 67 67 void sessionStateChanged (const VBoxSessionStateChangeEvent &aE); 68 #if 0 68 69 void snapshotChanged (const VBoxSnapshotEvent &aE); 70 #endif 69 71 70 72 private: -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSnapshotsWgt.cpp
r10416 r10852 140 140 void updateCurrentState (KMachineState aState) 141 141 { 142 AssertReturn (!mMachine.isNull(), (void) 0); 142 if (mMachine.isNull()) 143 return; 144 143 145 setIcon (0, vboxGlobal().toIcon (aState)); 144 146 mMachineState = aState; … … 325 327 connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent&)), 326 328 this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent&))); 329 #if 0 327 330 connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent&)), 328 331 this, SLOT (snapshotChanged (const VBoxSnapshotEvent&))); 332 #endif 329 333 330 334 retranslateUi(); … … 443 447 void VBoxSnapshotsWgt::discardSnapshot() 444 448 { 445 SnapshotWgtItem *item = mTreeWidget->selectedItems(). count() ?446 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;449 SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 : 450 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 447 451 AssertReturn (item, (void) 0); 448 452 … … 474 478 void VBoxSnapshotsWgt::takeSnapshot() 475 479 { 476 SnapshotWgtItem *item = mTreeWidget->selectedItems(). count() ?477 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;480 SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 : 481 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 478 482 AssertReturn (item, (void) 0); 479 483 … … 528 532 void VBoxSnapshotsWgt::discardCurState() 529 533 { 530 SnapshotWgtItem *item = mTreeWidget->selectedItems(). count() ?531 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;534 SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 : 535 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 532 536 AssertReturn (item, (void) 0); 533 537 … … 556 560 void VBoxSnapshotsWgt::discardCurSnapAndState() 557 561 { 558 SnapshotWgtItem *item = mTreeWidget->selectedItems(). count() ?559 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;562 SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 : 563 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 560 564 AssertReturn (item, (void) 0); 561 565 … … 584 588 void VBoxSnapshotsWgt::showSnapshotDetails() 585 589 { 586 SnapshotWgtItem *item = mTreeWidget->selectedItems(). count() ?587 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;590 SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 : 591 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 588 592 AssertReturn (item, (void) 0); 589 593 … … 630 634 631 635 mSessionState = aE.state; 632 onCurrentChanged (mTreeWidget->selectedItems().count() ? 633 mTreeWidget->selectedItems() [0] : 0); 634 } 635 636 onCurrentChanged (mTreeWidget->selectedItems().isEmpty() ? 0 : 637 mTreeWidget->selectedItems() [0]); 638 } 639 640 #if 0 636 641 void VBoxSnapshotsWgt::snapshotChanged (const VBoxSnapshotEvent &aE) 637 642 { … … 660 665 } 661 666 } 667 #endif 662 668 663 669 void VBoxSnapshotsWgt::retranslateUi() … … 686 692 if (aKeepSelected) 687 693 { 688 SnapshotWgtItem *cur = mTreeWidget->selectedItems(). count() ?689 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]) : 0;694 SnapshotWgtItem *cur = mTreeWidget->selectedItems().isEmpty() ? 0 : 695 static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]); 690 696 if (cur) 691 697 {
Note:
See TracChangeset
for help on using the changeset viewer.