mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 17:39:24 +00:00
Missing files from last commit
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
@implementation MPIconHelper
|
||||
|
||||
# pragma mark Icon accessors
|
||||
+ (NSImage *)icon:(MPIconType)type {
|
||||
NSDictionary *icons = [MPIconHelper availableIcons];
|
||||
NSString *imageName = icons[@(type)];
|
||||
@@ -33,4 +32,15 @@
|
||||
return imageNames;
|
||||
}
|
||||
|
||||
+ (NSImage *)randomIcon {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
srandom([[NSDate date] timeIntervalSince1970]);
|
||||
});
|
||||
|
||||
NSArray *types = [[MPIconHelper availableIcons] allKeys];
|
||||
NSUInteger randomIndex = random() % [types count];
|
||||
return [MPIconHelper icon:(MPIconType)randomIndex];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user