From: Jay Freeman (saurik) Date: Thu, 13 Sep 2012 04:26:58 +0000 (+0000) Subject: Do not unregister apps if we can invalidate icons. X-Git-Tag: v1.1.4~2 X-Git-Url: https://git.saurik.com/uikittools.git/commitdiff_plain/97b54c51a985afce00d04b166a3f242a66b89391 Do not unregister apps if we can invalidate icons. --- diff --git a/uicache.mm b/uicache.mm index c7510d0..08d00c5 100644 --- a/uicache.mm +++ b/uicache.mm @@ -125,14 +125,15 @@ int main(int argc, const char *argv[]) { [cache writeToFile:path atomically:YES]; if (workspace != nil) { - for (NSString *identifier in bundles) { - NSString *path([bundles objectForKey:identifier]); - [workspace unregisterApplication:[NSURL fileURLWithPath:path]]; - } - - for (NSString *identifier in bundles) - if ([workspace respondsToSelector:@selector(invalidateIconCache:)]) + if ([workspace respondsToSelector:@selector(invalidateIconCache:)]) { + for (NSString *identifier in bundles) [workspace invalidateIconCache:identifier]; + } else { + for (NSString *identifier in bundles) { + NSString *path([bundles objectForKey:identifier]); + [workspace unregisterApplication:[NSURL fileURLWithPath:path]]; + } + } for (NSString *identifier in bundles) { NSString *path([bundles objectForKey:identifier]);