refactor: remove unnecessary NSNotificationCenter observer removals (#5118)

This commit is contained in:
Dmitry Serov 2023-11-03 17:50:45 +00:00 committed by GitHub
parent a2b547fb50
commit 2a65169461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 0 additions and 47 deletions

View File

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

View File

@ -176,8 +176,6 @@ typedef NS_ENUM(NSUInteger, PopupPriority) {
- (void)dealloc - (void)dealloc
{ {
[NSNotificationCenter.defaultCenter removeObserver:self];
[_fTimer invalidate]; [_fTimer invalidate];
} }

View File

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

View File

@ -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"];

View File

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

View File

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

View File

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

View File

@ -141,7 +141,6 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
- (void)dealloc - (void)dealloc
{ {
[NSNotificationCenter.defaultCenter removeObserver:self];
[_fTimer invalidate]; [_fTimer invalidate];
} }

View File

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

View File

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

View File

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

View File

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