Skip to content

Commit

Permalink
Reload icons on app (un)install
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Jan 27, 2024
1 parent 0d5b72b commit f98b2a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Shared/CoreServices.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ extern NSString *LSInstallTypeKey;

@protocol LSApplicationWorkspaceObserverProtocol <NSObject>
@optional
-(void)applicationsDidInstall:(id)arg1;
-(void)applicationsDidUninstall:(id)arg1;
- (void)applicationsDidInstall:(NSArray <LSApplicationProxy *>*)apps;
- (void)applicationsDidUninstall:(NSArray <LSApplicationProxy *>*)apps;
@end

@interface LSEnumerator : NSEnumerator
Expand Down
16 changes: 14 additions & 2 deletions TrollStore/TSAppTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,25 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[TSPresentationDelegate presentViewController:appSelectAlert animated:YES completion:nil];
}

- (void)applicationsDidInstall:(id)arg1
- (void)purgeCachedIconsForApps:(NSArray <LSApplicationProxy *>*)apps
{
for (LSApplicationProxy *appProxy in apps) {
NSString *appId = appProxy.bundleIdentifier;
if (_cachedIcons[appId]) {
[_cachedIcons removeObjectForKey:appId];
}
}
}

- (void)applicationsDidInstall:(NSArray <LSApplicationProxy *>*)apps
{
[self purgeCachedIconsForApps:apps];
[self reloadTable];
}

- (void)applicationsDidUninstall:(id)arg1
- (void)applicationsDidUninstall:(NSArray <LSApplicationProxy *>*)apps
{
[self purgeCachedIconsForApps:apps];
[self reloadTable];
}

Expand Down

0 comments on commit f98b2a2

Please sign in to comment.