Changeset 47920 in vbox
- Timestamp:
- Aug 20, 2013 2:24:50 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88227
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r46720 r47920 2392 2392 } 2393 2393 2394 settings::StringsMap::iterator it = m->mapProperties.find(Utf8Str(aName)); 2395 if (it == m->mapProperties.end()) 2396 return setError(VBOX_E_OBJECT_NOT_FOUND, 2397 tr("Property '%ls' does not exist"), 2398 aName); 2399 2400 it->second = aValue; 2394 Utf8Str strName(aName); 2395 Utf8Str strValue(aValue); 2396 settings::StringsMap::iterator it = m->mapProperties.find(strName); 2397 if (!strName.startsWith("Special/")) 2398 { 2399 if (it == m->mapProperties.end()) 2400 return setError(VBOX_E_OBJECT_NOT_FOUND, 2401 tr("Property '%s' does not exist"), 2402 strName.c_str()); 2403 it->second = strValue; 2404 } 2405 else 2406 { 2407 if (it == m->mapProperties.end()) 2408 { 2409 if (!strValue.isEmpty()) 2410 m->mapProperties[strName] = strValue; 2411 } 2412 else 2413 { 2414 if (!strValue.isEmpty()) 2415 it->second = aValue; 2416 else 2417 m->mapProperties.erase(it); 2418 } 2419 } 2401 2420 2402 2421 // save the settings … … 2461 2480 ++i) 2462 2481 { 2463 if (m->mapProperties.find(Utf8Str(names[i])) == m->mapProperties.end()) 2482 Utf8Str strName(names[i]); 2483 if ( !strName.startsWith("Special/") 2484 && m->mapProperties.find(strName) == m->mapProperties.end()) 2464 2485 return setError(VBOX_E_OBJECT_NOT_FOUND, 2465 tr("Property '% ls' does not exist"), names[i]);2486 tr("Property '%s' does not exist"), strName.c_str()); 2466 2487 } 2467 2488 … … 2471 2492 ++i) 2472 2493 { 2473 settings::StringsMap::iterator it = m->mapProperties.find(Utf8Str(names[i])); 2474 AssertReturn(it != m->mapProperties.end(), E_FAIL); 2475 2476 it->second = Utf8Str(values[i]); 2494 Utf8Str strName(names[i]); 2495 Utf8Str strValue(values[i]); 2496 settings::StringsMap::iterator it = m->mapProperties.find(strName); 2497 if (!strName.startsWith("Special/")) 2498 { 2499 AssertReturn(it != m->mapProperties.end(), E_FAIL); 2500 it->second = strValue; 2501 } 2502 else 2503 { 2504 if (it == m->mapProperties.end()) 2505 { 2506 if (!strValue.isEmpty()) 2507 m->mapProperties[strName] = strValue; 2508 } 2509 else 2510 { 2511 if (!strValue.isEmpty()) 2512 it->second = strValue; 2513 else 2514 m->mapProperties.erase(it); 2515 } 2516 } 2477 2517 } 2478 2518
Note:
See TracChangeset
for help on using the changeset viewer.