VirtualBox

Changeset 92031 in vbox


Ignore:
Timestamp:
Oct 25, 2021 1:19:48 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: Don't show the media that has been removed in UIFilePathSelector recent media list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp

    r91681 r92031  
    620620        removeItem(count() - 1);
    621621
    622 
    623622    if (enmMediumType != m_enmRecentMediaListType)
    624623        return;
     
    640639    }
    641640
    642     if (recentMedia.isEmpty())
     641    /* Remove the media which is not there not not readable: */
     642    QStringList existingMedia;
     643    foreach (QString strMediaPath, recentMedia)
     644    {
     645        QFileInfo info(strMediaPath);
     646        if (info.exists() && info.isReadable())
     647            existingMedia << strMediaPath;
     648    }
     649    if (existingMedia.isEmpty())
    643650        return;
    644651
    645652    insertSeparator(m_iRecentListSeparatorPosition);
    646     foreach (const QString strPath, recentMedia)
     653    foreach (const QString strPath, existingMedia)
    647654        addItem(strPath);
    648655}
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