Move private interfaces to interface extensions (#932)

This commit is contained in:
C.W. Betts 2022-01-23 18:32:45 -07:00 committed by GitHub
parent 26bb9f3440
commit 3b4909ac9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 30 additions and 150 deletions

View File

@ -13,7 +13,7 @@
#define POPUP_PRIORITY_NORMAL 1
#define POPUP_PRIORITY_LOW 2
@interface AddMagnetWindowController (Private)
@interface AddMagnetWindowController ()
- (void)confirmAdd;
@ -268,10 +268,6 @@
}
}
@end
@implementation AddMagnetWindowController (Private)
- (void)confirmAdd
{
[fTorrent setGroupValue:fGroupValue determinationType:fGroupDeterminationType];

View File

@ -16,7 +16,7 @@
#define POPUP_PRIORITY_NORMAL 1
#define POPUP_PRIORITY_LOW 2
@interface AddWindowController (Private)
@interface AddWindowController ()
- (void)updateFiles;
@ -324,10 +324,6 @@
}
}
@end
@implementation AddWindowController (Private)
- (void)updateFiles
{
[fTorrent update];

View File

@ -7,7 +7,7 @@
#define BETWEEN_PADDING 2.0
@interface BadgeView (Private)
@interface BadgeView ()
- (void)badge:(NSImage*)badge string:(NSString*)string atHeight:(CGFloat)height adjustForQuit:(BOOL)quit;
@ -78,10 +78,6 @@
}
}
@end
@implementation BadgeView (Private)
- (void)badge:(NSImage*)badge string:(NSString*)string atHeight:(CGFloat)height adjustForQuit:(BOOL)quit
{
if (!fAttributes)

View File

@ -7,7 +7,7 @@
#import "BlocklistScheduler.h"
#import "Controller.h"
@interface BlocklistDownloader (Private)
@interface BlocklistDownloader ()
- (void)startDownload;
- (void)decompressFrom:(NSURL*)file to:(NSURL*)destination error:(NSError**)error;
@ -158,10 +158,6 @@ didFinishDownloadingToURL:(NSURL *)location
});
}
@end
@implementation BlocklistDownloader (Private)
- (void)startDownload
{
fState = BLOCKLIST_DL_START;

View File

@ -7,7 +7,7 @@
#import "PrefsController.h"
#import "NSStringAdditions.h"
@interface BlocklistDownloaderViewController (Private)
@interface BlocklistDownloaderViewController ()
- (instancetype)initWithPrefsController:(PrefsController*)prefsController;
- (void)startDownload;
@ -108,10 +108,6 @@ BlocklistDownloaderViewController* fBLViewController = nil;
}];
}
@end
@implementation BlocklistDownloaderViewController (Private)
- (instancetype)initWithPrefsController:(PrefsController*)prefsController
{
if ((self = [super init]))

View File

@ -11,7 +11,7 @@
//update one week after previous update
#define FULL_WAIT (60 * 60 * 24 * 7)
@interface BlocklistScheduler (Private)
@interface BlocklistScheduler ()
- (void)runUpdater;
@ -71,10 +71,6 @@ BlocklistScheduler* fScheduler = nil;
fTimer = nil;
}
@end
@implementation BlocklistScheduler (Private)
- (void)runUpdater
{
fTimer = nil;

View File

@ -14,7 +14,7 @@
#define TRACKER_ADD_TAG 0
#define TRACKER_REMOVE_TAG 1
@interface CreatorWindowController (Private)
@interface CreatorWindowController ()
+ (NSURL*)chooseFile;
@ -478,10 +478,6 @@ NSMutableSet* creatorWindowControllerSet = nil;
}
}
@end
@implementation CreatorWindowController (Private)
- (void)updateLocationField
{
NSString* pathString = fLocation.path;

View File

@ -9,7 +9,7 @@
#include <libtransmission/transmission.h>
#include <libtransmission/torrent-metainfo.h>
@interface DragOverlayWindow (Private)
@interface DragOverlayWindow ()
- (void)resizeWindow;
@ -171,10 +171,6 @@
}
}
@end
@implementation DragOverlayWindow (Private)
- (void)resizeWindow
{
[self setFrame:self.parentWindow.frame display:NO];

View File

@ -4,7 +4,7 @@
#import "FileListNode.h"
@interface FileListNode (Private)
@interface FileListNode ()
- (instancetype)initWithFolder:(BOOL)isFolder name:(NSString*)name path:(NSString*)path torrent:(Torrent*)torrent;
@ -137,10 +137,6 @@
return NO;
}
@end
@implementation FileListNode (Private)
- (instancetype)initWithFolder:(BOOL)isFolder name:(NSString*)name path:(NSString*)path torrent:(Torrent*)torrent
{
if ((self = [super init]))

View File

@ -20,7 +20,7 @@
#define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0
#define PADDING_EXPANSION_FRAME 2.0
@interface FileNameCell (Private)
@interface FileNameCell ()
- (NSRect)rectForTitleWithString:(NSAttributedString*)string inBounds:(NSRect)bounds;
- (NSRect)rectForStatusWithString:(NSAttributedString*)string withTitleRect:(NSRect)titleRect inBounds:(NSRect)bounds;
@ -142,10 +142,6 @@
[titleString drawInRect:cellFrame];
}
@end
@implementation FileNameCell (Private)
- (NSRect)rectForTitleWithString:(NSAttributedString*)string inBounds:(NSRect)bounds
{
NSSize const titleSize = [string size];

View File

@ -27,7 +27,7 @@ typedef NS_ENUM(unsigned int, filePriorityMenuTag) { //
FILE_PRIORITY_LOW_TAG
};
@interface FileOutlineController (Private)
@interface FileOutlineController ()
@property(nonatomic, readonly) NSMenu* menu;
@ -598,10 +598,6 @@ typedef NS_ENUM(unsigned int, filePriorityMenuTag) { //
return YES;
}
@end
@implementation FileOutlineController (Private)
- (NSMenu*)menu
{
NSMenu* menu = [[NSMenu alloc] initWithTitle:@"File Outline Menu"];

View File

@ -13,7 +13,7 @@
#define SEARCH_MIN_WIDTH 48.0
#define SEARCH_MAX_WIDTH 95.0
@interface FilterBarController (Private)
@interface FilterBarController ()
- (void)resizeBar;
- (void)updateGroupsButton;
@ -363,10 +363,6 @@
return YES;
}
@end
@implementation FilterBarController (Private)
- (void)resizeBar
{
//replace all buttons

View File

@ -8,7 +8,7 @@
#define ICON_WIDTH 16.0
#define ICON_WIDTH_SMALL 12.0
@interface GroupsController (Private)
@interface GroupsController ()
- (void)saveGroups;
@ -335,10 +335,6 @@ GroupsController* fGroupsInstance = nil;
return -1;
}
@end
@implementation GroupsController (Private)
- (void)saveGroups
{
//don't archive the icon

View File

@ -21,7 +21,7 @@
@end
@interface GroupsPrefsController (Private)
@interface GroupsPrefsController ()
- (void)updateSelectedGroup;
- (void)refreshCustomLocationWithSingleGroup;
@ -333,10 +333,6 @@
ruleEditorScrollView.hasVerticalScroller = requiredRowCount > maxVisibleRowCount;
}
@end
@implementation GroupsPrefsController (Private)
- (void)updateSelectedGroup
{
[fAddRemoveControl setEnabled:fTableView.numberOfSelectedRows > 0 forSegment:REMOVE_TAG];

View File

@ -14,7 +14,7 @@
#define PIECES_CONTROL_PROGRESS 0
#define PIECES_CONTROL_AVAILABLE 1
@interface InfoActivityViewController (Private)
@interface InfoActivityViewController ()
- (void)setupInfo;
@ -246,10 +246,6 @@
[fPiecesView clearView];
}
@end
@implementation InfoActivityViewController (Private)
- (void)setupInfo
{
NSUInteger const count = fTorrents.count;

View File

@ -8,7 +8,7 @@
#import "FileOutlineView.h"
#import "Torrent.h"
@interface InfoFileViewController (Private)
@interface InfoFileViewController ()
- (void)setupInfo;
@ -191,10 +191,6 @@
return NSZeroRect;
}
@end
@implementation InfoFileViewController (Private)
- (void)setupInfo
{
fFileFilterField.stringValue = @"";

View File

@ -6,7 +6,7 @@
#import "NSStringAdditions.h"
#import "Torrent.h"
@interface InfoGeneralViewController (Private)
@interface InfoGeneralViewController ()
- (void)setupInfo;
@ -127,10 +127,6 @@
[NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:@[ file ]];
}
@end
@implementation InfoGeneralViewController (Private)
- (void)setupInfo
{
if (fTorrents.count == 1)

View File

@ -15,7 +15,7 @@
#define ANIMATION_ID_KEY @"animationId"
#define WEB_SEED_ANIMATION_ID @"webSeed"
@interface InfoPeersViewController (Private)<CAAnimationDelegate>
@interface InfoPeersViewController ()<CAAnimationDelegate>
- (void)setupInfo;
@ -506,10 +506,6 @@
fWebSeedTable.enclosingScrollView.hidden = finished && fWebSeedTableTopConstraint.constant < 0;
}
@end
@implementation InfoPeersViewController (Private)
- (void)setupInfo
{
__block BOOL hasWebSeeds = NO;

View File

@ -14,7 +14,7 @@
#define TRACKER_ADD_TAG 0
#define TRACKER_REMOVE_TAG 1
@interface InfoTrackersViewController (Private)
@interface InfoTrackersViewController ()
- (void)setupInfo;
@ -262,10 +262,6 @@
}
}
@end
@implementation InfoTrackersViewController (Private)
- (void)setupInfo
{
NSUInteger const numberSelected = fTorrents.count;

View File

@ -17,7 +17,7 @@
#define UPDATE_SECONDS 0.75
@interface MessageWindowController (Private)
@interface MessageWindowController ()
- (void)resizeColumn;
- (BOOL)shouldIncludeMessageForFilter:(NSString*)filterString message:(NSDictionary*)message;
@ -418,10 +418,6 @@
}];
}
@end
@implementation MessageWindowController (Private)
- (void)resizeColumn
{
[fMessageTable noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, fMessageTable.numberOfRows)]];

