VirtualBox

Changeset 102600 in vbox for trunk/src


Ignore:
Timestamp:
Dec 14, 2023 4:22:28 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160754
Message:

FE/Qt: bugref:10543: UISession: Checking CPlatform for API errors as usual.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r101078 r102600  
    6969#include "CNATNetwork.h"
    7070#include "CNetworkAdapter.h"
     71#include "CPlatform.h"
    7172#include "CPlatformProperties.h"
    7273#include "CRangedIntegerFormValue.h"
     
    628629        UIErrorString::formatErrorInfo(comAppliance),
    629630        QString(), QString(), pParent);
     631}
     632
     633/* static */
     634void UINotificationMessage::cannotAcquirePlatformParameter(const CPlatform &comPlatform)
     635{
     636    createMessage(
     637        QApplication::translate("UIMessageCenter", "Platform failure ..."),
     638        QApplication::translate("UIMessageCenter", "Failed to acquire platform parameter.") +
     639        UIErrorString::formatErrorInfo(comPlatform));
    630640}
    631641
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r101078 r102600  
    286286        static void cannotAcquireApplianceParameter(const CAppliance &comAppliance,
    287287                                                    UINotificationCenter *pParent = 0);
     288        /** Notifies about inability to acquire IPlatform parameter.
     289          * @param  comPlatform  Brings the object parameter get acquired from. */
     290        static void cannotAcquirePlatformParameter(const CPlatform &comPlatform);
    288291        /** Notifies about inability to acquire IPlatformProperties parameter.
    289292          * @param  comProperties  Brings the object parameter get acquired from. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r102599 r102600  
    306306        return false;
    307307    CPlatform comPlatform = comMachine.GetPlatform();
    308     const KPlatformArchitecture enmArchType = comPlatform.GetArchitecture();
    309     const bool fSuccess = comMachine.isOk();
    310     if (!fSuccess)
    311         UINotificationMessage::cannotAcquireMachineParameter(comMachine);
    312     else
    313         enmType = enmArchType;
     308    bool fSuccess = comMachine.isOk();
     309    if (!fSuccess)
     310        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     311    else
     312    {
     313        const KPlatformArchitecture enmArchType = comPlatform.GetArchitecture();
     314        fSuccess = comPlatform.isOk();
     315        if (!fSuccess)
     316            UINotificationMessage::cannotAcquirePlatformParameter(comPlatform);
     317        else
     318            enmType = enmArchType;
     319    }
    314320    return fSuccess;
    315321}
     
    321327        return false;
    322328    CPlatform comPlatform = comMachine.GetPlatform();
    323     const KChipsetType enmChipsetType = comPlatform.GetChipsetType();
    324     const bool fSuccess = comMachine.isOk();
    325     if (!fSuccess)
    326         UINotificationMessage::cannotAcquireMachineParameter(comMachine);
    327     else
    328         enmType = enmChipsetType;
     329    bool fSuccess = comMachine.isOk();
     330    if (!fSuccess)
     331        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     332    else
     333    {
     334        const KChipsetType enmChipsetType = comPlatform.GetChipsetType();
     335        fSuccess = comPlatform.isOk();
     336        if (!fSuccess)
     337            UINotificationMessage::cannotAcquirePlatformParameter(comPlatform);
     338        else
     339            enmType = enmChipsetType;
     340    }
    329341    return fSuccess;
    330342}
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