VirtualBox

Changeset 46015 in vbox


Ignore:
Timestamp:
May 13, 2013 12:23:40 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85679
Message:

FE/Qt: Message-center: Extending CProgress errors handling for the case when CProgress::GetErrorInfo() returns NULL CVirtualBoxErrorInfo object.

File:
1 edited

Legend:

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

    r45690 r46015  
    24162416QString UIMessageCenter::formatErrorInfo(const CProgress &progress)
    24172417{
    2418     return !progress.isOk() ? formatErrorInfo(static_cast<COMBaseWithEI>(progress)) : formatErrorInfo(progress.GetErrorInfo());
     2418    /* Check for API errors first: */
     2419    if (!progress.isOk())
     2420        return formatErrorInfo(static_cast<COMBaseWithEI>(progress));
     2421
     2422    /* For progress errors otherwise: */
     2423    CVirtualBoxErrorInfo errorInfo = progress.GetErrorInfo();
     2424    /* Handle valid error-info first: */
     2425    if (!errorInfo.isNull())
     2426        return formatErrorInfo(errorInfo);
     2427    /* Handle NULL error-info otherwise: */
     2428    return tr("Progress result-code: %1")
     2429             .arg(QString::number(progress.GetResultCode(), 16 /* hex */))
     2430             .prepend("<!--EOM-->") /* move to details instead of mesasage body */;
    24192431}
    24202432
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