VirtualBox

Changeset 59851 in vbox for trunk


Ignore:
Timestamp:
Feb 26, 2016 3:35:35 PM (9 years ago)
Author:
vboxsync
Message:

DnD/GuestDnDSourceImpl.cpp: Rollback fixes + logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp

    r59842 r59851  
    524524                                      "user does not have the appropriate access rights for. Please make sure that all selected "
    525525                                      "elements can be accessed and that your host user has the appropriate rights."));
     526            break;
     527
     528        case VERR_DISK_FULL:
     529            strError += Utf8StrFmt(tr("Host disk ran out of space (disk is full)."));
    526530            break;
    527531
     
    719723        {
    720724            pCtx->mURI.processObject(*pObj);
     725
     726            /* Add for having a proper rollback. */
     727            int rc2 = pCtx->mURI.getDroppedFiles().AddDir(pszDir);
     728            AssertRC(rc2);
     729
    721730            objCtx.reset();
    722731            LogRel2(("DnD: Created guest directory on host: %s\n", pszDir));
     
    830839                              RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE,
    831840                              (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR);
     841            if (RT_SUCCESS(rc))
     842            {
     843                /* Add for having a proper rollback. */
     844                int rc2 = pCtx->mURI.getDroppedFiles().AddFile(pszPathAbs);
     845                AssertRC(rc2);
     846            }
    832847        }
    833848
     
    917932                rc = updateProgress(&pCtx->mData, pCtx->mpResp, cbWritten);
    918933        }
     934        else /* Something went wrong; close the object. */
     935            pObj->Close();
    919936
    920937        if (RT_SUCCESS(rc))
     
    11541171        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
    11551172        {
    1156             rc = pCtx->mpResp->setProgress(100, DND_PROGRESS_ERROR,
    1157                                            rc, GuestDnDSource::i_hostErrorToString(rc));
     1173            int rc2 = pCtx->mpResp->setProgress(100, DND_PROGRESS_ERROR,
     1174                                                rc, GuestDnDSource::i_hostErrorToString(rc));
     1175            AssertRC(rc2);
    11581176        }
    11591177    }
     
    12571275#undef UNREGISTER_CALLBACK
    12581276
    1259     int rc2;
    1260 
    12611277    if (RT_FAILURE(rc))
    12621278    {
    12631279        if (rc == VERR_CANCELLED)
    12641280        {
    1265             rc2 = pCtx->mpResp->setProgress(100, DND_PROGRESS_CANCELLED);
     1281            int rc2 = pCtx->mpResp->setProgress(100, DND_PROGRESS_CANCELLED);
    12661282            AssertRC(rc2);
    12671283
     
    12711287        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
    12721288        {
    1273             rc = pCtx->mpResp->setProgress(100, DND_PROGRESS_ERROR,
    1274                                            rc, GuestDnDSource::i_hostErrorToString(rc));
     1289            int rc2 = pCtx->mpResp->setProgress(100, DND_PROGRESS_ERROR,
     1290                                                rc, GuestDnDSource::i_hostErrorToString(rc));
     1291            AssertRC(rc2);
    12751292        }
    12761293    }
     
    12781295    if (RT_FAILURE(rc))
    12791296    {
    1280         rc2 = droppedFiles.Rollback();
     1297        int rc2 = droppedFiles.Rollback();
    12811298        if (RT_FAILURE(rc2))
    1282             LogRel2(("DnD: Rollback failed with %Rrc\n", rc2));
     1299            LogRel(("DnD: Deleting left over temporary files failed (%Rrc). Please remove directory manually: %s\n",
     1300                    rc2, droppedFiles.GetDirAbs()));
    12831301    }
    12841302
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