Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp	(revision 91668)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp	(revision 91669)
@@ -60,4 +60,5 @@
     , m_enmMode(Mode_Folder)
     , m_strInitialPath(QDir::current().absolutePath())
+    , m_fResetEnabled(true)
     , m_fEditable(true)
     , m_fModified(false)
@@ -66,4 +67,5 @@
     , m_fToolTipOverriden(false)
     , m_pCopyAction(new QAction(this))
+    , m_iRecentListSeparatorPosition(ResetId + 1)
     , m_enmRecentMediaListType(UIMediumDeviceType_Invalid)
 {
@@ -154,4 +156,10 @@
 void UIFilePathSelector::setResetEnabled(bool fEnabled)
 {
+    /* Cache requested state: */
+    m_fResetEnabled = fEnabled;
+
+    /* Update recent list separator position: */
+    m_iRecentListSeparatorPosition = fEnabled ? ResetId + 1 : ResetId;
+
     if (!fEnabled && count() - 1 == ResetId)
         removeItem(ResetId);
@@ -344,29 +352,23 @@
 void UIFilePathSelector::onActivated(int iIndex)
 {
-    switch (iIndex)
-    {
-        case SelectId:
-        {
-            selectPath();
-            break;
-        }
-        case ResetId:
-        {
-            if (m_strDefaultPath.isEmpty())
-                changePath(QString());
-            else
-                changePath(m_strDefaultPath);
-            break;
-        }
-        default:
-        {
-            if (iIndex >= RecentListSeparator)
-            {
-                changePath(itemText(iIndex));
-                update();
-            }
-            break;
-        }
-    }
+    /* Since the presence of ResetId and position of recent list separator
+     * are dynamical now, we should control condition more carefully: */
+    if (iIndex == SelectId)
+        selectPath();
+    else if (m_fResetEnabled && iIndex == ResetId)
+    {
+        if (m_strDefaultPath.isEmpty())
+            changePath(QString());
+        else
+            changePath(m_strDefaultPath);
+    }
+    else if (iIndex >= m_iRecentListSeparatorPosition)
+    {
+        /* Switch back to Path item early, lineEdit() in refreshText()
+         * should be related to this exactly item: */
+        setCurrentIndex(PathId);
+        changePath(itemText(iIndex));
+    }
+
     setCurrentIndex(PathId);
     setFocus();
@@ -390,5 +392,5 @@
                                     bool fRefreshText /* = true */)
 {
-    const QString strOldPath = m_strPath;
+    const QString strOldPath = QDir::toNativeSeparators(m_strPath);
     setPath(strPath, fRefreshText);
     if (!m_fModified && m_strPath != strOldPath)
@@ -613,8 +615,6 @@
 {
     /* Remove the recent media list from the end of the combo: */
-    while (count() >= static_cast<int>(RecentListSeparator))
-    {
+    while (count() >= m_iRecentListSeparatorPosition)
         removeItem(count() - 1);
-    }
 
 
@@ -641,5 +641,5 @@
         return;
 
-    insertSeparator(RecentListSeparator);
+    insertSeparator(m_iRecentListSeparatorPosition);
     foreach (const QString strPath, recentMedia)
         addItem(strPath);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h	(revision 91668)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h	(revision 91669)
@@ -66,6 +66,5 @@
         PathId = 0,
         SelectId,
-        ResetId,
-        RecentListSeparator
+        ResetId
     };
 
@@ -205,4 +204,7 @@
     QString  m_strNoneToolTipFocused;
 
+    /** Holds whether editor has Reset action. */
+    bool     m_fResetEnabled;
+
     /** Holds whether the path is editable. */
     bool     m_fEditable;
@@ -224,4 +226,6 @@
     QString m_strDefaultPath;
 
+    /** Holds the recent list separator position. */
+    int                 m_iRecentListSeparatorPosition;
     /** Holds whether medium type for recent media list. If it is UIMediumDeviceType_Invalid the recent list is not shown. */
     UIMediumDeviceType  m_enmRecentMediaListType;
