VirtualBox

Ignore:
Timestamp:
Jan 17, 2024 3:03:04 PM (11 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Use the old way of populating drive letters in case IGuestSession::getMountPoints throws and error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r102798 r102928  
    996996        return;
    997997
    998     /** @todo Currently API lacks a way to query windows drive letters.
    999      *  so we enumarate them by using CGuestSession::DirectoryExists() */
    1000998    m_driveLetterList.clear();
    1001 #if 0
    1002     for (int i = 'A'; i <= 'Z'; ++i)
    1003     {
    1004         QString path((char)i);
    1005         path += ":/";
    1006         bool exists = m_comGuestSession.DirectoryExists(path, false /* aFollowSymlinks */);
    1007         if (exists)
    1008             m_driveLetterList.push_back(path);
    1009     }
    1010 #endif
    1011999
    10121000    QVector<QString> mountPoints = m_comGuestSession.GetMountPoints();
    1013     foreach (const QString &strPoint, mountPoints)
    1014         m_driveLetterList.push_back(UIPathOperations::replaceDosDelimeter(strPoint));
     1001    if (m_comGuestSession.isOk())
     1002    {
     1003        foreach (const QString &strPoint, mountPoints)
     1004            m_driveLetterList.push_back(UIPathOperations::replaceDosDelimeter(strPoint));
     1005    }
     1006    else
     1007    {
     1008        for (int i = 'A'; i <= 'Z'; ++i)
     1009        {
     1010            QString path((char)i);
     1011            path += ":/";
     1012            bool exists = m_comGuestSession.DirectoryExists(path, false /* aFollowSymlinks */);
     1013            if (exists)
     1014                m_driveLetterList.push_back(path);
     1015        }
     1016    }
    10151017}
    10161018
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