View File

@ -7,7 +7,7 @@
#define CHECKER_URL(port) [NSString stringWithFormat:@"https://portcheck.transmissionbt.com/%ld", port]
#define CHECK_FIRE 3.0
@interface PortChecker (Private)
@interface PortChecker ()
- (void)startProbe:(NSTimer*)timer;
@ -99,10 +99,6 @@
}
}
@end
@implementation PortChecker (Private)
- (void)startProbe:(NSTimer*)timer
{
fTimer = nil;

View File

@ -39,7 +39,7 @@
#define WEBUI_URL @"http://localhost:%ld/"
@interface PrefsController (Private)
@interface PrefsController ()
- (void)setPrefView:(id)sender;
@ -1491,10 +1491,6 @@
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateGlobalOptions" object:nil];
}
@end
@implementation PrefsController (Private)
- (void)setPrefView:(id)sender
{
NSString* identifier;

View File

@ -9,7 +9,7 @@
#define UPDATE_SECONDS 1.0
@interface StatsWindowController (Private)
@interface StatsWindowController ()
- (void)updateStats;
@ -152,10 +152,6 @@ tr_session* fLib = NULL;
return @"StatsWindow";
}
@end
@implementation StatsWindowController (Private)
- (void)updateStats
{
tr_session_stats statsAll, statsSession;

View File

@ -19,7 +19,7 @@ typedef NS_ENUM(unsigned int, statusTag) {
STATUS_TRANSFER_SESSION_TAG = 3
};
@interface StatusBarController (Private)
@interface StatusBarController ()
- (void)resizeStatusButton;
@ -236,10 +236,6 @@ typedef NS_ENUM(unsigned int, statusTag) {
return YES;
}
@end
@implementation StatusBarController (Private)
- (void)resizeStatusButton
{
[fStatusButton sizeToFit];

View File

@ -5,7 +5,7 @@
#import "StatusBarView.h"
#import "NSApplicationAdditions.h"
@interface StatusBarView (Private)
@interface StatusBarView ()
- (void)reload;
@ -36,10 +36,6 @@
}
}
@end
@implementation StatusBarView (Private)
- (void)reload
{
self.needsDisplay = YES;

View File

@ -19,7 +19,7 @@
#define ETA_IDLE_DISPLAY_SEC (2 * 60)
@interface Torrent (Private)
@interface Torrent ()
- (instancetype)initWithPath:(NSString*)path
hash:(NSString*)hashString
@ -1793,10 +1793,6 @@ bool trashDataFile(char const* filename, tr_error** error)
return location ? [NSURL fileURLWithPath:location] : nil;
}
@end
@implementation Torrent (Private)
- (instancetype)initWithPath:(NSString*)path
hash:(NSString*)hashString
torrentStruct:(tr_torrent*)torrentStruct

