Changeset 90698 in vbox
- Timestamp:
- Aug 16, 2021 2:15:08 PM (3 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/UIChooserAbstractModel.cpp
r88681 r90698 721 721 void UIChooserAbstractModel::sltHandleCloudProviderUninstall(const QUuid &uProviderId) 722 722 { 723 /* We should stop cloud entity updates currently being performed: */ 724 foreach (const UICloudEntityKey &key, m_cloudEntityKeysBeingUpdated) 725 { 726 /* For profiles: */ 727 if (key.m_uMachineId.isNull()) 728 { 729 /* Search task child by key: */ 730 UIProgressTaskReadCloudMachineList *pTask = findChild<UIProgressTaskReadCloudMachineList*>(key.toString()); 731 AssertPtrReturnVoid(pTask); 732 733 /* Wait for cloud profile refresh task to complete, 734 * then delete the task itself manually: */ 735 pTask->cancel(); 736 delete pTask; 737 } 738 /* For machines: */ 739 else 740 { 741 /* Search machine node: */ 742 UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId); 743 AssertPtrReturnVoid(pNode); 744 /* Acquire cloud machine item: */ 745 UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud(); 746 AssertPtrReturnVoid(pCloudMachineItem); 747 748 /* Wait for cloud machine refresh task to complete, 749 * task itself will be deleted with the machine-node: */ 750 pCloudMachineItem->waitForAsyncInfoUpdateFinished(); 751 } 752 } 753 754 /* We haven't let tasks to unregister themselves 755 * so we have to cleanup task set ourselves: */ 756 m_cloudEntityKeysBeingUpdated.clear(); 723 /* First of all, stop all cloud updates: */ 724 stopCloudUpdates(); 757 725 758 726 /* Search and delete corresponding cloud provider node if present: */ … … 781 749 delete m_pInvisibleRootNode; 782 750 m_pInvisibleRootNode = 0; 751 752 /* Finally, stop all cloud updates: */ 753 stopCloudUpdates(); 783 754 } 784 755 … … 1857 1828 } 1858 1829 1830 void UIChooserAbstractModel::stopCloudUpdates() 1831 { 1832 /* Stop all cloud entity updates currently being performed: */ 1833 foreach (const UICloudEntityKey &key, m_cloudEntityKeysBeingUpdated) 1834 { 1835 /* For profiles: */ 1836 if (key.m_uMachineId.isNull()) 1837 { 1838 /* Search task child by key: */ 1839 UIProgressTaskReadCloudMachineList *pTask = findChild<UIProgressTaskReadCloudMachineList*>(key.toString()); 1840 AssertPtrReturnVoid(pTask); 1841 1842 /* Wait for cloud profile refresh task to complete, 1843 * then delete the task itself manually: */ 1844 pTask->cancel(); 1845 delete pTask; 1846 } 1847 /* For machines: */ 1848 else 1849 { 1850 /* Search machine node: */ 1851 UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId); 1852 AssertPtrReturnVoid(pNode); 1853 /* Acquire cloud machine item: */ 1854 UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud(); 1855 AssertPtrReturnVoid(pCloudMachineItem); 1856 1857 /* Wait for cloud machine refresh task to complete, 1858 * task itself will be deleted with the machine-node: */ 1859 pCloudMachineItem->waitForAsyncInfoUpdateFinished(); 1860 } 1861 } 1862 1863 /* We haven't let tasks to unregister themselves 1864 * so we have to cleanup task set ourselves: */ 1865 m_cloudEntityKeysBeingUpdated.clear(); 1866 } 1867 1859 1868 1860 1869 #include "UIChooserAbstractModel.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r88681 r90698 353 353 /** @} */ 354 354 355 /** @name Cloud update stuff. 356 * @{ */ 357 /** Stops all cloud updates. */ 358 void stopCloudUpdates(); 359 /** @} */ 360 355 361 /** @name General stuff. 356 362 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.