Changeset 86894 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 16, 2020 3:15:56 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r86860 r86894 140 140 void prepareEditorContents(); 141 141 142 /** Returns a list of default key folders. */ 143 QStringList defaultKeyFolders() const; 144 142 145 /** Loads file contents. 143 146 * @returns Whether file was really loaded. */ … … 246 249 void UIAcquirePublicKeyDialog::prepareEditorContents() 247 250 { 251 /* Check whether we were able to load key file: */ 252 bool fFileLoaded = false; 253 248 254 /* Try to load last remembered file contents: */ 249 if (!loadFileContents(gEDataManager->cloudConsolePublicKeyPath(), true /* ignore errors */)) 255 fFileLoaded = loadFileContents(gEDataManager->cloudConsolePublicKeyPath(), true /* ignore errors */); 256 if (!fFileLoaded) 250 257 { 251 258 /* We have failed to load file mentioned in extra-data, now we have 252 259 * to check whether file present in one of default paths: */ 253 QStringList paths;254 #ifdef VBOX_WS_WIN255 // WORKAROUND:256 // There is additional default path on Windows:257 paths << QDir(QDir::homePath()).absoluteFilePath("oci");258 #endif259 paths << QDir(QDir::homePath()).absoluteFilePath(".ssh");260 261 /* Look for required file in one of those paths: */262 260 QString strAbsoluteFilePathWeNeed; 263 foreach (const QString &strPath, paths)261 foreach (const QString &strPath, defaultKeyFolders()) 264 262 { 265 263 /* Gather possible file names, there can be few of them: */ … … 284 282 /* Try to open file if it was really found: */ 285 283 if (!strAbsoluteFilePathWeNeed.isEmpty()) 286 loadFileContents(strAbsoluteFilePathWeNeed, true /* ignore errors */); 287 } 284 fFileLoaded = loadFileContents(strAbsoluteFilePathWeNeed, true /* ignore errors */); 285 } 286 } 287 288 QStringList UIAcquirePublicKeyDialog::defaultKeyFolders() const 289 { 290 QStringList folders; 291 #ifdef VBOX_WS_WIN 292 // WORKAROUND: 293 // There is additional default folder on Windows: 294 folders << QDir::toNativeSeparators(QDir(QDir::homePath()).absoluteFilePath("oci")); 295 #endif 296 folders << QDir::toNativeSeparators(QDir(QDir::homePath()).absoluteFilePath(".ssh")); 297 return folders; 288 298 } 289 299
Note:
See TracChangeset
for help on using the changeset viewer.