Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp	(revision 78296)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp	(revision 78297)
@@ -32,6 +32,5 @@
 
 
-template<class T>
-static QStringList toStringList(const QList<T> &list)
+template<class T> static QStringList toStringList(const QList<T> &list)
 {
     QStringList l;
@@ -60,12 +59,12 @@
 
     /** Contains medium enumeration task body. */
-    void run()
+    virtual void run() /* override */
     {
         /* Get medium: */
-        UIMedium medium = property("medium").value<UIMedium>();
+        UIMedium guiMedium = property("medium").value<UIMedium>();
         /* Enumerate it: */
-        medium.blockAndQueryState();
+        guiMedium.blockAndQueryState();
         /* Put it back: */
-        setProperty("medium", QVariant::fromValue(medium));
+        setProperty("medium", QVariant::fromValue(guiMedium));
     }
 };
@@ -79,13 +78,20 @@
 
     /* Prepare Main event handlers: */
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, this, &UIMediumEnumerator::sltHandleMachineUpdate);
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotTake,      this, &UIMediumEnumerator::sltHandleMachineUpdate);
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotDelete,    this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotChange,    this, &UIMediumEnumerator::sltHandleMachineUpdate);
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore,   this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
-    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered, this, &UIMediumEnumerator::sltHandleMachineRegistration);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange,
+            this, &UIMediumEnumerator::sltHandleMachineUpdate);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotTake,
+            this, &UIMediumEnumerator::sltHandleMachineUpdate);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotDelete,
+            this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotChange,
+            this, &UIMediumEnumerator::sltHandleMachineUpdate);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore,
+            this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
+    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered,
+            this, &UIMediumEnumerator::sltHandleMachineRegistration);
 
     /* Listen for global thread-pool: */
-    connect(vboxGlobal().threadPool(), &UIThreadPool::sigTaskComplete, this, &UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete);
+    connect(vboxGlobal().threadPool(), &UIThreadPool::sigTaskComplete,
+            this, &UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete);
 }
 
@@ -96,26 +102,25 @@
 }
 
-UIMedium UIMediumEnumerator::medium(const QUuid &uMediumID)
+UIMedium UIMediumEnumerator::medium(const QUuid &uMediumID) const
 {
     /* Search through current medium-map for the medium with passed ID: */
     if (m_media.contains(uMediumID))
-        return m_media[uMediumID];
+        return m_media.value(uMediumID);
     /* Return NULL medium otherwise: */
     return UIMedium();
 }
 
-void UIMediumEnumerator::createMedium(const UIMedium &medium)
+void UIMediumEnumerator::createMedium(const UIMedium &guiMedium)
 {
     /* Get medium ID: */
-    const QUuid uMediumID = medium.id();
+    const QUuid uMediumID = guiMedium.id();
 
     /* Do not create UIMedium(s) with incorrect ID: */
     AssertReturnVoid(!uMediumID.isNull());
-    AssertReturnVoid(uMediumID != UIMedium::nullID());
     /* Make sure medium doesn't exists already: */
     AssertReturnVoid(!m_media.contains(uMediumID));
 
     /* Insert medium: */
-    m_media[uMediumID] = medium;
+    m_media[uMediumID] = guiMedium;
     LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", uMediumID.toString().toUtf8().constData()));
 
@@ -128,5 +133,4 @@
     /* Do not delete UIMedium(s) with incorrect ID: */
     AssertReturnVoid(!uMediumID.isNull());
-    AssertReturnVoid(uMediumID != UIMedium::nullID());
     /* Make sure medium still exists: */
     AssertReturnVoid(m_media.contains(uMediumID));
@@ -140,5 +144,5 @@
 }
 
-void UIMediumEnumerator::enumerateMedia(const CMediumVector &mediaList /* = CMediumVector() */)
+void UIMediumEnumerator::enumerateMedia(const CMediumVector &inputMedia /* = CMediumVector() */)
 {
     /* Make sure we are not already in progress: */
@@ -150,5 +154,5 @@
     addNullMediumToMap(media);
     /* If @p mediaList is empty we start the media enumeration with all known media: */
-    if (mediaList.isEmpty())
+    if (inputMedia.isEmpty())
     {
         addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media);
@@ -162,5 +166,5 @@
         addMediaToMap(vboxGlobal().host().GetDVDDrives(), media);
         addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media);
