VirtualBox

Changeset 55544 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 30, 2015 11:14:40 AM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7127: Medium-enumeration improvements: On machine-data change GUI should update all excluded and currently used (by that machine) mediums, not only excluded and included.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r55359 r55544  
    197197            currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toAscii().constData()));
    198198
    199     /* Determine excluded/included mediums: */
    200     QSet<QString> oldSet = previousUIMediumIDs.toSet();
    201     QSet<QString> newSet = currentCMediumIDs.toSet();
    202     QSet<QString> excludedSet = oldSet - newSet;
    203     QSet<QString> includedSet = newSet - oldSet;
    204     QStringList excludedList = excludedSet.toList();
    205     QStringList includedList = includedSet.toList();
    206     if (!excludedList.isEmpty())
    207         LogRel(("UIMediumEnumerator:  Items excluded from usage: %s\n", excludedList.join(", ").toAscii().constData()));
    208     if (!includedList.isEmpty())
    209         LogRel(("UIMediumEnumerator:  Items included into usage: %s\n", includedList.join(", ").toAscii().constData()));
     199    /* Determine excluded mediums: */
     200    const QSet<QString> previousSet = previousUIMediumIDs.toSet();
     201    const QSet<QString> currentSet = currentCMediumIDs.toSet();
     202    const QSet<QString> excludedSet = previousSet - currentSet;
     203    const QStringList excludedUIMediumIDs = excludedSet.toList();
     204    if (!excludedUIMediumIDs.isEmpty())
     205        LogRel(("UIMediumEnumerator:  Items excluded from usage: %s\n", excludedUIMediumIDs.join(", ").toAscii().constData()));
     206    if (!currentCMediumIDs.isEmpty())
     207        LogRel(("UIMediumEnumerator:  Items currently in usage: %s\n", currentCMediumIDs.join(", ").toAscii().constData()));
    210208
    211209    /* Update cache for excluded UIMediums: */
    212     recacheFromCachedUsage(excludedList);
    213 
    214     /* Update cache for included CMediums: */
    215     recacheFromActualUsage(currentCMediums, includedList);
     210    recacheFromCachedUsage(excludedUIMediumIDs);
     211
     212    /* Update cache for current CMediums: */
     213    recacheFromActualUsage(currentCMediums, currentCMediumIDs);
    216214
    217215    LogRel(("UIMediumEnumerator: Machine (or snapshot) event processed, ID = %s\n",
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