VirtualBox

Changeset 85034 in vbox


Ignore:
Timestamp:
Jul 1, 2020 4:33:26 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: Cloud Profile Manager: A bit of provider/profile population cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp

    r85033 r85034  
    2727#include "UICommon.h"
    2828#include "UIActionPoolManager.h"
     29#include "UICloudNetworkingStuff.h"
    2930#include "UIExtraDataManager.h"
    3031#include "UIIconPool.h"
     
    718719    m_pTreeWidget->clear();
    719720
    720     /* Get VirtualBox for further activities: */
    721     const CVirtualBox comVBox = uiCommon().virtualBox();
    722 
    723     /* Get CloudProviderManager for further activities: */
    724     const CCloudProviderManager comCloudProviderManager = comVBox.GetCloudProviderManager();
    725     /* Show error message if necessary: */
    726     if (!comVBox.isOk())
    727         msgCenter().cannotAcquireCloudProviderManager(comVBox, this);
    728     else
    729     {
    730         /* Iterate through existing providers: */
    731         foreach (const CCloudProvider &comCloudProvider, comCloudProviderManager.GetProviders())
     721    /* Iterate through existing providers: */
     722    foreach (const CCloudProvider &comCloudProvider, listCloudProviders())
     723    {
     724        /* Skip if we have nothing to populate: */
     725        if (comCloudProvider.isNull())
     726            continue;
     727
     728        /* Load provider data: */
     729        UIDataCloudProvider providerData;
     730        loadCloudProvider(comCloudProvider, providerData);
     731        createItemForCloudProvider(providerData, false);
     732
     733        /* Make sure provider item is properly inserted: */
     734        UIItemCloudProvider *pItem = searchItem(providerData.m_uuid);
     735
     736        /* Iterate through provider's profiles: */
     737        foreach (const CCloudProfile &comCloudProfile, listCloudProfiles(comCloudProvider))
    732738        {
    733             /* Skip if we have nothing to populate (file missing?): */
    734             if (comCloudProvider.isNull())
     739            /* Skip if we have nothing to populate: */
     740            if (comCloudProfile.isNull())
    735741                continue;
    736742
    737             /* Load provider data: */
    738             UIDataCloudProvider providerData;
    739             loadCloudProvider(comCloudProvider, providerData);
    740             createItemForCloudProvider(providerData, false);
    741 
    742             /* Make sure provider item is properly inserted: */
    743             UIItemCloudProvider *pItem = searchItem(providerData.m_uuid);
    744 
    745             /* Iterate through existing profiles: */
    746             foreach (const CCloudProfile &comCloudProfile, comCloudProvider.GetProfiles())
    747             {
    748                 /* Load profile data: */
    749                 UIDataCloudProfile profileData;
    750                 loadCloudProfile(comCloudProfile, providerData, profileData);
    751                 createItemForCloudProfile(pItem, profileData, false);
    752             }
    753 
    754             /* Expand provider item finally: */
    755             pItem->setExpanded(true);
     743            /* Load profile data: */
     744            UIDataCloudProfile profileData;
     745            loadCloudProfile(comCloudProfile, providerData, profileData);
     746            createItemForCloudProfile(pItem, profileData, false);
    756747        }
    757748
    758         /* Choose the 1st item as current initially: */
    759         m_pTreeWidget->setCurrentItem(m_pTreeWidget->topLevelItem(0));
    760         sltHandleCurrentItemChange();
    761     }
     749        /* Expand provider item finally: */
     750        pItem->setExpanded(true);
     751    }
     752
     753    /* Choose the 1st item as current initially: */
     754    m_pTreeWidget->setCurrentItem(m_pTreeWidget->topLevelItem(0));
     755    sltHandleCurrentItemChange();
    762756}
    763757
Note: See TracChangeset for help on using the changeset viewer.

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