Changeset 55872 in vbox
- Timestamp:
- May 15, 2015 10:16:55 AM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MediumImpl.h
r55182 r55872 312 312 bool i_isPropertyForFilter(const com::Utf8Str &aName); 313 313 314 HRESULT i_getFilterProperties(std::vector<com::Utf8Str> &aReturnNames, 315 std::vector<com::Utf8Str> &aReturnValues); 316 314 317 static DECLCALLBACK(void) i_vdErrorCall(void *pvUser, int rc, RT_SRC_POS_DECL, 315 318 const char *pszFormat, va_list va); -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r55728 r55872 5950 5950 5951 5951 return it->second; 5952 } 5953 5954 /** 5955 * Returns all filter related properties. 5956 * 5957 * @returns COM status code. 5958 * @param aReturnNames Where to store the properties names on success. 5959 * @param aReturnValues Where to store the properties values on success. 5960 */ 5961 HRESULT Medium::i_getFilterProperties(std::vector<com::Utf8Str> &aReturnNames, 5962 std::vector<com::Utf8Str> &aReturnValues) 5963 { 5964 std::vector<com::Utf8Str> aPropNames; 5965 std::vector<com::Utf8Str> aPropValues; 5966 HRESULT hrc = getProperties(Utf8Str(""), aPropNames, aPropValues); 5967 5968 if (SUCCEEDED(hrc)) 5969 { 5970 unsigned cReturnSize = 0; 5971 aReturnNames.resize(0); 5972 aReturnValues.resize(0); 5973 for (unsigned idx = 0; idx < aPropNames.size(); idx++) 5974 { 5975 if (i_isPropertyForFilter(aPropNames[idx])) 5976 { 5977 aReturnNames.resize(cReturnSize + 1); 5978 aReturnValues.resize(cReturnSize + 1); 5979 aReturnNames[cReturnSize] = aPropNames[idx]; 5980 aReturnValues[cReturnSize] = aPropValues[idx]; 5981 cReturnSize++; 5982 } 5983 } 5984 } 5985 5986 return hrc; 5952 5987 } 5953 5988 … … 8320 8355 } 8321 8356 8322 / / now, at the end of this task (always asynchronous), save the settings8357 /* Copy any filter related settings over to the target. */ 8323 8358 if (SUCCEEDED(mrc)) 8324 8359 { 8325 // save the settings 8326 i_markRegistriesModified(); 8327 /* collect multiple errors */ 8328 eik.restore(); 8329 m->pVirtualBox->i_saveModifiedRegistries(); 8330 eik.fetch(); 8360 /* Copy any filter related settings over. */ 8361 ComObjPtr<Medium> pBase = i_getBase(); 8362 ComObjPtr<Medium> pTargetBase = pTarget->i_getBase(); 8363 std::vector<com::Utf8Str> aFilterPropNames; 8364 std::vector<com::Utf8Str> aFilterPropValues; 8365 mrc = pBase->i_getFilterProperties(aFilterPropNames, aFilterPropValues); 8366 if (SUCCEEDED(mrc)) 8367 { 8368 /* Go through the properties and add them to the target medium. */ 8369 for (unsigned idx = 0; idx < aFilterPropNames.size(); idx++) 8370 { 8371 mrc = pTargetBase->i_setPropertyDirect(aFilterPropNames[idx], aFilterPropValues[idx]); 8372 if (FAILED(mrc)) break; 8373 } 8374 8375 // now, at the end of this task (always asynchronous), save the settings 8376 if (SUCCEEDED(mrc)) 8377 { 8378 // save the settings 8379 i_markRegistriesModified(); 8380 /* collect multiple errors */ 8381 eik.restore(); 8382 m->pVirtualBox->i_saveModifiedRegistries(); 8383 eik.fetch(); 8384 } 8385 } 8331 8386 } 8332 8387
Note:
See TracChangeset
for help on using the changeset viewer.