VirtualBox

Changeset 79152 in vbox


Ignore:
Timestamp:
Jun 14, 2019 1:22:08 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131319
Message:

FE/Qt: bugref:7127: Improvement for UIMediumEnumerator: When some medium being unregistered we should enumerate it's first-level children to update their parent references; This is possible within snapshot tree architecture represented by differencing disks, while deleting snapshot having children.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium
Files:
2 edited

Legend:

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

    r79151 r79152  
    503503            /* And notify listeners: */
    504504            emit sigMediumDeleted(uMediumId);
     505
     506            /* Besides that we should enumerate all the
     507             * 1st level children of deleted medium: */
     508            QList<QUuid> result;
     509            enumerateAllMediaOfMediumWithId(uMediumId, result);
    505510        }
    506511    }
     
    897902}
    898903
     904void UIMediumEnumerator::enumerateAllMediaOfMediumWithId(const QUuid &uParentMediumId, QList<QUuid> &result)
     905{
     906    /* For each the cached UIMedium we have: */
     907    foreach (const QUuid &uMediumId, mediumIDs())
     908    {
     909        /* Check if medium isn't NULL, and is
     910         * a child of specified parent medium. */
     911        const UIMedium guiMedium = medium(uMediumId);
     912        if (   !guiMedium.isNull()
     913            && guiMedium.parentID() == uParentMediumId)
     914        {
     915            /* Enumerate corresponding UIMedium: */
     916            //printf(" Medium to recache: %s\n",
     917            //       uMediumId.toString().toUtf8().constData());
     918            LogRel2(("GUI: UIMediumEnumerator:  Medium {%s} a child of medium {%s} will be enumerated..\n",
     919                     uMediumId.toString().toUtf8().constData(),
     920                     uParentMediumId.toString().toUtf8().constData()));
     921            createMediumEnumerationTask(guiMedium);
     922            result << uMediumId;
     923        }
     924    }
     925}
     926
    899927#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    900928
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r79150 r79152  
    199199      *                 IDs to be appended with newly enumerated. */
    200200    void enumerateAllMediaOfMachineWithId(const QUuid &uMachineId, QList<QUuid> &result);
     201    /** Enumerates all the children media of medium with certain @a uMediumId.
     202      * @param  result  Brings the list of previously enumerated media
     203      *                 IDs to be appended with newly enumerated. */
     204    void enumerateAllMediaOfMediumWithId(const QUuid &uMediumId, QList<QUuid> &result);
    201205#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    202206
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette