Changeset 23280
- Timestamp:
- Mar 11, 2009, 4:22:01 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigDump.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigDump.c
r19399 r23280 54 54 psArray *keep = psStringSplitArray(save, " ,;", false); // List of items to keep 55 55 56 bool result = configCull(config->recipes, keep); // Result of culling 56 if (!configCull(config->recipes, keep)) { 57 psError(PS_ERR_UNKNOWN, false, "Unable to cull system recipes."); 58 psFree(keep); 59 return false; 60 } 61 62 // Need to cull recipes from all cameras as well 63 psMetadata *cameras = psMetadataLookupMetadata(NULL, config->system, "CAMERAS"); // Known cameras 64 if (!cameras) { 65 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find CAMERAS in the system configuration.\n"); 66 return false; 67 } 68 69 psMetadataIterator *iter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL); // Iterator for cameras 70 psMetadataItem *item; // Item from iteration 71 while ((item = psMetadataGetAndIncrement(iter))) { 72 psAssert(item->type == PS_DATA_METADATA, "Should only be metadata types on the camera list."); 73 psMetadata *camera = item->data.md; // Camera configuration 74 bool mdok; // Status of MD lookup 75 psMetadata *recipes = psMetadataLookupMetadata(&mdok, camera, "RECIPES"); // Recipe overrides 76 if (!recipes) { 77 continue; 78 } 79 if (!configCull(recipes, keep)) { 80 psError(PS_ERR_UNKNOWN, false, "Unable to cull recipes for camera %s", item->name); 81 psFree(iter); 82 psFree(keep); 83 return false; 84 } 85 } 86 psFree(iter); 87 57 88 psFree(keep); 58 89 59 return result;90 return true; 60 91 } 61 92
Note:
See TracChangeset
for help on using the changeset viewer.
