Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86893)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86894)
@@ -140,4 +140,7 @@
     void prepareEditorContents();
 
+    /** Returns a list of default key folders. */
+    QStringList defaultKeyFolders() const;
+
     /** Loads file contents.
       * @returns Whether file was really loaded. */
@@ -246,20 +249,15 @@
 void UIAcquirePublicKeyDialog::prepareEditorContents()
 {
+    /* Check whether we were able to load key file: */
+    bool fFileLoaded = false;
+
     /* Try to load last remembered file contents: */
-    if (!loadFileContents(gEDataManager->cloudConsolePublicKeyPath(), true /* ignore errors */))
+    fFileLoaded = loadFileContents(gEDataManager->cloudConsolePublicKeyPath(), true /* ignore errors */);
+    if (!fFileLoaded)
     {
         /* We have failed to load file mentioned in extra-data, now we have
          * to check whether file present in one of default paths: */
-        QStringList paths;
-#ifdef VBOX_WS_WIN
-        // WORKAROUND:
-        // There is additional default path on Windows:
-        paths << QDir(QDir::homePath()).absoluteFilePath("oci");
-#endif
-        paths << QDir(QDir::homePath()).absoluteFilePath(".ssh");
-
-        /* Look for required file in one of those paths: */
         QString strAbsoluteFilePathWeNeed;
-        foreach (const QString &strPath, paths)
+        foreach (const QString &strPath, defaultKeyFolders())
         {
             /* Gather possible file names, there can be few of them: */
@@ -284,6 +282,18 @@
         /* Try to open file if it was really found: */
         if (!strAbsoluteFilePathWeNeed.isEmpty())
-            loadFileContents(strAbsoluteFilePathWeNeed, true /* ignore errors */);
-    }
+            fFileLoaded = loadFileContents(strAbsoluteFilePathWeNeed, true /* ignore errors */);
+    }
+}
+
+QStringList UIAcquirePublicKeyDialog::defaultKeyFolders() const
+{
+    QStringList folders;
+#ifdef VBOX_WS_WIN
+    // WORKAROUND:
+    // There is additional default folder on Windows:
+    folders << QDir::toNativeSeparators(QDir(QDir::homePath()).absoluteFilePath("oci"));
+#endif
+    folders << QDir::toNativeSeparators(QDir(QDir::homePath()).absoluteFilePath(".ssh"));
+    return folders;
 }
 
