diff --git a/ownCloudSDK/Settings/OCClassSettings.m b/ownCloudSDK/Settings/OCClassSettings.m index 1262f34f..fce4ec74 100644 --- a/ownCloudSDK/Settings/OCClassSettings.m +++ b/ownCloudSDK/Settings/OCClassSettings.m @@ -101,7 +101,37 @@ - (void)registerDefaults:(NSDictionary *)defaults metada _registeredMetaDataCollectionsByIdentifier[identifier] = registeredMetaDataCollections; } - [registeredMetaDataCollections addObject:metaData]; + if (OCPlatform.current.memoryConfiguration == OCPlatformMemoryConfigurationMinimum) + { + @autoreleasepool { + NSMutableDictionary *filteredCollection = [NSMutableDictionary new]; + + for (OCClassSettingsKey settingsKey in metaData) + { + OCClassSettingsMetadata settingsMetadata = metaData[settingsKey]; + id mdType = settingsMetadata[OCClassSettingsMetadataKeyType]; + id mdPossibleKeys = settingsMetadata[OCClassSettingsMetadataKeyPossibleKeys]; + + if ((mdType != nil) || (mdPossibleKeys != nil)) + { + NSMutableDictionary *filteredMetadata = [NSMutableDictionary new]; + filteredMetadata[OCClassSettingsMetadataKeyType] = mdType; + filteredMetadata[OCClassSettingsMetadataKeyPossibleKeys] = mdPossibleKeys; + + filteredCollection[settingsKey] = [[NSDictionary alloc] initWithDictionary:filteredMetadata]; + } + } + + if (filteredCollection.count > 0) + { + [registeredMetaDataCollections addObject:[[NSDictionary alloc] initWithDictionary:filteredCollection]]; + } + } + } + else + { + [registeredMetaDataCollections addObject:metaData]; + } } [self clearSourceCache];