-        addMediaToMap(mediaList, media);
+        addMediaToMap(inputMedia, media);
     }
     if (VBoxGlobal::isCleaningUp())
@@ -184,5 +188,5 @@
     /* Start enumeration for UIMedium(s) with correct ID: */
     foreach (const QUuid &uMediumID, m_media.keys())
-        if (!uMediumID.isNull() && uMediumID != UIMedium::nullID())
+        if (!uMediumID.isNull())
             createMediumEnumerationTask(m_media[uMediumID]);
 }
@@ -305,7 +309,8 @@
 
     /* Get enumerated UIMedium: */
-    const UIMedium uimedium = pTask->property("medium").value<UIMedium>();
-    const QUuid uUIMediumKey = uimedium.key();
-    LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} enumerated\n", uUIMediumKey.toString().toUtf8().constData()));
+    const UIMedium guiMedium = pTask->property("medium").value<UIMedium>();
+    const QUuid uMediumKey = guiMedium.key();
+    LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} enumerated\n",
+             uMediumKey.toString().toUtf8().constData()));
 
     /* Remove task from internal set: */
@@ -313,35 +318,38 @@
 
     /* Make sure such UIMedium still exists: */
-    if (!m_media.contains(uUIMediumKey))
-    {
-        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", uUIMediumKey.toString().toUtf8().constData()));
+    if (!m_media.contains(uMediumKey))
+    {
+        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n",
+                 uMediumKey.toString().toUtf8().constData()));
         return;
     }
 
     /* Check if UIMedium ID was changed: */
-    const QUuid uUIMediumID = uimedium.id();
+    const QUuid uMediumID = guiMedium.id();
     /* UIMedium ID was changed to nullID: */
-    if (uUIMediumID == UIMedium::nullID())
+    if (uMediumID == UIMedium::nullID())
     {
         /* Delete this medium: */
-        m_media.remove(uUIMediumKey);
-        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", uUIMediumKey.toString().toUtf8().constData()));
+        m_media.remove(uMediumKey);
+        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n",
+                 uMediumKey.toString().toUtf8().constData()));
 
         /* And notify listener about delete: */
-        emit sigMediumDeleted(uUIMediumKey);
+        emit sigMediumDeleted(uMediumKey);
     }
     /* UIMedium ID was changed to something proper: */
-    else if (uUIMediumID != uUIMediumKey)
+    else if (uMediumID != uMediumKey)
     {
         /* We have to reinject enumerated medium: */
-        m_media.remove(uUIMediumKey);
-        m_media[uUIMediumID] = uimedium;
-        m_media[uUIMediumID].setKey(uUIMediumID);
-        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", uUIMediumKey.toString().toUtf8().constData(),
-                                                                                           uUIMediumID.toString().toUtf8().constData()));
+        m_media.remove(uMediumKey);
+        m_media[uMediumID] = guiMedium;
+        m_media[uMediumID].setKey(uMediumID);
+        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n",
+                 uMediumKey.toString().toUtf8().constData(),
+                 uMediumID.toString().toUtf8().constData()));
 
         /* And notify listener about delete/create: */
-        emit sigMediumDeleted(uUIMediumKey);
-        emit sigMediumCreated(uUIMediumID);
+        emit sigMediumDeleted(uMediumKey);
+        emit sigMediumCreated(uMediumID);
     }
     /* UIMedium ID was not changed: */
@@ -349,9 +357,10 @@
     {
         /* Just update enumerated medium: */
-        m_media[uUIMediumID] = uimedium;
-        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", uUIMediumID.toString().toUtf8().constData()));
+        m_media[uMediumID] = guiMedium;
+        LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n",
+                 uMediumID.toString().toUtf8().constData()));
 
         /* And notify listener about update: */
-        emit sigMediumEnumerated(uUIMediumID);
+        emit sigMediumEnumerated(uMediumID);
     }
 
@@ -373,8 +382,8 @@
 }
 
-void UIMediumEnumerator::createMediumEnumerationTask(const UIMedium &medium)
+void UIMediumEnumerator::createMediumEnumerationTask(const UIMedium &guiMedium)
 {
     /* Prepare medium-enumeration task: */
-    UITask *pTask = new UITaskMediumEnumeration(medium);
+    UITask *pTask = new UITaskMediumEnumeration(guiMedium);
     /* Append to internal set: */
     m_tasks << pTask;
@@ -387,7 +396,8 @@
     /* Insert NULL uimedium to the passed uimedium map.
      * Get existing one from the previous map if any. */
-    QUuid uNullMediumID = UIMedium::nullID();
-    UIMedium uimedium = m_media.contains(uNullMediumID) ? m_media[uNullMediumID] : UIMedium();
-    media.insert(uNullMediumID, uimedium);
+    const UIMedium guiMedium = m_media.contains(UIMedium::nullID())
+                             ? m_media[UIMedium::nullID()]
+                             : UIMedium();
+    media.insert(UIMedium::nullID(), guiMedium);
 }
 
