VirtualBox

Changeset 56657 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 26, 2015 8:54:42 AM (9 years ago)
Author:
vboxsync
Message:

DnD/Main: GuestDnDTargetImpl.cpp: Decide based on the host format whether we need to build up a file tree, also set progress when processing raw data.

File:
1 edited

Legend:

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

    r56656 r56657  
    727727    mDataBase.mListOutgoing.clear();
    728728
    729     const char *pszFormat = pCtx->mFmtReq.c_str();
    730     uint32_t cbFormat = pCtx->mFmtReq.length() + 1;
    731 
    732     /* Do we need to build up a file tree? */
    733     bool fHasURIList = DnDMIMEHasFileURLs(pszFormat, cbFormat);
     729    /**
     730     * Do we need to build up a file tree?
     731     * Note: The decision whether we need to build up a file tree and sending
     732     *       actual file data only depends on the actual formats offered by this target.
     733     *       If the guest does not want an URI list ("text/uri-list") but text ("TEXT" and
     734     *       friends) instead, still send the data over to the guest -- the file as such still
     735     *       is needed on the guest in this case, as the guest then just wants a simple path
     736     *       instead of an URI list (pointing to a file on the guest itself).
     737     *
     738     ** @todo Support more than one format; add a format<->function handler concept. Later. */
     739    bool fHasURIList = std::find(m_vecFmtOff.begin(),
     740                                 m_vecFmtOff.end(), "text/uri-list") != m_vecFmtOff.end();
    734741    if (fHasURIList)
    735742    {
     
    13021309    AssertPtr(pInst);
    13031310
    1304     /* At the moment we only allow up to 64K raw data. */
     1311    /** @todo At the moment we only allow sending up to 64K raw data. Fix this by
     1312     *        using HOST_DND_HG_SND_MORE_DATA. */
    13051313    size_t cbDataTotal = pCtx->mData.vecData.size();
    13061314    if (   !cbDataTotal
     
    13191327    Msg.setNextUInt32(cbDataTotal);
    13201328
    1321     LogFlowFunc(("%zu total bytes of raw data to transfer\n", cbDataTotal));
    1322 
    1323     return pInst->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     1329    LogFlowFunc(("Transferring %zu total bytes of raw data ('%s')\n", cbDataTotal, pCtx->mFmtReq.c_str()));
     1330
     1331    int rc2;
     1332
     1333    int rc = pInst->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     1334    if (RT_FAILURE(rc))
     1335        rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
     1336                                        GuestDnDTarget::i_hostErrorToString(rc));
     1337    else
     1338        rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, rc);
     1339    AssertRC(rc2);
     1340
     1341    LogFlowFuncLeaveRC(rc);
     1342    return rc;
    13241343}
    13251344
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