VirtualBox

Changeset 78020 in vbox for trunk/src


Ignore:
Timestamp:
Apr 5, 2019 8:23:13 AM (6 years ago)
Author:
vboxsync
Message:

DnD/DnDURIObject: Got rid of internal m_fIsOpen member, which is superfluous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp

    r76553 r78020  
    3636    : m_enmType(Type_Unknown)
    3737    , m_enmView(View_Unknown)
    38     , m_fIsOpen(false)
    3938{
    4039    RT_ZERO(u);
     
    4847    , m_strSrcPathAbs(strSrcPathAbs)
    4948    , m_strTgtPathAbs(strDstPathAbs)
    50     , m_fIsOpen(false)
    5149{
    5250    RT_ZERO(u);
     
    6563{
    6664    LogFlowThisFuncEnter();
    67 
    68     if (!m_fIsOpen)
    69         return;
    7065
    7166    switch (m_enmType)
     
    9085            break;
    9186    }
    92 
    93     m_fIsOpen = false;
    9487}
    9588
     
    190183bool DnDURIObject::IsOpen(void) const
    191184{
    192     return m_fIsOpen;
     185    switch (m_enmType)
     186    {
     187        case Type_File:      return RTFileIsValid(u.File.hFile);
     188        case Type_Directory: return RTDirIsValid(u.Dir.hDir);
     189        default:             break;
     190    }
     191
     192    return false;
    193193}
    194194
     
    223223    AssertReturn(!(fFlags & ~DNDURIOBJECT_FLAGS_VALID_MASK), VERR_INVALID_FLAGS);
    224224    RT_NOREF1(fFlags);
    225 
    226     if (m_fIsOpen)
    227         return VINF_SUCCESS;
    228225
    229226    int rc = VINF_SUCCESS;
     
    301298    {
    302299        m_enmView = enmView;
    303         m_fIsOpen = true;
    304300    }
    305301
     
    312308 *
    313309 * @return  IPRT status code.
    314  * @param   enmView             View to use for querying information.
     310 * @param   enmView             View to use for querying information. Currently ignored.
    315311 */
    316312int DnDURIObject::queryInfoInternal(View enmView)
     
    323319    {
    324320        case Type_File:
     321            AssertMsgReturn(RTFileIsValid(u.File.hFile), ("Object has invalid file handle\n"), VERR_INVALID_STATE);
    325322            rc = RTFileQueryInfo(u.File.hFile, &u.File.objInfo, RTFSOBJATTRADD_NOTHING);
    326323            break;
    327324
    328325        case Type_Directory:
     326            AssertMsgReturn(RTDirIsValid(u.Dir.hDir), ("Object has invalid directory handle\n"), VERR_INVALID_STATE);
    329327            rc = RTDirQueryInfo(u.Dir.hDir, &u.Dir.objInfo, RTFSOBJATTRADD_NOTHING);
    330328            break;
     
    429427    /* pcbRead is optional. */
    430428
    431     AssertMsgReturn(m_fIsOpen, ("Object not in open state\n"), VERR_INVALID_STATE);
    432429    AssertMsgReturn(m_enmView == View_Source, ("Cannot write to an object which is not in target view\n"),
    433430                    VERR_INVALID_STATE);
     
    526523    /* pcbWritten is optional. */
    527524
    528     AssertMsgReturn(m_fIsOpen, ("Object not in open state\n"), VERR_INVALID_STATE);
    529525    AssertMsgReturn(m_enmView == View_Target, ("Cannot write to an object which is not in target view\n"),
    530526                    VERR_INVALID_STATE);
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