@@ -396,5 +406,5 @@
     /* Insert hard-disks to the passed uimedium map.
      * Get existing one from the previous map if any. */
-    foreach (CMedium medium, inputMedia)
+    foreach (const CMedium &comMedium, inputMedia)
     {
         /* If VBoxGlobal is cleaning up, abort immediately: */
@@ -403,13 +413,13 @@
 
         /* Prepare uimedium on the basis of current medium: */
-        QUuid uMediumID = medium.GetId();
-        UIMedium uimedium = m_media.contains(uMediumID) ? m_media[uMediumID] :
-            UIMedium(medium, UIMediumDefs::mediumTypeToLocal(medium.GetDeviceType()));
-
+        const QUuid uMediumID = comMedium.GetId();
+        const UIMedium guiMedium = m_media.contains(uMediumID)
+                                 ? m_media.value(uMediumID)
+                                 : UIMedium(comMedium, UIMediumDefs::mediumTypeToLocal(comMedium.GetDeviceType()));
         /* Insert uimedium into map: */
-        outputMedia.insert(uimedium.id(), uimedium);
+        outputMedia.insert(guiMedium.id(), guiMedium);
 
         /* Insert medium children into map too: */
-        addMediaToMap(medium.GetChildren(), outputMedia);
+        addMediaToMap(comMedium.GetChildren(), outputMedia);
     }
 }
@@ -421,18 +431,21 @@
  * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
  */
