]> granicus.if.org Git - transmission/commitdiff
Manually released collections are not autoreleased anymore, pointer syntax adheres...
authorDmitry Serov <barbari100@gmail.com>
Mon, 17 Jul 2017 17:34:52 +0000 (00:34 +0700)
committerDmitry Serov <barbari100@gmail.com>
Mon, 17 Jul 2017 17:34:52 +0000 (00:34 +0700)
macosx/Controller.m
macosx/CreatorWindowController.m
macosx/DragOverlayView.m
macosx/MessageWindowController.m
macosx/PeerProgressIndicatorCell.m
macosx/VDKQueue/VDKQueue.m

index 24c67033a26e32a3989790232ebfa00b6f3a34fd..9ea8787c7caaaaa0ff63dfb6c569c34794a4bb1c 100644 (file)
@@ -140,8 +140,7 @@ typedef enum
 
 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];
 }
@@ -665,7 +664,7 @@ static void removeKeRangerRansomware()
         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];
 
@@ -904,7 +903,7 @@ static void removeKeRangerRansomware()
 
 -(void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
 {
-    NSMutableDictionary *dict = (NSMutableDictionary *)fPendingTorrentDownloads[[[download request] URL]];
+    NSMutableDictionary * dict = fPendingTorrentDownloads[[[download request] URL]];
     dict[@"Path"] = path;
 }
 
@@ -1199,8 +1198,7 @@ static void removeKeRangerRansomware()
 //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];
 }
 
@@ -1221,8 +1219,10 @@ static void removeKeRangerRansomware()
             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];
         }
     }];
@@ -1347,7 +1347,7 @@ static void removeKeRangerRansomware()
 
         if (!fPendingTorrentDownloads)
             fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
-        NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"];
+        NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"];
         fPendingTorrentDownloads[[request URL]] = dict;
     }
 }
index f111aa53bdbd3c6d6e8cb887ae45b3d2e4f1cefa..962f75b4dbdd6970f5e2055e163d12eac33d79a9 100644 (file)
             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];
                 }
 
index 9e30d7f380f365433b0b94b5ec175307aa9c222b..2af77ffab5a1570267d4bbf0adcdbbaa2912cdd4 100644 (file)
         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];
index 3d18ada9e53c3e2998364e3936c2bb7eb5f57ba3..5462add8ce2af9fbf2ab108e0794a1cf56b7480c 100644 (file)
         {
             //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];
 
index 81f58f2cf7a93582e67575b3343339e616d93585..b89e33ffe9803d3573b044a4e33a66b67af7f89f 100644 (file)
@@ -53,8 +53,8 @@
             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];
         }
 
index 402fb8e00d1d7cb574e52a11724ebc2ed0bbd4d8..ad9e7840c7f2c9c79c8da44be98dde18a95496b5 100755 (executable)
@@ -306,7 +306,7 @@ NSString * VDKQueueAccessRevocationNotification = @"VDKQueueAccessWasRevokedNoti
                                                    
                                                    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];
                                                    }