From 69fda72a8b44bde0cc6b1842f79d5a0a23cc4321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=20C=C5=93ur?= Date: Wed, 9 Nov 2022 13:36:53 +0800 Subject: [PATCH] refactor: remove superfluous interface declarations (#4110) --- macosx/AddMagnetWindowController.mm | 7 ------ macosx/AddWindowController.mm | 9 -------- macosx/BadgeView.mm | 2 -- macosx/BlocklistDownloader.mm | 3 --- macosx/BlocklistDownloaderViewController.mm | 3 --- macosx/BlocklistScheduler.mm | 2 -- macosx/CreatorWindowController.mm | 6 ----- macosx/FileListNode.mm | 2 -- macosx/FileNameCell.mm | 3 --- macosx/FilterBarController.mm | 3 --- macosx/GroupsController.mm | 6 ----- macosx/GroupsPrefsController.mm | 3 --- macosx/InfoActivityViewController.mm | 2 -- macosx/InfoFileViewController.mm | 4 ---- macosx/InfoGeneralViewController.mm | 2 -- macosx/InfoOptionsViewController.mm | 4 ---- macosx/InfoPeersViewController.mm | 4 ---- macosx/InfoTrackersViewController.mm | 5 ----- macosx/InfoWindowController.mm | 3 --- macosx/MessageWindowController.mm | 5 ----- macosx/PortChecker.mm | 4 ---- macosx/PrefsController.mm | 4 ---- macosx/StatsWindowController.mm | 4 ---- macosx/StatusBarView.mm | 6 ----- macosx/Torrent.mm | 25 --------------------- macosx/TorrentCell.mm | 18 --------------- macosx/TorrentTableView.mm | 4 ---- macosx/TrackerCell.mm | 14 ------------ macosx/URLSheetWindowController.mm | 2 -- 29 files changed, 159 deletions(-) diff --git a/macosx/AddMagnetWindowController.mm b/macosx/AddMagnetWindowController.mm index 5e76bb6d4..1f7e82456 100644 --- a/macosx/AddMagnetWindowController.mm +++ b/macosx/AddMagnetWindowController.mm @@ -41,13 +41,6 @@ typedef NS_ENUM(NSUInteger, PopupPriority) { @property(nonatomic) NSInteger fGroupValue; @property(nonatomic) TorrentDeterminationType fGroupDeterminationType; -- (void)confirmAdd; - -- (void)setDestinationPath:(NSString*)destination determinationType:(TorrentDeterminationType)determinationType; - -- (void)setGroupsMenu; -- (void)changeGroupValue:(id)sender; - @end @implementation AddMagnetWindowController diff --git a/macosx/AddWindowController.mm b/macosx/AddWindowController.mm index 918aaec2a..f0af38951 100644 --- a/macosx/AddWindowController.mm +++ b/macosx/AddWindowController.mm @@ -52,15 +52,6 @@ typedef NS_ENUM(NSUInteger, PopupPriority) { @property(nonatomic) TorrentDeterminationType fGroupValueDetermination; -- (void)updateFiles; - -- (void)confirmAdd; - -- (void)setDestinationPath:(NSString*)destination determinationType:(TorrentDeterminationType)determinationType; - -- (void)setGroupsMenu; -- (void)changeGroupValue:(id)sender; - @end @implementation AddWindowController diff --git a/macosx/BadgeView.mm b/macosx/BadgeView.mm index 083d12c1c..0728dc4fa 100644 --- a/macosx/BadgeView.mm +++ b/macosx/BadgeView.mm @@ -16,8 +16,6 @@ static CGFloat const kBetweenPadding = 2.0; @property(nonatomic) CGFloat fDownloadRate; @property(nonatomic) CGFloat fUploadRate; -- (void)badge:(NSImage*)badge string:(NSString*)string atHeight:(CGFloat)height; - @end @implementation BadgeView diff --git a/macosx/BlocklistDownloader.mm b/macosx/BlocklistDownloader.mm index 83a5685c1..1092a59cc 100644 --- a/macosx/BlocklistDownloader.mm +++ b/macosx/BlocklistDownloader.mm @@ -14,9 +14,6 @@ @property(nonatomic) long long fExpectedSize; @property(nonatomic) blocklistDownloadState fState; -- (void)startDownload; -- (BOOL)decompressFrom:(NSURL*)file to:(NSURL*)destination error:(NSError**)error; - @end @implementation BlocklistDownloader diff --git a/macosx/BlocklistDownloaderViewController.mm b/macosx/BlocklistDownloaderViewController.mm index b3c51fffa..4b51492f5 100644 --- a/macosx/BlocklistDownloaderViewController.mm +++ b/macosx/BlocklistDownloaderViewController.mm @@ -16,9 +16,6 @@ @property(nonatomic, readonly) PrefsController* fPrefsController; -- (instancetype)initWithPrefsController:(PrefsController*)prefsController; -- (void)startDownload; - @end @implementation BlocklistDownloaderViewController diff --git a/macosx/BlocklistScheduler.mm b/macosx/BlocklistScheduler.mm index bf9c62081..95197a676 100644 --- a/macosx/BlocklistScheduler.mm +++ b/macosx/BlocklistScheduler.mm @@ -15,8 +15,6 @@ static NSTimeInterval const kFullWait = 60 * 60 * 24 * 7; @property(nonatomic) NSTimer* fTimer; -- (void)runUpdater; - @end @implementation BlocklistScheduler diff --git a/macosx/CreatorWindowController.mm b/macosx/CreatorWindowController.mm index 684cae167..21686ddca 100644 --- a/macosx/CreatorWindowController.mm +++ b/macosx/CreatorWindowController.mm @@ -54,12 +54,6 @@ typedef NS_ENUM(NSUInteger, TrackerSegmentTag) { @property(nonatomic, readonly) NSUserDefaults* fDefaults; -+ (NSURL*)chooseFile; - -- (void)updateLocationField; -- (void)createReal; -- (void)checkProgress; - @end NSMutableSet* creatorWindowControllerSet = nil; diff --git a/macosx/FileListNode.mm b/macosx/FileListNode.mm index 7386f2879..ab2d149d9 100644 --- a/macosx/FileListNode.mm +++ b/macosx/FileListNode.mm @@ -11,8 +11,6 @@ @property(nonatomic, readonly) NSMutableIndexSet* indexesInternal; @property(nonatomic) NSImage* iconInternal; -- (instancetype)initWithFolder:(BOOL)isFolder name:(NSString*)name path:(NSString*)path torrent:(Torrent*)torrent; - @end @implementation FileListNode diff --git a/macosx/FileNameCell.mm b/macosx/FileNameCell.mm index a62b3da71..fb18bb2fa 100644 --- a/macosx/FileNameCell.mm +++ b/macosx/FileNameCell.mm @@ -27,9 +27,6 @@ static CGFloat const kPaddingExpansionFrame = 2.0; @property(nonatomic, readonly) NSMutableDictionary* fTitleAttributes; @property(nonatomic, readonly) NSMutableDictionary* fStatusAttributes; -- (NSRect)rectForTitleWithString:(NSAttributedString*)string inBounds:(NSRect)bounds; -- (NSRect)rectForStatusWithString:(NSAttributedString*)string withTitleRect:(NSRect)titleRect inBounds:(NSRect)bounds; - @end @implementation FileNameCell diff --git a/macosx/FilterBarController.mm b/macosx/FilterBarController.mm index fa629ff3a..24b42844b 100644 --- a/macosx/FilterBarController.mm +++ b/macosx/FilterBarController.mm @@ -38,9 +38,6 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) { @property(nonatomic) IBOutlet NSPopUpButton* fGroupsButton; -- (void)updateGroupsButton; -- (void)updateGroups:(NSNotification*)notification; - @end @implementation FilterBarController diff --git a/macosx/GroupsController.mm b/macosx/GroupsController.mm index 895de1a84..1e8d9a7bd 100644 --- a/macosx/GroupsController.mm +++ b/macosx/GroupsController.mm @@ -14,12 +14,6 @@ static CGFloat const kIconWidthSmall = 12.0; @property(nonatomic, readonly) NSMutableArray* fGroups; -- (void)saveGroups; - -- (NSImage*)imageForGroup:(NSMutableDictionary*)dict; - -- (BOOL)torrent:(Torrent*)torrent doesMatchRulesForGroupAtIndex:(NSInteger)index; - @end @implementation GroupsController diff --git a/macosx/GroupsPrefsController.mm b/macosx/GroupsPrefsController.mm index 54fc7dac8..86d6b6d7f 100644 --- a/macosx/GroupsPrefsController.mm +++ b/macosx/GroupsPrefsController.mm @@ -31,9 +31,6 @@ typedef NS_ENUM(NSInteger, SegmentTag) { @property(nonatomic, weak) IBOutlet NSPredicateEditor* ruleEditor; @property(nonatomic, weak) IBOutlet NSLayoutConstraint* ruleEditorHeightConstraint; -- (void)updateSelectedGroup; -- (void)refreshCustomLocationWithSingleGroup; - @end @implementation GroupsPrefsController diff --git a/macosx/InfoActivityViewController.mm b/macosx/InfoActivityViewController.mm index 487b3f5a1..a1521fddc 100644 --- a/macosx/InfoActivityViewController.mm +++ b/macosx/InfoActivityViewController.mm @@ -68,8 +68,6 @@ static CGFloat const kStackViewVerticalSpacing = 8.0; @property(nonatomic, readonly) CGFloat horizLayoutWidth; @property(nonatomic, readonly) CGFloat vertLayoutHeight; -- (void)setupInfo; - @end @implementation InfoActivityViewController diff --git a/macosx/InfoFileViewController.mm b/macosx/InfoFileViewController.mm index 508e93932..fcde5c205 100644 --- a/macosx/InfoFileViewController.mm +++ b/macosx/InfoFileViewController.mm @@ -20,10 +20,6 @@ @property(nonatomic) IBOutlet NSButton* fCheckAllButton; @property(nonatomic) IBOutlet NSButton* fUncheckAllButton; -- (void)setupInfo; - -- (BOOL)canQuickLookFile:(FileListNode*)item; - @end @implementation InfoFileViewController diff --git a/macosx/InfoGeneralViewController.mm b/macosx/InfoGeneralViewController.mm index 1ba8622ed..5ea754b68 100644 --- a/macosx/InfoGeneralViewController.mm +++ b/macosx/InfoGeneralViewController.mm @@ -35,8 +35,6 @@ @property(nonatomic) IBOutlet NSTextField* fWhereSectionLabel; @property(nonatomic) IBOutlet NSScrollView* fCommentScrollView; -- (void)setupInfo; - @end @implementation InfoGeneralViewController diff --git a/macosx/InfoOptionsViewController.mm b/macosx/InfoOptionsViewController.mm index 2e9f708e6..6f940c2b2 100644 --- a/macosx/InfoOptionsViewController.mm +++ b/macosx/InfoOptionsViewController.mm @@ -67,10 +67,6 @@ static CGFloat const kStackViewSpacing = 8.0; @property(nonatomic, readonly) CGFloat horizLayoutWidth; @property(nonatomic, readonly) CGFloat vertLayoutHeight; -- (void)setupInfo; -- (void)setGlobalLabels; -- (void)updateOptionsNotification:(NSNotification*)notification; - @end @implementation InfoOptionsViewController diff --git a/macosx/InfoPeersViewController.mm b/macosx/InfoPeersViewController.mm index 956c1213d..7bc8d292e 100644 --- a/macosx/InfoPeersViewController.mm +++ b/macosx/InfoPeersViewController.mm @@ -33,10 +33,6 @@ static NSString* const kWebSeedAnimationId = @"webSeed"; @property(nonatomic) IBOutlet NSLayoutConstraint* fWebSeedTableTopConstraint; @property(nonatomic, readonly) NSArray* peerSortDescriptors; -- (void)setupInfo; - -- (void)setWebSeedTableHidden:(BOOL)hide animate:(BOOL)animate; - @end @implementation InfoPeersViewController diff --git a/macosx/InfoTrackersViewController.mm b/macosx/InfoTrackersViewController.mm index bf4bd3170..b2ee35efd 100644 --- a/macosx/InfoTrackersViewController.mm +++ b/macosx/InfoTrackersViewController.mm @@ -28,11 +28,6 @@ typedef NS_ENUM(NSInteger, TrackerSegmentTag) { @property(nonatomic) IBOutlet NSSegmentedControl* fTrackerAddRemoveControl; -- (void)setupInfo; - -- (void)addTrackers; -- (void)removeTrackers; - @end @implementation InfoTrackersViewController diff --git a/macosx/InfoWindowController.mm b/macosx/InfoWindowController.mm index 6a313530d..03254b55c 100644 --- a/macosx/InfoWindowController.mm +++ b/macosx/InfoWindowController.mm @@ -58,9 +58,6 @@ typedef NS_ENUM(unsigned int, tabTag) { @property(nonatomic) IBOutlet NSTextField* fBasicInfoField; @property(nonatomic) IBOutlet NSTextField* fNoneSelectedField; -- (void)resetInfo; -- (void)resetInfoForTorrent:(NSNotification*)notification; - @end @implementation InfoWindowController diff --git a/macosx/MessageWindowController.mm b/macosx/MessageWindowController.mm index 4b55a81ab..50a0a2360 100644 --- a/macosx/MessageWindowController.mm +++ b/macosx/MessageWindowController.mm @@ -39,11 +39,6 @@ static NSTimeInterval const kUpdateSeconds = 0.75; @property(nonatomic) NSLock* fLock; -- (void)resizeColumn; -- (BOOL)shouldIncludeMessageForFilter:(NSString*)filterString message:(NSDictionary*)message; -- (void)updateListForFilter; -- (NSString*)stringForMessage:(NSDictionary*)message; - @end @implementation MessageWindowController diff --git a/macosx/PortChecker.mm b/macosx/PortChecker.mm index d69d9d828..a50836ee9 100644 --- a/macosx/PortChecker.mm +++ b/macosx/PortChecker.mm @@ -16,10 +16,6 @@ static NSTimeInterval const kCheckFireInterval = 3.0; @property(nonatomic) NSTimer* fTimer; -- (void)startProbe:(NSTimer*)timer; - -- (void)callBackWithStatus:(port_status_t)status; - @end @implementation PortChecker diff --git a/macosx/PrefsController.mm b/macosx/PrefsController.mm index 25a3036de..cb62b82eb 100644 --- a/macosx/PrefsController.mm +++ b/macosx/PrefsController.mm @@ -102,10 +102,6 @@ static NSString* const kWebUIURLFormat = @"http://localhost:%ld/"; @property(nonatomic) IBOutlet NSSegmentedControl* fRPCAddRemoveControl; @property(nonatomic, copy) NSString* fRPCPassword; -- (void)setPrefView:(id)sender; - -- (void)setKeychainPassword:(char const*)password forService:(char const*)service username:(char const*)username; - @end @implementation PrefsController diff --git a/macosx/StatsWindowController.mm b/macosx/StatsWindowController.mm index 3c89e21b8..e72a2f580 100644 --- a/macosx/StatsWindowController.mm +++ b/macosx/StatsWindowController.mm @@ -27,10 +27,6 @@ static NSTimeInterval const kUpdateSeconds = 1.0; @property(nonatomic) IBOutlet NSButton* fResetButton; @property(nonatomic) NSTimer* fTimer; -- (void)updateStats; - -- (void)performResetStats; - @end @implementation StatsWindowController diff --git a/macosx/StatusBarView.mm b/macosx/StatusBarView.mm index 2ae1aed41..1cae6e17d 100644 --- a/macosx/StatusBarView.mm +++ b/macosx/StatusBarView.mm @@ -4,12 +4,6 @@ #import "StatusBarView.h" -@interface StatusBarView () - -- (void)reload; - -@end - @implementation StatusBarView - (BOOL)mouseDownCanMoveWindow diff --git a/macosx/Torrent.mm b/macosx/Torrent.mm index a0ce20a50..dc14988f7 100644 --- a/macosx/Torrent.mm +++ b/macosx/Torrent.mm @@ -47,29 +47,6 @@ static int const kETAIdleDisplaySec = 2 * 60; @property(nonatomic) BOOL fTimeMachineExcludeInitialized; -- (instancetype)initWithPath:(NSString*)path - hash:(NSString*)hashString - torrentStruct:(tr_torrent*)torrentStruct - magnetAddress:(NSString*)magnetAddress - lib:(tr_session*)lib - groupValue:(NSNumber*)groupValue - removeWhenFinishSeeding:(NSNumber*)removeWhenFinishSeeding - downloadFolder:(NSString*)downloadFolder - legacyIncompleteFolder:(NSString*)incompleteFolder; - -- (void)createFileList; -- (void)insertPathForComponents:(NSArray*)components - withComponentIndex:(NSUInteger)componentIndex - forParent:(FileListNode*)parent - fileSize:(uint64_t)size - index:(NSInteger)index - flatList:(NSMutableArray*)flatFileList; -- (void)sortFileList:(NSMutableArray*)fileNodes; - -- (void)startQueue; -- (void)ratioLimitHit; -- (void)idleLimitHit; -- (void)metadataRetrieved; - (void)renameFinished:(BOOL)success nodes:(NSArray*)nodes completionHandler:(void (^)(BOOL))completionHandler @@ -79,8 +56,6 @@ static int const kETAIdleDisplaySec = 2 * 60; @property(nonatomic, readonly) BOOL shouldShowEta; @property(nonatomic, readonly) NSString* etaString; -- (void)setTimeMachineExclude:(BOOL)exclude; - @end void renameCallback(tr_torrent* torrent, char const* oldPathCharString, char const* newNameCharString, int error, void* contextInfo) diff --git a/macosx/TorrentCell.mm b/macosx/TorrentCell.mm index 048afe4a5..bad18dfed 100644 --- a/macosx/TorrentCell.mm +++ b/macosx/TorrentCell.mm @@ -49,24 +49,6 @@ static NSInteger const kMaxPieces = 18 * 18; @interface TorrentCell () -- (void)drawBar:(NSRect)barRect; -- (void)drawRegularBar:(NSRect)barRect; -- (void)drawPiecesBar:(NSRect)barRect; - -- (NSRect)rectForMinimalStatusWithString:(NSAttributedString*)string inBounds:(NSRect)bounds; -- (NSRect)rectForTitleWithString:(NSAttributedString*)string - withRightBound:(CGFloat)rightBound - inBounds:(NSRect)bounds - minimal:(BOOL)minimal; -- (NSRect)rectForProgressWithStringInBounds:(NSRect)bounds; -- (NSRect)rectForStatusWithStringInBounds:(NSRect)bounds; -- (NSRect)barRectRegForBounds:(NSRect)bounds; -- (NSRect)barRectMinForBounds:(NSRect)bounds; - -- (NSRect)controlButtonRectForBounds:(NSRect)bounds; -- (NSRect)revealButtonRectForBounds:(NSRect)bounds; -- (NSRect)actionButtonRectForBounds:(NSRect)bounds; - @property(nonatomic, readonly) NSUserDefaults* fDefaults; @property(nonatomic, readonly) NSMutableDictionary* fTitleAttributes; diff --git a/macosx/TorrentTableView.mm b/macosx/TorrentTableView.mm index b0d019472..e943c19de 100644 --- a/macosx/TorrentTableView.mm +++ b/macosx/TorrentTableView.mm @@ -61,10 +61,6 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175; @property(nonatomic) BOOL fActionPopoverShown; @property(nonatomic) NSView* fPositioningView; -- (BOOL)pointInGroupStatusRect:(NSPoint)point; - -- (void)setGroupStatusColumns; - @end @implementation TorrentTableView diff --git a/macosx/TrackerCell.mm b/macosx/TrackerCell.mm index a6a6bebeb..8803c4cd2 100644 --- a/macosx/TrackerCell.mm +++ b/macosx/TrackerCell.mm @@ -27,20 +27,6 @@ static CGFloat const kCountWidth = 60.0; @property(nonatomic, readonly) NSMutableDictionary* fNameAttributes; @property(nonatomic, readonly) NSMutableDictionary* fStatusAttributes; -- (void)loadTrackerIcon:(NSString*)baseAddress; - -- (NSRect)imageRectForBounds:(NSRect)bounds; -- (NSRect)rectForNameWithString:(NSAttributedString*)string inBounds:(NSRect)bounds; -- (NSRect)rectForCountWithString:(NSAttributedString*)string withAboveRect:(NSRect)aboveRect inBounds:(NSRect)bounds; -- (NSRect)rectForCountLabelWithString:(NSAttributedString*)string withRightRect:(NSRect)rightRect inBounds:(NSRect)bounds; -- (NSRect)rectForStatusWithString:(NSAttributedString*)string - withAboveRect:(NSRect)aboveRect - withRightRect:(NSRect)rightRect - inBounds:(NSRect)bounds; - -- (NSAttributedString*)attributedStatusWithString:(NSString*)statusString; -- (NSAttributedString*)attributedCount:(NSInteger)count; - @end @implementation TrackerCell diff --git a/macosx/URLSheetWindowController.mm b/macosx/URLSheetWindowController.mm index 91fa8170c..eee710031 100644 --- a/macosx/URLSheetWindowController.mm +++ b/macosx/URLSheetWindowController.mm @@ -12,8 +12,6 @@ @property(nonatomic) IBOutlet NSButton* fOpenButton; @property(nonatomic) IBOutlet NSButton* fCancelButton; -- (void)updateOpenButtonForURL:(NSString*)string; - @end @implementation URLSheetWindowController