-void UIMediumEnumerator::calculateCachedUsage(const QUuid &uMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const
+void UIMediumEnumerator::calculateCachedUsage(const QUuid &uMachineID,
+                                              QList<QUuid> &previousUIMediumIDs,
+                                              const bool fTakeIntoAccountCurrentStateOnly) const
 {
     /* For each the UIMedium ID cache have: */
-    foreach (const QUuid &uMediumID, mediumIDs())
+    foreach (const QUuid &uUIMediumID, mediumIDs())
     {
         /* Get corresponding UIMedium: */
-        const UIMedium &uimedium = m_media[uMediumID];
+        const UIMedium &guiMedium = m_media[uUIMediumID];
         /* Get the list of the machines this UIMedium attached to.
          * Take into account current-state only if necessary. */
-        const QList<QUuid> &machineIDs = fTakeIntoAccountCurrentStateOnly ?
-                                           uimedium.curStateMachineIds() : uimedium.machineIds();
+        const QList<QUuid> &machineIDs = fTakeIntoAccountCurrentStateOnly
+                                       ? guiMedium.curStateMachineIds()
+                                       : guiMedium.machineIds();
         /* Add this UIMedium ID to previous usage if necessary: */
         if (machineIDs.contains(uMachineID))
-            previousUIMediumIDs.append(uMediumID);
+            previousUIMediumIDs.append(uUIMediumID);
     }
 }
@@ -445,9 +458,12 @@
  * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
  */
-void UIMediumEnumerator::calculateActualUsage(const QUuid &uMachineID, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const
+void UIMediumEnumerator::calculateActualUsage(const QUuid &uMachineID,
+                                              CMediumMap &currentCMediums,
+                                              QList<QUuid> &currentCMediumIDs,
+                                              const bool fTakeIntoAccountCurrentStateOnly) const
 {
     /* Search for corresponding machine: */
-    CMachine machine = vboxGlobal().virtualBox().FindMachine(uMachineID.toString());
-    if (machine.isNull())
+    CMachine comMachine = vboxGlobal().virtualBox().FindMachine(uMachineID.toString());
+    if (comMachine.isNull())
     {
         /* Usually means the machine is already gone, not harmful. */
@@ -457,7 +473,8 @@
     /* Calculate actual usage starting from root-snapshot if necessary: */
     if (!fTakeIntoAccountCurrentStateOnly)
-        calculateActualUsage(machine.FindSnapshot(QString()), currentCMediums, currentCMediumIDs);
+        calculateActualUsage(comMachine.FindSnapshot(QString()), currentCMediums, currentCMediumIDs);
+
     /* Calculate actual usage for current machine state: */
-    calculateActualUsage(machine, currentCMediums, currentCMediumIDs);
+    calculateActualUsage(comMachine, currentCMediums, currentCMediumIDs);
 }
 
@@ -468,16 +485,18 @@
  * @param currentCMediumIDs receives CMedium IDs used in actual data.
  */
-void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const
+void UIMediumEnumerator::calculateActualUsage(const CSnapshot &comSnapshot,
+                                              CMediumMap &currentCMediums,
+                                              QList<QUuid> &currentCMediumIDs) const
 {
     /* Check passed snapshot: */
-    if (snapshot.isNull())
+    if (comSnapshot.isNull())
         return;
 
     /* Calculate actual usage for passed snapshot machine: */
-    calculateActualUsage(snapshot.GetMachine(), currentCMediums, currentCMediumIDs);
+    calculateActualUsage(comSnapshot.GetMachine(), currentCMediums, currentCMediumIDs);
 
     /* Iterate through passed snapshot children: */
-    foreach (const CSnapshot &childSnapshot, snapshot.GetChildren())
-        calculateActualUsage(childSnapshot, currentCMediums, currentCMediumIDs);
+    foreach (const CSnapshot &comChildSnapshot, comSnapshot.GetChildren())
+        calculateActualUsage(comChildSnapshot, currentCMediums, currentCMediumIDs);
 }
 
@@ -488,22 +507,24 @@
  * @param currentCMediumIDs receives CMedium IDs used in actual data.
  */
-void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const
+void UIMediumEnumerator::calculateActualUsage(const CMachine &comMachine,
+                                              CMediumMap &currentCMediums,
+                                              QList<QUuid> &currentCMediumIDs) const
 {
     /* Check passed machine: */
-    AssertReturnVoid(!machine.isNull());
+    AssertReturnVoid(!comMachine.isNull());
 
     /* For each the attachment machine have: */
-    foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
+    foreach (const CMediumAttachment &comAttachment, comMachine.GetMediumAttachments())
     {
         /* Get corresponding CMedium: */
-        CMedium cmedium = attachment.GetMedium();
-        if (!cmedium.isNull())
+        CMedium comMedium = comAttachment.GetMedium();
+        if (!comMedium.isNull())
         {
             /* Make sure that CMedium was not yet closed: */
-            const QUuid uCMediumID = cmedium.GetId();
-            if (cmedium.isOk() && !uCMediumID.isNull())
+            const QUuid &uCMediumID = comMedium.GetId();
+            if (comMedium.isOk() && !uCMediumID.isNull())
             {
                 /* Add this CMedium to current usage: */
-                currentCMediums.insert(uCMediumID, cmedium);
+                currentCMediums.insert(uCMediumID, comMedium);
                 currentCMediumIDs.append(uCMediumID);
             }
@@ -519,20 +540,20 @@
 {
     /* For each of previously used UIMedium ID: */
-    foreach (const QUuid &uMediumID, previousUIMediumIDs)
+    foreach (const QUuid &uUIMediumID, previousUIMediumIDs)
     {
         /* Make sure this ID still in our map: */
-        if (m_media.contains(uMediumID))
+        if (m_media.contains(uUIMediumID))
         {
             /* Get corresponding UIMedium: */
-            UIMedium &uimedium = m_media[uMediumID];
+            UIMedium &guiMedium = m_media[uUIMediumID];
 
             /* If corresponding CMedium still exists: */
-            CMedium cmedium = uimedium.medium();
-            if (!cmedium.GetId().isNull() && cmedium.isOk())
+            CMedium comMedium = guiMedium.medium();
+            if (!comMedium.GetId().isNull() && comMedium.isOk())
             {
                 /* Refresh UIMedium parent first of all: */
-                uimedium.updateParentID();
+                guiMedium.updateParentID();
                 /* Enumerate corresponding UIMedium: */
-                createMediumEnumerationTask(uimedium);
+                createMediumEnumerationTask(guiMedium);
             }
             /* If corresponding CMedium was closed already: */
@@ -540,9 +561,10 @@
             {
                 /* Uncache corresponding UIMedium: */
-                m_media.remove(uMediumID);
-                LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} uncached\n", uMediumID.toString().toUtf8().constData()));
+                m_media.remove(uUIMediumID);
+                LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} uncached\n",
+                         uUIMediumID.toString().toUtf8().constData()));
 
                 /* And notify listeners: */
-                emit sigMediumDeleted(uMediumID);
+                emit sigMediumDeleted(uUIMediumID);
             }
         }
@@ -555,5 +577,6 @@
  * @param currentCMediumIDs reflects CMedium IDs used in actual data.
  */
-void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap &currentCMediums, const QList<QUuid> &currentCMediumIDs)
+void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap &currentCMediums,
+                                                const QList<QUuid> &currentCMediumIDs)
 {
     /* For each of currently used CMedium ID: */
@@ -564,11 +587,12 @@
         {
             /* Create new UIMedium: */
-            const CMedium &cmedium = currentCMediums[uCMediumID];
-            UIMedium uimedium(cmedium, UIMediumDefs::mediumTypeToLocal(cmedium.GetDeviceType()));
-            QUuid uUIMediumKey = uimedium.key();
+            const CMedium &comMedium = currentCMediums[uCMediumID];
+            const UIMedium guiMedium(comMedium, UIMediumDefs::mediumTypeToLocal(comMedium.GetDeviceType()));
+            const QUuid &uUIMediumKey = guiMedium.key();
 
             /* Cache created UIMedium: */
-            m_media.insert(uUIMediumKey, uimedium);
-            LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} cached\n", uUIMediumKey.toString().toUtf8().constData()));
+            m_media.insert(uUIMediumKey, guiMedium);
+            LogRel2(("GUI: UIMediumEnumerator:  Medium with key={%s} cached\n",
+                     uUIMediumKey.toString().toUtf8().constData()));
 
             /* And notify listeners: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h	(revision 78296)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h	(revision 78297)
@@ -62,11 +62,11 @@
     /* API: Medium-access stuff: */
     QList<QUuid> mediumIDs() const;
-    UIMedium medium(const QUuid &uMediumID);
-    void createMedium(const UIMedium &medium);
+    UIMedium medium(const QUuid &uMediumID) const;
+    void createMedium(const UIMedium &guiMedium);
     void deleteMedium(const QUuid &uMediumID);
 
     /* API: Medium-enumeration stuff: */
     bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; }
-    void enumerateMedia(const CMediumVector &mediaList = CMediumVector());
+    void enumerateMedia(const CMediumVector &inputMedia = CMediumVector());
     void refreshMedia();
 
@@ -89,20 +89,30 @@
 
     /* Helpers: Medium-enumeration stuff: */
-    void createMediumEnumerationTask(const UIMedium &medium);
-    void addNullMediumToMap(UIMediumMap &media);
+    void createMediumEnumerationTask(const UIMedium &guiMedium);
+    void addNullMediumToMap(UIMediumMap &outputMedia);
     void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia);
 
     /* Helpers: Medium re-caching stuff: */
-    void calculateCachedUsage(const QUuid &uMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const;
-    void calculateActualUsage(const QUuid &uMachineID, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const;
-    void calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const;
-    void calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const;
+    void calculateCachedUsage(const QUuid &uMachineID,
+                              QList<QUuid> &previousUIMediumIDs,
+                              const bool fTakeIntoAccountCurrentStateOnly) const;
+    void calculateActualUsage(const QUuid &uMachineID,
+                              CMediumMap &currentCMediums,
+                              QList<QUuid> &currentCMediumIDs,
+                              const bool fTakeIntoAccountCurrentStateOnly) const;
+    void calculateActualUsage(const CSnapshot &comSnapshot,
+                              CMediumMap &currentCMediums,
+                              QList<QUuid> &currentCMediumIDs) const;
+    void calculateActualUsage(const CMachine &comMachine,
+                              CMediumMap &currentCMediums,
+                              QList<QUuid> &currentCMediumIDs) const;
     void recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs);
-    void recacheFromActualUsage(const CMediumMap &currentCMediums, const QList<QUuid> &currentCMediumIDs);
+    void recacheFromActualUsage(const CMediumMap &currentCMediums,
+                                const QList<QUuid> &currentCMediumIDs);
 
     /* Variables: */
-    bool m_fMediumEnumerationInProgress;
-    QSet<UITask*> m_tasks;
-    UIMediumMap m_media;
+    bool  m_fMediumEnumerationInProgress;
+    QSet<UITask*>  m_tasks;
+    UIMediumMap  m_media;
 };
 
