VirtualBox

Changeset 10852

Show
Ignore:
Timestamp:
07/24/08 12:09:51 (3 months ago)
Author:
vboxsync
Message:

Fe/Qt4: Fixing the assert during taking/discarding snapshot in selector/snapshot sub-window.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSnapshotsWgt.h

    r9729 r10852  
    6666    void machineStateChanged (const VBoxMachineStateChangeEvent &aE); 
    6767    void sessionStateChanged (const VBoxSessionStateChangeEvent &aE); 
     68#if 0 
    6869    void snapshotChanged (const VBoxSnapshotEvent &aE); 
     70#endif 
    6971 
    7072private: 
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSnapshotsWgt.cpp

    r10416 r10852  
    140140    void updateCurrentState (KMachineState aState) 
    141141    { 
    142         AssertReturn (!mMachine.isNull(), (void) 0); 
     142        if (mMachine.isNull()) 
     143            return; 
     144 
    143145        setIcon (0, vboxGlobal().toIcon (aState)); 
    144146        mMachineState = aState; 
     
    325327    connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent&)), 
    326328             this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent&))); 
     329#if 0 
    327330    connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent&)), 
    328331             this, SLOT (snapshotChanged (const VBoxSnapshotEvent&))); 
     332#endif 
    329333 
    330334    retranslateUi(); 
     
    443447void VBoxSnapshotsWgt::discardSnapshot() 
    444448{ 
    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])
    447451    AssertReturn (item, (void) 0); 
    448452 
     
    474478void VBoxSnapshotsWgt::takeSnapshot() 
    475479{ 
    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])
    478482    AssertReturn (item, (void) 0); 
    479483 
     
    528532void VBoxSnapshotsWgt::discardCurState() 
    529533{ 
    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])
    532536    AssertReturn (item, (void) 0); 
    533537 
     
    556560void VBoxSnapshotsWgt::discardCurSnapAndState() 
    557561{ 
    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])
    560564    AssertReturn (item, (void) 0); 
    561565 
     
    584588void VBoxSnapshotsWgt::showSnapshotDetails() 
    585589{ 
    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])
    588592    AssertReturn (item, (void) 0); 
    589593 
     
    630634 
    631635    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 
    636641void VBoxSnapshotsWgt::snapshotChanged (const VBoxSnapshotEvent &aE) 
    637642{ 
     
    660665    } 
    661666} 
     667#endif 
    662668 
    663669void VBoxSnapshotsWgt::retranslateUi() 
     
    686692    if (aKeepSelected) 
    687693    { 
    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])
    690696        if (cur) 
    691697        { 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy