VirtualBox

Changeset 34758 in vbox


Ignore:
Timestamp:
Dec 6, 2010 3:42:52 PM (14 years ago)
Author:
vboxsync
Message:

Automatic Guest Additions update/Main: Simplified overall progress error handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r34709 r34758  
    480480    /* Clean up */
    481481    aTask->rc = rc;
    482     if (SUCCEEDED(   aTask->progress->COMGETTER(Completed(&fCompleted)))
    483                   && !fCompleted)
    484         aTask->progress->SetCurrentOperationProgress(99);
    485482
    486483    if (   SUCCEEDED(aTask->progress->COMGETTER(Canceled(&fCanceled)))
    487         && !fCanceled)
    488     {
    489         /* Task completed, regardless whether successful/failed. */
    490 
    491         /* Assign data. */
    492         if (rc == S_OK)
    493         {
    494             /* No data to assign yet. */
    495         }
    496 
    497         if (SUCCEEDED(   aTask->progress->COMGETTER(Completed(&fCompleted)))
    498                       && !fCompleted)
    499             aTask->progress->notifyComplete(rc);
    500     }
    501     else /* The task was canceled, set error code to prevent assertions. */
    502     {
    503         LogRel(("Guest Additions update was canceled\n"));
    504         if (SUCCEEDED(   aTask->progress->COMGETTER(Completed(&fCompleted)))
    505                       && !fCompleted)
    506             aTask->progress->notifyComplete(VBOX_E_IPRT_ERROR,
     484        && !fCanceled
     485        && SUCCEEDED(aTask->progress->COMGETTER(Completed(&fCompleted)))
     486        && !fCompleted)
     487    {
     488        if (FAILED(rc))
     489        {
     490            aTask->progress->notifyComplete(rc,
    507491                                            COM_IIDOF(IGuest),
    508492                                            Guest::getStaticComponentName(),
    509                                             Guest::tr("Automatic Guest Additions update was canceled"));
     493                                            rc == VBOX_E_NOT_SUPPORTED
     494                                            ? Guest::tr("Automatic Guest Additions update not supported")
     495                                            : Guest::tr("Automatic Guest Additions update failed"));
     496        }
     497        else
     498            AssertMsgFailed(("Automatic Guest Additions update neither canceled nor completed and did *not* fail!? D'oh!\n"));
    510499    }
    511500
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