View File

@ -43,7 +43,7 @@
#define MAX_PIECES (18 * 18)
@interface TorrentCell (Private)
@interface TorrentCell ()
- (void)drawBar:(NSRect)barRect;
- (void)drawRegularBar:(NSRect)barRect;
@ -563,10 +563,6 @@
[titleString drawInRect:cellFrame];
}
@end
@implementation TorrentCell (Private)
- (void)drawBar:(NSRect)barRect
{
BOOL const minimal = [fDefaults boolForKey:@"SmallView"];

View File

@ -25,7 +25,7 @@
#define TOGGLE_PROGRESS_SECONDS 0.175
@interface TorrentTableView (Private)
@interface TorrentTableView ()
- (BOOL)pointInGroupStatusRect:(NSPoint)point;
@ -960,10 +960,6 @@
[[self.superview animator] setBoundsOrigin:scrollOrigin];
}
@end
@implementation TorrentTableView (Private)
- (BOOL)pointInGroupStatusRect:(NSPoint)point
{
NSInteger row = [self rowAtPoint:point];

View File

@ -18,7 +18,7 @@
#define PADDING_BETWEEN_LINES_ON_SAME_LINE 4.0
#define COUNT_WIDTH 40.0
@interface TrackerCell (Private)
@interface TrackerCell ()
@property(nonatomic, readonly) NSImage* favIcon;
- (void)loadTrackerIcon:(NSString*)baseAddress;
@ -157,10 +157,6 @@ NSMutableSet* fTrackerIconLoading;
[lastScrapeString drawInRect:lastScrapeRect];
}
@end
@implementation TrackerCell (Private)
- (NSImage*)favIcon
{
id icon = nil;

View File

@ -5,7 +5,7 @@
#import "URLSheetWindowController.h"
#import "Controller.h"
@interface URLSheetWindowController (Private)
@interface URLSheetWindowController ()
- (void)updateOpenButtonForURL:(NSString*)string;
@ -86,10 +86,6 @@ NSString* urlString = nil;
[self updateOpenButtonForURL:fTextField.stringValue];
}
@end
@implementation URLSheetWindowController (Private)
- (void)updateOpenButtonForURL:(NSString*)string
{
BOOL enable = YES;