Missing files from last commit

This commit is contained in:
michael starke
2013-02-21 03:39:36 +01:00
parent 687aef74ad
commit 82afcfbf0f
11 changed files with 4581 additions and 322 deletions

View File

@@ -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