- Timestamp:
- May 12, 2009 12:10:14 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r19280 r19610 2484 2484 return S_OK; 2485 2485 2486 Utf8Str val; 2487 HRESULT rc = getExtraData(Utf8Str(aKey), val); 2488 if (SUCCEEDED(rc)) 2489 val.cloneTo (aValue); 2490 2491 return rc; 2492 } 2493 2494 HRESULT Machine::getExtraData(const Utf8Str &aKey, Utf8Str &aValue) 2495 { 2486 2496 HRESULT rc = S_OK; 2487 2497 … … 2498 2508 rc = VirtualBox::loadSettingsTree_Again (tree, file); 2499 2509 CheckComRCReturnRC (rc); 2500 2501 const Utf8Str key = aKey;2502 2510 2503 2511 Key machineNode = tree.rootKey().key ("Machine"); … … 2511 2519 it != items.end(); ++ it) 2512 2520 { 2513 if ( key == (*it).stringValue ("name"))2521 if (aKey == (*it).stringValue ("name")) 2514 2522 { 2515 Bstr val = (*it).stringValue ("value"); 2516 val.cloneTo (aValue); 2523 aValue = (*it).stringValue ("value"); 2517 2524 break; 2518 2525 } … … 7587 7594 } 7588 7595 7589 if (RT_FAILURE(vrc)) 7590 { 7596 if (RT_FAILURE(vrc)) 7597 { 7591 7598 mData->mHandleCfgFile = NIL_RTFILE; 7592 7599 mData->mConfigFileReadonly = FALSE; … … 11261 11268 if (deleteSavedState == true) 11262 11269 { 11263 Assert (!mSSData->mStateFilePath.isEmpty()); 11264 RTFileDelete (Utf8Str (mSSData->mStateFilePath)); 11270 /** @todo remove this API hack, and provide a clean way for 11271 * detaching a saved state without deleting. */ 11272 Utf8Str val; 11273 HRESULT rc2 = getExtraData("API/DiscardSavedStateKeepFile", val); 11274 if (FAILED(rc2) || val != "1") 11275 { 11276 Assert (!mSSData->mStateFilePath.isEmpty()); 11277 RTFileDelete (Utf8Str (mSSData->mStateFilePath)); 11278 } 11265 11279 mSSData->mStateFilePath.setNull(); 11266 11280 stsFlags |= SaveSTS_StateFilePath; -
trunk/src/VBox/Main/include/MachineImpl.h
r19239 r19610 794 794 HRESULT saveStateSettings (int aFlags); 795 795 796 HRESULT getExtraData(const Utf8Str &aKey, Utf8Str &aValue); 797 796 798 HRESULT createImplicitDiffs (const Bstr &aFolder, 797 799 ComObjPtr <Progress> &aProgress,
Note:
See TracChangeset
for help on using the changeset viewer.