mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 04:18:39 +00:00
refactor: remove unnecessary NSNotificationCenter observer removals (#5118)
This commit is contained in:
@@ -106,11 +106,6 @@ typedef NS_ENUM(NSUInteger, PopupPriority) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setDestination:(id)sender
|
- (void)setDestination:(id)sender
|
||||||
{
|
{
|
||||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||||
|
|||||||
@@ -176,8 +176,6 @@ typedef NS_ENUM(NSUInteger, PopupPriority) {
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
|
|
||||||
[_fTimer invalidate];
|
[_fTimer invalidate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,6 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setTorrents:(NSArray<NSString*>*)files
|
- (void)setTorrents:(NSArray<NSString*>*)files
|
||||||
{
|
{
|
||||||
uint64_t size = 0;
|
uint64_t size = 0;
|
||||||
|
|||||||
@@ -140,11 +140,6 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) {
|
|||||||
self.fSearchField.delegate = self;
|
self.fSearchField.delegate = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setFilter:(id)sender
|
- (void)setFilter:(id)sender
|
||||||
{
|
{
|
||||||
NSString* oldFilterType = [NSUserDefaults.standardUserDefaults stringForKey:@"Filter"];
|
NSString* oldFilterType = [NSUserDefaults.standardUserDefaults stringForKey:@"Filter"];
|
||||||
|
|||||||
@@ -69,11 +69,6 @@ static CGFloat const kStackViewVerticalSpacing = 8.0;
|
|||||||
[self checkWindowSize];
|
[self checkWindowSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (CGFloat)fHorizLayoutHeight
|
- (CGFloat)fHorizLayoutHeight
|
||||||
{
|
{
|
||||||
return NSHeight(self.fTransferView.frame) + 2 * kStackViewInset;
|
return NSHeight(self.fTransferView.frame) + 2 * kStackViewInset;
|
||||||
|
|||||||
@@ -84,11 +84,6 @@ static CGFloat const kStackViewSpacing = 8.0;
|
|||||||
object:nil];
|
object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (CGFloat)fHorizLayoutHeight
|
- (CGFloat)fHorizLayoutHeight
|
||||||
{
|
{
|
||||||
return NSHeight(self.fPriorityView.frame) + 2 * kStackViewInset;
|
return NSHeight(self.fPriorityView.frame) + 2 * kStackViewInset;
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ typedef NS_ENUM(NSUInteger, TabTag) {
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
|
|
||||||
if ([_fViewController respondsToSelector:@selector(saveViewSize)])
|
if ([_fViewController respondsToSelector:@selector(saveViewSize)])
|
||||||
{
|
{
|
||||||
[_fViewController saveViewSize];
|
[_fViewController saveViewSize];
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
[_fTimer invalidate];
|
[_fTimer invalidate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -188,8 +188,6 @@ static NSString* const kWebUIURLFormat = @"http://localhost:%ld/";
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
|
|
||||||
[_fPortStatusTimer invalidate];
|
[_fPortStatusTimer invalidate];
|
||||||
if (_fPortChecker)
|
if (_fPortChecker)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,11 +73,6 @@ typedef NS_ENUM(NSUInteger, StatusTag) {
|
|||||||
object:nil];
|
object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)updateWithDownload:(CGFloat)dlRate upload:(CGFloat)ulRate
|
- (void)updateWithDownload:(CGFloat)dlRate upload:(CGFloat)ulRate
|
||||||
{
|
{
|
||||||
//set rates
|
//set rates
|
||||||
|
|||||||
@@ -168,11 +168,6 @@ bool trashDataFile(char const* filename, void* /*user_data*/, tr_error** error)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString*)description
|
- (NSString*)description
|
||||||
{
|
{
|
||||||
return [@"Torrent: " stringByAppendingString:self.name];
|
return [@"Torrent: " stringByAppendingString:self.name];
|
||||||
|
|||||||
@@ -112,11 +112,6 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)awakeFromNib
|
- (void)awakeFromNib
|
||||||
{
|
{
|
||||||
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable"
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable"
|
||||||
|
|||||||
Reference in New Issue
Block a user