mirror of
https://github.com/transmission/transmission.git
synced 2026-05-03 23:25:14 +01:00
Transition to ARC
This commit is contained in:
@@ -141,20 +141,20 @@ typedef enum
|
||||
static void altSpeedToggledCallback(tr_session * handle UNUSED, bool active, bool byUser, void * controller)
|
||||
{
|
||||
NSDictionary * dict = [[NSDictionary alloc] initWithObjects: @[@(active), @(byUser)] forKeys: @[@"Active", @"ByUser"]];
|
||||
[(Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
|
||||
[(__bridge Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
|
||||
withObject: dict waitUntilDone: NO];
|
||||
}
|
||||
|
||||
static tr_rpc_callback_status rpcCallback(tr_session * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct,
|
||||
void * controller)
|
||||
{
|
||||
[(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
|
||||
[(__bridge Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
|
||||
return TR_RPC_NOREMOVE; //we'll do the remove manually
|
||||
}
|
||||
|
||||
static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
|
||||
{
|
||||
[(Controller *)controller sleepCallback: messageType argument: messageArgument];
|
||||
[(__bridge Controller *)controller sleepCallback: messageType argument: messageArgument];
|
||||
}
|
||||
|
||||
// 2.90 was infected with ransomware which we now check for and attempt to remove
|
||||
@@ -202,7 +202,7 @@ static void removeKeRangerRansomware()
|
||||
[lsofTask launch];
|
||||
NSData * lsofOuputData = [[[lsofTask standardOutput] fileHandleForReading] readDataToEndOfFile];
|
||||
[lsofTask waitUntilExit];
|
||||
NSString * lsofOutput = [[[NSString alloc] initWithData: lsofOuputData encoding: NSUTF8StringEncoding] autorelease];
|
||||
NSString * lsofOutput = [[NSString alloc] initWithData: lsofOuputData encoding: NSUTF8StringEncoding];
|
||||
for (NSString * line in [lsofOutput componentsSeparatedByString: @"\n"])
|
||||
{
|
||||
if (![line hasPrefix: @"p"])
|
||||
@@ -257,7 +257,6 @@ static void removeKeRangerRansomware()
|
||||
[alert setAlertStyle: NSCriticalAlertStyle];
|
||||
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
|
||||
//kill ourselves right away
|
||||
exit(0);
|
||||
@@ -267,10 +266,10 @@ static void removeKeRangerRansomware()
|
||||
[[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]];
|
||||
|
||||
//set custom value transformers
|
||||
ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
|
||||
ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init];
|
||||
[NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"];
|
||||
|
||||
ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
|
||||
ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
|
||||
[NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"];
|
||||
|
||||
//cover our asses
|
||||
@@ -288,7 +287,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
if ([alert runModal] == NSAlertSecondButtonReturn)
|
||||
exit(0);
|
||||
[alert release];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"];
|
||||
}
|
||||
@@ -407,8 +405,6 @@ static void removeKeRangerRansomware()
|
||||
[unitFormatter setAllowedUnits: NSByteCountFormatterUseTB];
|
||||
NSString * tbString = [unitFormatter stringFromByteCount: 17];
|
||||
|
||||
[unitFormatter release];
|
||||
|
||||
tr_formatter_size_init(1000, [kbString UTF8String],
|
||||
[mbString UTF8String],
|
||||
[gbString UTF8String],
|
||||
@@ -451,11 +447,11 @@ static void removeKeRangerRansomware()
|
||||
fGlobalPopoverShown = NO;
|
||||
fSoundPlaying = NO;
|
||||
|
||||
tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);
|
||||
tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, (__bridge void *)(self));
|
||||
if (usesSpeedLimitSched)
|
||||
[fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"];
|
||||
|
||||
tr_sessionSetRPCCallback(fLib, rpcCallback, self);
|
||||
tr_sessionSetRPCCallback(fLib, rpcCallback, (__bridge void *)(self));
|
||||
|
||||
[GrowlApplicationBridge setGrowlDelegate: self];
|
||||
|
||||
@@ -475,7 +471,6 @@ static void removeKeRangerRansomware()
|
||||
[toolbar setAutosavesConfiguration: YES];
|
||||
[toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
|
||||
[fWindow setToolbar: toolbar];
|
||||
[toolbar release];
|
||||
|
||||
[fWindow setDelegate: self]; //do manually to avoid placement issue
|
||||
|
||||
@@ -545,7 +540,7 @@ static void removeKeRangerRansomware()
|
||||
//register for sleep notifications
|
||||
IONotificationPortRef notify;
|
||||
io_object_t iterator;
|
||||
if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCallback, &iterator)))
|
||||
if ((fRootPort = IORegisterForSystemPower((__bridge void *)(self), & notify, sleepCallback, &iterator)))
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes);
|
||||
else
|
||||
NSLog(@"Could not IORegisterForSystemPower");
|
||||
@@ -574,8 +569,6 @@ static void removeKeRangerRansomware()
|
||||
NSNumber * waitToStart;
|
||||
if (!fPauseOnLaunch && (waitToStart = historyItem[@"WaitToStart"]) && [waitToStart boolValue])
|
||||
[waitToStartTorrents addObject: torrent];
|
||||
|
||||
[torrent release];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -642,8 +635,8 @@ static void removeKeRangerRansomware()
|
||||
|
||||
//timer to update the interface every second
|
||||
[self updateUI];
|
||||
fTimer = [[NSTimer scheduledTimerWithTimeInterval: UPDATE_UI_SECONDS target: self
|
||||
selector: @selector(updateUI) userInfo: nil repeats: YES] retain];
|
||||
fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_UI_SECONDS target: self
|
||||
selector: @selector(updateUI) userInfo: nil repeats: YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
|
||||
[[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
|
||||
|
||||
@@ -716,8 +709,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
if (allowNeverAgain)
|
||||
[fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"];
|
||||
|
||||
[alert release];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -784,13 +775,11 @@ static void removeKeRangerRansomware()
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
|
||||
[fTimer invalidate];
|
||||
[fTimer release];
|
||||
|
||||
if (fAutoImportTimer)
|
||||
{
|
||||
if ([fAutoImportTimer isValid])
|
||||
[fAutoImportTimer invalidate];
|
||||
[fAutoImportTimer release];
|
||||
}
|
||||
|
||||
[fBadger setQuitting];
|
||||
@@ -802,9 +791,7 @@ static void removeKeRangerRansomware()
|
||||
{
|
||||
NSURLDownload * download = downloadDict[@"Download"];
|
||||
[download cancel];
|
||||
[download release];
|
||||
}
|
||||
[fPendingTorrentDownloads release];
|
||||
}
|
||||
|
||||
//remember window states and close all windows
|
||||
@@ -823,31 +810,6 @@ static void removeKeRangerRansomware()
|
||||
[self updateTorrentHistory];
|
||||
[fTableView saveCollapsedGroups];
|
||||
|
||||
//remaining calls the same as dealloc
|
||||
[fInfoController release];
|
||||
[fMessageController release];
|
||||
[fPrefsController release];
|
||||
|
||||
[fStatusBar release];
|
||||
[fFilterBar release];
|
||||
|
||||
[fTorrents release];
|
||||
[fDisplayedTorrents release];
|
||||
|
||||
[fAddWindows release];
|
||||
[fAddingTransfers release];
|
||||
|
||||
[fOverlayWindow release];
|
||||
[fBadger release];
|
||||
|
||||
[fAutoImportedNames release];
|
||||
|
||||
[fPreviewPanel release];
|
||||
|
||||
[fConfigDirectory release];
|
||||
|
||||
[fFileWatcherQueue release];
|
||||
|
||||
//complete cleanup
|
||||
tr_sessionClose(fLib);
|
||||
}
|
||||
@@ -884,7 +846,6 @@ static void removeKeRangerRansomware()
|
||||
[fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
|
||||
if ([fPendingTorrentDownloads count] == 0)
|
||||
{
|
||||
[fPendingTorrentDownloads release];
|
||||
fPendingTorrentDownloads = nil;
|
||||
}
|
||||
|
||||
@@ -893,8 +854,6 @@ static void removeKeRangerRansomware()
|
||||
"Download not a torrent -> message"), suggestedName,
|
||||
[[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]],
|
||||
NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil);
|
||||
|
||||
[download release];
|
||||
}
|
||||
else
|
||||
[download setDestination: [NSTemporaryDirectory() stringByAppendingPathComponent: [suggestedName lastPathComponent]]
|
||||
@@ -918,11 +877,8 @@ static void removeKeRangerRansomware()
|
||||
[fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
|
||||
if ([fPendingTorrentDownloads count] == 0)
|
||||
{
|
||||
[fPendingTorrentDownloads release];
|
||||
fPendingTorrentDownloads = nil;
|
||||
}
|
||||
|
||||
[download release];
|
||||
}
|
||||
|
||||
- (void) downloadDidFinish: (NSURLDownload *) download
|
||||
@@ -937,11 +893,8 @@ static void removeKeRangerRansomware()
|
||||
[fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
|
||||
if ([fPendingTorrentDownloads count] == 0)
|
||||
{
|
||||
[fPendingTorrentDownloads release];
|
||||
fPendingTorrentDownloads = nil;
|
||||
}
|
||||
|
||||
[download release];
|
||||
}
|
||||
|
||||
- (void) application: (NSApplication *) app openFiles: (NSArray *) filenames
|
||||
@@ -1039,7 +992,6 @@ static void removeKeRangerRansomware()
|
||||
if (!fAddWindows)
|
||||
fAddWindows = [[NSMutableSet alloc] init];
|
||||
[fAddWindows addObject: addController];
|
||||
[addController release];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1048,7 +1000,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
[torrent update];
|
||||
[fTorrents addObject: torrent];
|
||||
[torrent release];
|
||||
|
||||
if (!fAddingTransfers)
|
||||
fAddingTransfers = [[NSMutableSet alloc] init];
|
||||
@@ -1069,7 +1020,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
[torrent update];
|
||||
[fTorrents addObject: torrent];
|
||||
[torrent release];
|
||||
|
||||
if (!fAddingTransfers)
|
||||
fAddingTransfers = [[NSMutableSet alloc] init];
|
||||
@@ -1080,13 +1030,11 @@ static void removeKeRangerRansomware()
|
||||
else
|
||||
{
|
||||
[torrent closeRemoveTorrent: NO];
|
||||
[torrent release];
|
||||
}
|
||||
|
||||
[fAddWindows removeObject: addController];
|
||||
if ([fAddWindows count] == 0)
|
||||
{
|
||||
[fAddWindows release];
|
||||
fAddWindows = nil;
|
||||
}
|
||||
}
|
||||
@@ -1130,7 +1078,6 @@ static void removeKeRangerRansomware()
|
||||
if (!fAddWindows)
|
||||
fAddWindows = [[NSMutableSet alloc] init];
|
||||
[fAddWindows addObject: addController];
|
||||
[addController release];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1139,7 +1086,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
[torrent update];
|
||||
[fTorrents addObject: torrent];
|
||||
[torrent release];
|
||||
|
||||
if (!fAddingTransfers)
|
||||
fAddingTransfers = [[NSMutableSet alloc] init];
|
||||
@@ -1159,7 +1105,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
[torrent update];
|
||||
[fTorrents addObject: torrent];
|
||||
[torrent release];
|
||||
|
||||
if (!fAddingTransfers)
|
||||
fAddingTransfers = [[NSMutableSet alloc] init];
|
||||
@@ -1170,13 +1115,11 @@ static void removeKeRangerRansomware()
|
||||
else
|
||||
{
|
||||
[torrent closeRemoveTorrent: NO];
|
||||
[torrent release];
|
||||
}
|
||||
|
||||
[fAddWindows removeObject: addController];
|
||||
if ([fAddWindows count] == 0)
|
||||
{
|
||||
[fAddWindows release];
|
||||
fAddWindows = nil;
|
||||
}
|
||||
}
|
||||
@@ -1185,14 +1128,11 @@ static void removeKeRangerRansomware()
|
||||
{
|
||||
NSDictionary * dict = [notification userInfo];
|
||||
[self openFiles: @[dict[@"File"]] addType: ADD_CREATED forcePath: dict[@"Path"]];
|
||||
[dict release];
|
||||
}
|
||||
|
||||
- (void) openFilesWithDict: (NSDictionary *) dictionary
|
||||
{
|
||||
[self openFiles: dictionary[@"Filenames"] addType: [dictionary[@"AddType"] intValue] forcePath: nil];
|
||||
|
||||
[dictionary release];
|
||||
}
|
||||
|
||||
//called on by applescript
|
||||
@@ -1245,7 +1185,6 @@ static void removeKeRangerRansomware()
|
||||
[alert runModal];
|
||||
if ([[alert suppressionButton] state] == NSOnState)
|
||||
[fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
- (void) invalidOpenMagnetAlert: (NSString *) address
|
||||
@@ -1263,7 +1202,6 @@ static void removeKeRangerRansomware()
|
||||
[alert runModal];
|
||||
if ([[alert suppressionButton] state] == NSOnState)
|
||||
[fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
- (void) duplicateOpenAlert: (NSString *) name
|
||||
@@ -1284,7 +1222,6 @@ static void removeKeRangerRansomware()
|
||||
[alert runModal];
|
||||
if ([[alert suppressionButton] state])
|
||||
[fDefaults setBool: NO forKey: @"WarningDuplicate"];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
- (void) duplicateOpenMagnetAlert: (NSString *) address transferName: (NSString *) name
|
||||
@@ -1309,7 +1246,6 @@ static void removeKeRangerRansomware()
|
||||
[alert runModal];
|
||||
if ([[alert suppressionButton] state])
|
||||
[fDefaults setBool: NO forKey: @"WarningDuplicate"];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
- (void) openURL: (NSString *) urlString
|
||||
@@ -1370,7 +1306,6 @@ static void removeKeRangerRansomware()
|
||||
[self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO];
|
||||
}
|
||||
|
||||
[fUrlSheetController release];
|
||||
fUrlSheetController = nil;
|
||||
}
|
||||
|
||||
@@ -1513,7 +1448,7 @@ static void removeKeRangerRansomware()
|
||||
|
||||
NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"),
|
||||
NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self,
|
||||
nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), [dict retain], @"%@", message);
|
||||
nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), (__bridge void *)(dict), @"%@", message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1526,7 +1461,6 @@ static void removeKeRangerRansomware()
|
||||
NSArray * torrents = dict[@"Torrents"];
|
||||
if (returnCode == NSAlertDefaultReturn)
|
||||
[self confirmRemoveTorrents: torrents deleteData: [dict[@"DeleteData"] boolValue]];
|
||||
[dict release];
|
||||
}
|
||||
|
||||
- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData
|
||||
@@ -1660,7 +1594,7 @@ static void removeKeRangerRansomware()
|
||||
"Remove completed confirm panel -> message");
|
||||
}
|
||||
|
||||
NSAlert * alert = [[[NSAlert alloc] init] autorelease];
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert setMessageText: message];
|
||||
[alert setInformativeText: info];
|
||||
[alert setAlertStyle: NSWarningAlertStyle];
|
||||
@@ -1719,7 +1653,6 @@ static void removeKeRangerRansomware()
|
||||
{
|
||||
if ([torrents count] == 0)
|
||||
{
|
||||
[torrents release];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1756,7 +1689,6 @@ static void removeKeRangerRansomware()
|
||||
[alert setAlertStyle: NSWarningAlertStyle];
|
||||
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
[torrents removeObjectAtIndex: 0];
|
||||
@@ -2103,7 +2035,6 @@ static void removeKeRangerRansomware()
|
||||
[notification setUserInfo: userInfo];
|
||||
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notification];
|
||||
[notification release];
|
||||
|
||||
NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
GROWL_DOWNLOAD_COMPLETE, @"Type", nil];
|
||||
@@ -2162,7 +2093,6 @@ static void removeKeRangerRansomware()
|
||||
[userNotification setUserInfo: userInfo];
|
||||
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: userNotification];
|
||||
[userNotification release];
|
||||
|
||||
NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObject: GROWL_SEEDING_COMPLETE forKey: @"Type"];
|
||||
|
||||
@@ -2611,7 +2541,7 @@ static void removeKeRangerRansomware()
|
||||
TorrentGroup * newGroup = groupsByIndex[@(groupValue)];
|
||||
if (!newGroup)
|
||||
{
|
||||
newGroup = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
|
||||
newGroup = [[TorrentGroup alloc] initWithGroup: groupValue];
|
||||
groupsByIndex[@(groupValue)] = newGroup;
|
||||
[fDisplayedTorrents addObject: newGroup];
|
||||
|
||||
@@ -2652,7 +2582,7 @@ static void removeKeRangerRansomware()
|
||||
TorrentGroup * group = groupsByIndex[@(groupValue)];
|
||||
if (!group)
|
||||
{
|
||||
group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
|
||||
group = [[TorrentGroup alloc] initWithGroup: groupValue];
|
||||
groupsByIndex[@(groupValue)] = group;
|
||||
[fDisplayedTorrents addObject: group];
|
||||
|
||||
@@ -2707,7 +2637,7 @@ static void removeKeRangerRansomware()
|
||||
TorrentGroup * group = groupsByIndex[@(groupValue)];
|
||||
if (!group)
|
||||
{
|
||||
group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
|
||||
group = [[TorrentGroup alloc] initWithGroup: groupValue];
|
||||
groupsByIndex[@(groupValue)] = group;
|
||||
}
|
||||
|
||||
@@ -2753,7 +2683,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
if (fAddingTransfers)
|
||||
{
|
||||
[fAddingTransfers release];
|
||||
fAddingTransfers = nil;
|
||||
}
|
||||
}
|
||||
@@ -2775,9 +2704,6 @@ static void removeKeRangerRansomware()
|
||||
[popover setDelegate: self];
|
||||
|
||||
[popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
|
||||
|
||||
[viewController release];
|
||||
[popover release];
|
||||
}
|
||||
|
||||
//don't show multiple popovers when clicking the gear button repeatedly
|
||||
@@ -2803,10 +2729,9 @@ static void removeKeRangerRansomware()
|
||||
const NSInteger groupMenuCount = [groupMenu numberOfItems];
|
||||
for (NSInteger i = 0; i < groupMenuCount; i++)
|
||||
{
|
||||
NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
|
||||
NSMenuItem * item = [groupMenu itemAtIndex: 0];
|
||||
[groupMenu removeItemAtIndex: 0];
|
||||
[menu addItem: item];
|
||||
[item release];
|
||||
}
|
||||
}
|
||||
else if (menu == fShareMenu || menu == fShareContextMenu) {
|
||||
@@ -2846,7 +2771,6 @@ static void removeKeRangerRansomware()
|
||||
[fStatusBar updateSpeedFieldsToolTips];
|
||||
}
|
||||
|
||||
//dict has been retained
|
||||
- (void) altSpeedToggledCallbackIsLimited: (NSDictionary *) dict
|
||||
{
|
||||
const BOOL isLimited = [dict[@"Active"] boolValue];
|
||||
@@ -2864,7 +2788,6 @@ static void removeKeRangerRansomware()
|
||||
clickContext: nil
|
||||
identifier: GROWL_AUTO_SPEED_LIMIT];
|
||||
|
||||
[dict release];
|
||||
}
|
||||
|
||||
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying
|
||||
@@ -2881,11 +2804,10 @@ static void removeKeRangerRansomware()
|
||||
|
||||
if ([fAutoImportTimer isValid])
|
||||
[fAutoImportTimer invalidate];
|
||||
[fAutoImportTimer release];
|
||||
|
||||
//check again in 10 seconds in case torrent file wasn't complete
|
||||
fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
|
||||
selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain];
|
||||
fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
|
||||
selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO];
|
||||
|
||||
[self checkAutoImportDirectory];
|
||||
}
|
||||
@@ -2894,10 +2816,8 @@ static void removeKeRangerRansomware()
|
||||
{
|
||||
if ([fAutoImportTimer isValid])
|
||||
[fAutoImportTimer invalidate];
|
||||
[fAutoImportTimer release];
|
||||
fAutoImportTimer = nil;
|
||||
|
||||
[fAutoImportedNames release];
|
||||
fAutoImportedNames = nil;
|
||||
|
||||
[self checkAutoImportDirectory];
|
||||
@@ -2940,7 +2860,7 @@ static void removeKeRangerRansomware()
|
||||
|
||||
switch (tr_torrentParse(ctor, NULL))
|
||||
{
|
||||
case TR_PARSE_OK:
|
||||
case TR_PARSE_OK: {
|
||||
[self openFiles: @[fullFile] addType: ADD_AUTO forcePath: nil];
|
||||
|
||||
NSString * notificationTitle = NSLocalizedString(@"Torrent File Auto Added", "notification title");
|
||||
@@ -2951,13 +2871,12 @@ static void removeKeRangerRansomware()
|
||||
[notification setHasActionButton: NO];
|
||||
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notification];
|
||||
[notification release];
|
||||
|
||||
[GrowlApplicationBridge notifyWithTitle: notificationTitle
|
||||
description: file notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO
|
||||
clickContext: nil];
|
||||
break;
|
||||
|
||||
}
|
||||
case TR_PARSE_ERR:
|
||||
[fAutoImportedNames removeObject: file];
|
||||
break;
|
||||
@@ -2968,8 +2887,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
tr_ctorFree(ctor);
|
||||
}
|
||||
|
||||
[newNames release];
|
||||
}
|
||||
|
||||
- (void) beginCreateFile: (NSNotification *) notification
|
||||
@@ -3496,7 +3413,6 @@ static void removeKeRangerRansomware()
|
||||
if (!show)
|
||||
{
|
||||
[[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay];
|
||||
[fStatusBar release];
|
||||
fStatusBar = nil;
|
||||
}
|
||||
|
||||
@@ -3595,7 +3511,6 @@ static void removeKeRangerRansomware()
|
||||
if (!show)
|
||||
{
|
||||
[[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay];
|
||||
[fFilterBar release];
|
||||
fFilterBar = nil;
|
||||
}
|
||||
|
||||
@@ -3624,14 +3539,13 @@ static void removeKeRangerRansomware()
|
||||
|
||||
- (void) beginPreviewPanelControl: (QLPreviewPanel *) panel
|
||||
{
|
||||
fPreviewPanel = [panel retain];
|
||||
fPreviewPanel = panel;
|
||||
[fPreviewPanel setDelegate: self];
|
||||
[fPreviewPanel setDataSource: self];
|
||||
}
|
||||
|
||||
- (void) endPreviewPanelControl: (QLPreviewPanel *) panel
|
||||
{
|
||||
[fPreviewPanel release];
|
||||
fPreviewPanel = nil;
|
||||
}
|
||||
|
||||
@@ -3733,13 +3647,12 @@ static void removeKeRangerRansomware()
|
||||
[button setStringValue: @""];
|
||||
|
||||
[item setView: button];
|
||||
[button release];
|
||||
|
||||
const NSSize buttonSize = NSMakeSize(36.0, 25.0);
|
||||
[item setMinSize: buttonSize];
|
||||
[item setMaxSize: buttonSize];
|
||||
|
||||
return [item autorelease];
|
||||
return item;
|
||||
}
|
||||
|
||||
- (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSString *) ident willBeInsertedIntoToolbar: (BOOL) flag
|
||||
@@ -3819,7 +3732,7 @@ static void removeKeRangerRansomware()
|
||||
GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident];
|
||||
|
||||
NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
|
||||
[segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
|
||||
[segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
|
||||
[groupItem setView: segmentedControl];
|
||||
NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
|
||||
|
||||
@@ -3854,18 +3767,17 @@ static void removeKeRangerRansomware()
|
||||
[groupItem createMenu: @[NSLocalizedString(@"Pause All", "All toolbar item -> label"),
|
||||
NSLocalizedString(@"Resume All", "All toolbar item -> label")]];
|
||||
|
||||
[segmentedControl release];
|
||||
|
||||
[groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
|
||||
|
||||
return [groupItem autorelease];
|
||||
return groupItem;
|
||||
}
|
||||
else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED])
|
||||
{
|
||||
GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident];
|
||||
|
||||
NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
|
||||
[segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
|
||||
[segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
|
||||
[groupItem setView: segmentedControl];
|
||||
NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
|
||||
|
||||
@@ -3900,11 +3812,10 @@ static void removeKeRangerRansomware()
|
||||
[groupItem createMenu: @[NSLocalizedString(@"Pause Selected", "Selected toolbar item -> label"),
|
||||
NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label")]];
|
||||
|
||||
[segmentedControl release];
|
||||
|
||||
[groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
|
||||
|
||||
return [groupItem autorelease];
|
||||
return groupItem;
|
||||
}
|
||||
else if ([ident isEqualToString: TOOLBAR_FILTER])
|
||||
{
|
||||
@@ -4491,7 +4402,7 @@ static void removeKeRangerRansomware()
|
||||
[menu addItem: [NSMenuItem separatorItem]];
|
||||
[menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""];
|
||||
|
||||
return [menu autorelease];
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
|
||||
@@ -4731,7 +4642,6 @@ static void removeKeRangerRansomware()
|
||||
|
||||
[torrent update];
|
||||
[fTorrents addObject: torrent];
|
||||
[torrent release];
|
||||
|
||||
if (!fAddingTransfers)
|
||||
fAddingTransfers = [[NSMutableSet alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user