Index: /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp	(revision 48277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp	(revision 48278)
@@ -28,6 +28,6 @@
 #include "UIMedium.h"
 #include "VBoxGlobal.h"
+#include "UIConverter.h"
 #include "UIMessageCenter.h"
-#include "UIConverter.h"
 
 /* COM includes: */
@@ -39,4 +39,38 @@
 QString UIMedium::m_sstrTable = QString("<table>%1</table>");
 QString UIMedium::m_sstrRow = QString("<tr><td>%1</td></tr>");
+
+UIMedium::UIMedium()
+    : m_type(UIMediumType_Invalid)
+    , m_state(KMediumState_NotCreated)
+    , m_pParent(0)
+{
+    refresh();
+//    printf("UIMedium: New NULL medium created.\n");
+}
+
+UIMedium::UIMedium(const CMedium &medium, UIMediumType type, UIMedium *pParent /*= 0*/)
+    : m_medium(medium)
+    , m_type(type)
+    , m_state(KMediumState_NotCreated)
+    , m_pParent(pParent)
+{
+    refresh();
+//    printf("UIMedium: New medium with ID={%s} created.\n", id().toAscii().constData());
+}
+
+UIMedium::UIMedium(const CMedium &medium, UIMediumType type, KMediumState state)
+    : m_medium(medium)
+    , m_type(type)
+    , m_state(state)
+    , m_pParent(0)
+{
+    refresh();
+//    printf("UIMedium: New medium with ID={%s} created (with known state).\n", id().toAscii().constData());
+}
+
+UIMedium::UIMedium(const UIMedium &other)
+{
+    *this = other;
+}
 
 UIMedium& UIMedium::operator=(const UIMedium &other)
@@ -132,6 +166,7 @@
     m_fHostDrive = false;
 
-    /* Detect basic parameters */
-    m_strId = m_medium.isNull() ? QUuid().toString().remove ('{').remove ('}') : m_medium.GetId();
+    /* Detect basic parameters... */
+
+    m_strId = m_medium.isNull() ? nullID() : m_medium.GetId();
 
     m_fHostDrive = m_medium.isNull() ? false : m_medium.GetHostDrive();
@@ -252,17 +287,16 @@
                 QString strSnapshots;
 
-                QVector <QString> snapIds = m_medium.GetSnapshotIds(strMachineID);
-                for (QVector <QString>::ConstIterator jt = snapIds.begin(); jt != snapIds.end(); ++jt)
+                foreach (const QString &strSnapshotID, m_medium.GetSnapshotIds(strMachineID))
                 {
-                    if (*jt == strMachineID)
+                    if (strSnapshotID == strMachineID)
                     {
                         /* The medium is attached to the machine in the current
                          * state, we don't distinguish this for now by always
                          * giving the VM name in front of snapshot names. */
-                        m_curStateMachineIds.push_back(*jt);
+                        m_curStateMachineIds.push_back(strSnapshotID);
                         continue;
                     }
 
-                    CSnapshot snapshot = machine.FindSnapshot(*jt);
+                    CSnapshot snapshot = machine.FindSnapshot(strSnapshotID);
                     if (!snapshot.isNull()) // can be NULL while takeSnaphot is in progress
                     {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h	(revision 48277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h	(revision 48278)
@@ -83,41 +83,21 @@
 public:
 
-    /**
-     * Creates a null medium descriptor which is not associated with any medium.
-     * The state field is set to KMediumState_NotCreated.
-     */
-    UIMedium()
-        : m_type(UIMediumType_Invalid)
-        , m_state(KMediumState_NotCreated)
-        , m_pParent(0) { refresh(); }
-
-    /**
-     * Creates a media descriptor associated with the given medium.
-     *
-     * The state field remain KMediumState_NotCreated until #blockAndQueryState()
-     * is called. All precomposed strings are filled up by implicitly calling
-     * #refresh(), see the #refresh() details for more info.
-     *
-     * One of the hardDisk, dvdImage, or floppyImage members is assigned from
-     * medium according to type. @a pParent must be always NULL for non-hard
-     * disk media.
-     */
-    UIMedium(const CMedium &medium, UIMediumType type, UIMedium *pParent = 0)
-        : m_medium(medium)
-        , m_type(type)
-        , m_state(KMediumState_NotCreated)
-        , m_pParent(pParent) { refresh(); }
-
-    /**
-     * Similar to the other non-null constructor but sets the media state to
-     * @a state. Suitable when the media state is known such as right after
-     * creation.
-     */
-    UIMedium(const CMedium &medium, UIMediumType type, KMediumState state)
-        : m_medium(medium)
-        , m_type(type)
-        , m_state(state)
-        , m_pParent(0) { refresh(); }
-
+    /* Default (NULL) constructor:
+     * Creates NULL uimedium which is not associated with any medium. */
+    UIMedium();
+
+    /* Lazy wrapping constructor:
+     * Creates a uimedium associated with the given medium. */
+    UIMedium(const CMedium &medium, UIMediumType type, UIMedium *pParent = 0);
+
+    /* Wrapping constructor with known medium state:
+     * Similar to previous one but sets the uimedium state to passed one.
+     * Suitable when the medium-state is known such as right after medium creation. */
+    UIMedium(const CMedium &medium, UIMediumType type, KMediumState state);
+
+    /* Copy-constructor: */
+    UIMedium(const UIMedium &other);
+
+    /* API: Operator=: */
     UIMedium& operator=(const UIMedium &other);
 
