VirtualBox

Changeset 86250 in vbox


Ignore:
Timestamp:
Sep 23, 2020 5:13:30 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: UICloudProfileManager: Make sure provider/profile restrictions are always taken into account, they were forgotten on profile add/update calls.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager
Files:
2 edited

Legend:

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

    r86242 r86250  
    308308                if (comCloudProfile.isOk())
    309309                {
     310                    /* Acquire cloud profile manager restrictions: */
     311                    const QStringList restrictions = gEDataManager->cloudProfileManagerRestrictions();
     312
    310313                    /* Update profile in the tree: */
    311314                    UIDataCloudProfile data;
    312                     loadCloudProfile(comCloudProfile, *pProviderItem, data);
     315                    loadCloudProfile(comCloudProfile, restrictions, *pProviderItem, data);
    313316                    updateItemForCloudProfile(data, true, pProfileItem);
    314317
     
    395398                else
    396399                {
     400                    /* Acquire cloud profile manager restrictions: */
     401                    const QStringList restrictions = gEDataManager->cloudProfileManagerRestrictions();
     402
    397403                    /* Add profile to the tree: */
    398404                    UIDataCloudProfile data;
    399                     loadCloudProfile(comCloudProfile, *pProviderItem, data);
     405                    loadCloudProfile(comCloudProfile, restrictions, *pProviderItem, data);
    400406                    createItemForCloudProfile(pProviderItem, data, true);
    401407
     
    823829        /* Load provider data: */
    824830        UIDataCloudProvider providerData;
    825         loadCloudProvider(comCloudProvider, providerData);
    826         const QString strProviderPath = QString("/%1").arg(providerData.m_strShortName);
    827         providerData.m_fRestricted = restrictions.contains(strProviderPath);
     831        loadCloudProvider(comCloudProvider, restrictions, providerData);
    828832        createItemForCloudProvider(providerData, false);
    829833
     
    840844            /* Load profile data: */
    841845            UIDataCloudProfile profileData;
    842             loadCloudProfile(comCloudProfile, providerData, profileData);
    843             const QString strProfilePath = QString("/%1/%2").arg(providerData.m_strShortName).arg(profileData.m_strName);
    844             profileData.m_fRestricted = restrictions.contains(strProfilePath);
     846            loadCloudProfile(comCloudProfile, restrictions, providerData, profileData);
    845847            createItemForCloudProfile(pItem, profileData, false);
    846848        }
     
    856858
    857859void UICloudProfileManagerWidget::loadCloudProvider(const CCloudProvider &comProvider,
     860                                                    const QStringList &restrictions,
    858861                                                    UIDataCloudProvider &providerData)
    859862{
     
    865868    if (comProvider.isOk())
    866869        providerData.m_strName = comProvider.GetName();
     870    const QString strProviderPath = QString("/%1").arg(providerData.m_strShortName);
     871    providerData.m_fRestricted = restrictions.contains(strProviderPath);
    867872    foreach (const QString &strSupportedPropertyName, comProvider.GetSupportedPropertyNames())
    868873        providerData.m_propertyDescriptions[strSupportedPropertyName] = comProvider.GetPropertyDescription(strSupportedPropertyName);
     
    874879
    875880void UICloudProfileManagerWidget::loadCloudProfile(const CCloudProfile &comProfile,
     881                                                   const QStringList &restrictions,
    876882                                                   const UIDataCloudProvider &providerData,
    877883                                                   UIDataCloudProfile &profileData)
     
    883889    if (comProfile.isOk())
    884890        profileData.m_strName = comProfile.GetName();
     891    const QString strProfilePath = QString("/%1/%2").arg(providerData.m_strShortName).arg(profileData.m_strName);
     892    profileData.m_fRestricted = restrictions.contains(strProfilePath);
    885893
    886894    if (comProfile.isOk())
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.h

    r86242 r86250  
    153153        /** Loads cloud stuff. */
    154154        void loadCloudStuff();
    155         /** Loads cloud @a comProvider data to passed @a providerData container. */
     155        /** Loads cloud @a comProvider data to passed @a providerData container,
     156          * using @a restrictions as hint. */
    156157        void loadCloudProvider(const CCloudProvider &comProvider,
     158                               const QStringList &restrictions,
    157159                               UIDataCloudProvider &providerData);
    158         /** Loads cloud @a comProfile data to passed @a profileData container, using @a providerData as hint. */
     160        /** Loads cloud @a comProfile data to passed @a profileData container,
     161          * using @a restrictions & @a providerData as hint. */
    159162        void loadCloudProfile(const CCloudProfile &comProfile,
     163                              const QStringList &restrictions,
    160164                              const UIDataCloudProvider &providerData,
    161165                              UIDataCloudProfile &profileData);
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