- Timestamp:
- Oct 19, 2018 7:52:44 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 125974
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.cpp
r74945 r74956 349 349 createItemForCloudProfile(pProviderItem, data, true); 350 350 351 /* If profile still Ok: */ 352 if (comCloudProfile.isOk()) 353 { 354 /* Acquire supported property names: */ 355 const QVector<QString> supportedNames = comCloudProfile.GetSupportedPropertyNames(); 356 /* Show error message if necessary: */ 357 if (!comCloudProfile.isOk()) 358 msgCenter().cannotAcquireCloudProfileParameter(comCloudProfile, this); 359 else 360 { 361 /* Add unknown supported properties to known properties list. 362 * That allows to have at least something if we have nothing. */ 363 foreach (const QString &strSupportedName, supportedNames) 364 if (!data.m_data.contains(strSupportedName)) 365 data.m_data[strSupportedName] = qMakePair(QString(), QString()); 366 } 367 } 368 369 /* If profile still Ok: */ 370 if (comCloudProfile.isOk()) 371 { 372 /* Now push known properties back to profile all together. 373 * That will rewrite empty profile with values gathered above. */ 374 const QVector<QString> updatedKeys = data.m_data.keys().toVector(); 375 QVector<QString> updatedValues; 376 typedef QPair<QString, QString> QStringPair; 377 foreach (const QStringPair &valuePair, data.m_data.values()) 378 updatedValues += valuePair.first; 379 comCloudProfile.SetProperties(updatedKeys, updatedValues); 380 /* Show error message if necessary: */ 381 if (!comCloudProfile.isOk()) 382 msgCenter().cannotAssignCloudProfileParameter(comCloudProfile, this); 383 else 384 { 385 /* Update profile in the tree: */ 386 UIDataCloudProfile updatedData; 387 loadCloudProfile(comCloudProfile, updatedData); 388 updateItemForCloudProfile(updatedData, true, static_cast<UIItemCloudProfile*>(m_pTreeWidget->currentItem())); 389 } 390 } 391 351 392 /* Save profile changes: */ 352 393 comCloudProvider.SaveProfiles();
Note:
See TracChangeset
for help on using the changeset viewer.