VirtualBox

Changeset 91150 in vbox


Ignore:
Timestamp:
Sep 8, 2021 12:56:22 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Extend UICloudNetworkingStuff with direct cloudClient getters.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp

    r91145 r91150  
    176176}
    177177
     178CCloudClient UICloudNetworkingStuff::cloudClient(CCloudProfile comProfile,
     179                                                 QWidget *pParent /* = 0 */)
     180{
     181    /* Create cloud client: */
     182    CCloudClient comClient = comProfile.CreateCloudClient();
     183    if (!comProfile.isOk())
     184        msgCenter().cannotCreateCloudClient(comProfile, pParent);
     185    else
     186        return comClient;
     187    /* Null by default: */
     188    return CCloudClient();
     189}
     190
     191CCloudClient UICloudNetworkingStuff::cloudClient(CCloudProfile comProfile,
     192                                                 QString &strErrorMessage)
     193{
     194    /* Create cloud client: */
     195    CCloudClient comClient = comProfile.CreateCloudClient();
     196    if (!comProfile.isOk())
     197        strErrorMessage = UIErrorString::formatErrorInfo(comProfile);
     198    else
     199        return comClient;
     200    /* Null by default: */
     201    return CCloudClient();
     202}
     203
    178204CCloudClient UICloudNetworkingStuff::cloudClientByName(const QString &strProviderShortName,
    179205                                                       const QString &strProfileName,
     
    183209    CCloudProfile comProfile = cloudProfileByName(strProviderShortName, strProfileName, pParent);
    184210    if (comProfile.isNotNull())
    185     {
    186         /* Create cloud client: */
    187         CCloudClient comClient = comProfile.CreateCloudClient();
    188         if (!comProfile.isOk())
    189             msgCenter().cannotAcquireCloudProfileParameter(comProfile, pParent);
    190         else
    191             return comClient;
    192     }
     211        return cloudClient(comProfile, pParent);
    193212    /* Null by default: */
    194213    return CCloudClient();
     
    202221    CCloudProfile comProfile = cloudProfileByName(strProviderShortName, strProfileName, strErrorMessage);
    203222    if (comProfile.isNotNull())
    204     {
    205         /* Create cloud client: */
    206         CCloudClient comClient = comProfile.CreateCloudClient();
    207         if (!comProfile.isOk())
    208             strErrorMessage = UIErrorString::formatErrorInfo(comProfile);
    209         else
    210             return comClient;
    211     }
     223        return cloudClient(comProfile, strErrorMessage);
    212224    /* Null by default: */
    213225    return CCloudClient();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r89998 r91150  
    6969                                                          const QString &strProfileName,
    7070                                                          QString &strErrorMessage);
     71    /** Acquires cloud client created for @a comProfile,
     72      * using @a pParent to show messages according to. */
     73    SHARED_LIBRARY_STUFF CCloudClient cloudClient(CCloudProfile comProfile,
     74                                                  QWidget *pParent = 0);
     75    /** Acquires cloud client created for @a comProfile,
     76      * using @a strErrorMessage to store messages to. */
     77    SHARED_LIBRARY_STUFF CCloudClient cloudClient(CCloudProfile comProfile,
     78                                                  QString &strErrorMessage);
    7179    /** Acquires cloud client specified by @a strProviderShortName and @a strProfileName,
    7280      * using @a pParent to show messages according to. */
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