static void altSpeedToggledCallback(tr_session * handle UNUSED, bool active, bool byUser, void * controller)
{
- NSDictionary * dict = @{@"Active": @(active),
- @"ByUser": @(byUser)};
+ NSDictionary * dict = [[NSDictionary alloc] initWithObjects: @[@(active), @(byUser)] forKeys: @[@"Active", @"ByUser"]];
[(Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
withObject: dict waitUntilDone: NO];
}
forEventClass: kCoreEventClass andEventID: kAEOpenContents];
//if we were opened from a user notification, do the corresponding action
- NSUserNotification * launchNotification = [notification userInfo][ NSApplicationLaunchUserNotificationKey];
+ NSUserNotification * launchNotification = [notification userInfo][NSApplicationLaunchUserNotificationKey];
if (launchNotification)
[self userNotificationCenter: nil didActivateNotification: launchNotification];
-(void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
{
- NSMutableDictionary *dict = (NSMutableDictionary *)fPendingTorrentDownloads[[[download request] URL]];
+ NSMutableDictionary * dict = fPendingTorrentDownloads[[[download request] URL]];
dict[@"Path"] = path;
}
//called on by applescript
- (void) open: (NSArray *) files
{
- NSDictionary * dict = @{@"Filenames": files,
- @"AddType": @(ADD_MANUAL)};
+ NSDictionary * dict = [[NSDictionary alloc] initWithObjects: @[files, @(ADD_MANUAL)] forKeys: @[@"Filenames", @"AddType"]];
[self performSelectorOnMainThread: @selector(openFilesWithDict:) withObject: dict waitUntilDone: NO];
}
for (NSURL * url in [panel URLs])
[filenames addObject: [url path]];
- NSDictionary * dictionary = @{@"Filenames": filenames,
- @"AddType": sender == fOpenIgnoreDownloadFolder ? @(ADD_SHOW_OPTIONS) : @(ADD_MANUAL)};
+ NSDictionary * dictionary = [[NSDictionary alloc] initWithObjects: @[
+ filenames,
+ sender == fOpenIgnoreDownloadFolder ? @(ADD_SHOW_OPTIONS) : @(ADD_MANUAL)]
+ forKeys: @[@"Filenames", @"AddType"]];
[self performSelectorOnMainThread: @selector(openFilesWithDict:) withObject: dictionary waitUntilDone: NO];
}
}];
if (!fPendingTorrentDownloads)
fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
- NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"];
+ NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"];
fPendingTorrentDownloads[[request URL]] = dict;
}
}
case TR_MAKEMETA_OK:
if (fOpenWhenCreated)
{
- NSDictionary * dict = @{@"File": [fLocation path],
- @"Path": [[fPath URLByDeletingLastPathComponent] path]};
+ NSDictionary * dict = [[NSDictionary alloc] initWithObjects: @[
+ [fLocation path],
+ [[fPath URLByDeletingLastPathComponent] path]]
+ forKeys: @[@"File", @"Path"]];
[[NSNotificationCenter defaultCenter] postNotificationName: @"OpenCreatedTorrentFile" object: self userInfo: dict];
}
NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setLineBreakMode: NSLineBreakByTruncatingMiddle];
- fMainLineAttributes = @{
- NSForegroundColorAttributeName: [NSColor whiteColor],
- NSFontAttributeName: bigFont,
- NSShadowAttributeName: stringShadow,
- NSParagraphStyleAttributeName: paragraphStyle};
-
- fSubLineAttributes = @{
- NSForegroundColorAttributeName: [NSColor whiteColor],
- NSFontAttributeName: smallFont,
- NSShadowAttributeName: stringShadow,
- NSParagraphStyleAttributeName: paragraphStyle};
+ fMainLineAttributes = [[NSDictionary alloc] initWithObjects: @[[NSColor whiteColor],
+ bigFont, stringShadow, paragraphStyle]
+ forKeys: @[NSForegroundColorAttributeName, NSFontAttributeName,
+ NSShadowAttributeName, NSParagraphStyleAttributeName]];
+
+ fSubLineAttributes = [[NSDictionary alloc] initWithObjects: @[[NSColor whiteColor],
+ smallFont, stringShadow, paragraphStyle]
+ forKeys: @[NSForegroundColorAttributeName, NSFontAttributeName,
+ NSShadowAttributeName, NSParagraphStyleAttributeName]];
[stringShadow release];
[paragraphStyle release];
{
//make the array sorted by date
NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey: @"Index" ascending: YES];
- NSArray * descriptors = @[descriptor];
+ NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil];
NSArray * sortedMessages = [fDisplayedMessages sortedArrayUsingDescriptors: descriptors];
[descriptors release];
NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setAlignment: NSRightTextAlignment];
- fAttributes = @{NSFontAttributeName: [NSFont systemFontOfSize: 11.0],
- NSParagraphStyleAttributeName: paragraphStyle};
+ fAttributes = [[NSDictionary alloc] initWithObjects: @[[NSFont systemFontOfSize: 11.0], paragraphStyle]
+ forKeys: @[NSFontAttributeName, NSParagraphStyleAttributeName]];
[paragraphStyle release];
}
if (!_delegate || _alwaysPostNotifications)
{
- NSDictionary *userInfoDict = @{@"path": fpath};
+ NSDictionary * userInfoDict = [[NSDictionary alloc] initWithObjects: @[fpath] forKeys: @[@"path"]];
[[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName:note object:self userInfo:userInfoDict];
[userInfoDict release];
}