VirtualBox

Ignore:
Timestamp:
Nov 3, 2020 8:16:05 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141237
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: While uninstalling cloud provider we should stop profile refresh tasks as well as we already do for machine refresh tasks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r86803 r86804  
    723723void UIChooserAbstractModel::sltHandleCloudProviderUninstall(const QUuid &uProviderId)
    724724{
    725     /* We should stop cloud machine updates currently being performed: */
     725    /* We should stop cloud entity updates currently being performed: */
    726726    foreach (const UICloudEntityKey &key, m_cloudEntityKeysBeingUpdated)
    727727    {
    728         /* Skip unrelated keys: */
     728        /* For profiles: */
    729729        if (key.m_uMachineId.isNull())
    730             continue;
    731 
    732         /* Search machine node: */
    733         UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId);
    734         AssertPtrReturnVoid(pNode);
    735         /* Acquire cloud machine item: */
    736         UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud();
    737         AssertPtrReturnVoid(pCloudMachineItem);
    738 
    739         /* Wait for cloud machine refresh task to complete: */
    740         pCloudMachineItem->waitForAsyncInfoUpdateFinished();
    741     }
     730        {
     731            /* Search task child by key: */
     732            UIProgressTaskReadCloudMachineList *pTask = findChild<UIProgressTaskReadCloudMachineList*>(key.toString());
     733            AssertPtrReturnVoid(pTask);
     734
     735            /* Wait for cloud profile refresh task to complete,
     736             * then delete the task itself manually: */
     737            pTask->cancel();
     738            delete pTask;
     739        }
     740        /* For machines: */
     741        else
     742        {
     743            /* Search machine node: */
     744            UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId);
     745            AssertPtrReturnVoid(pNode);
     746            /* Acquire cloud machine item: */
     747            UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud();
     748            AssertPtrReturnVoid(pCloudMachineItem);
     749
     750            /* Wait for cloud machine refresh task to complete,
     751             * task itself will be deleted with the machine-node: */
     752            pCloudMachineItem->waitForAsyncInfoUpdateFinished();
     753        }
     754    }
     755
     756    /* We haven't let tasks to unregister themselves
     757     * so we have to cleanup task set ourselves: */
     758    m_cloudEntityKeysBeingUpdated.clear();
    742759
    743760    /* Search and delete corresponding cloud provider node if present: */
     
    943960    if (pTask)
    944961    {
     962        /* It's easy to find child by name later: */
     963        pTask->setObjectName(guiCloudProfileKey.toString());
     964
    945965        /* Insert cloud profile key into a list of keys currently being updated: */
    946966        insertCloudEntityKey(guiCloudProfileKey);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette