mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Move ivars to @implementation.
This commit is contained in:
parent
d499c9c856
commit
18266e080e
10 changed files with 93 additions and 115 deletions
|
@ -51,34 +51,12 @@ typedef enum
|
||||||
|
|
||||||
@interface Controller : NSObject <NSURLDownloadDelegate, NSUserNotificationCenterDelegate, NSPopoverDelegate, NSSharingServiceDelegate, NSSharingServicePickerDelegate, NSSoundDelegate, NSToolbarDelegate, NSWindowDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate, VDKQueueDelegate>
|
@interface Controller : NSObject <NSURLDownloadDelegate, NSUserNotificationCenterDelegate, NSPopoverDelegate, NSSharingServiceDelegate, NSSharingServicePickerDelegate, NSSoundDelegate, NSToolbarDelegate, NSWindowDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate, VDKQueueDelegate>
|
||||||
{
|
{
|
||||||
tr_session * fLib;
|
|
||||||
|
|
||||||
NSMutableArray * fTorrents, * fDisplayedTorrents;
|
|
||||||
|
|
||||||
PrefsController * fPrefsController;
|
|
||||||
InfoWindowController * fInfoController;
|
|
||||||
MessageWindowController * fMessageController;
|
|
||||||
|
|
||||||
NSUserDefaults * fDefaults;
|
|
||||||
|
|
||||||
NSString * fConfigDirectory;
|
|
||||||
|
|
||||||
IBOutlet NSWindow * fWindow;
|
IBOutlet NSWindow * fWindow;
|
||||||
DragOverlayWindow * fOverlayWindow;
|
|
||||||
IBOutlet TorrentTableView * fTableView;
|
IBOutlet TorrentTableView * fTableView;
|
||||||
|
|
||||||
io_connect_t fRootPort;
|
|
||||||
NSTimer * fTimer;
|
|
||||||
|
|
||||||
VDKQueue * fFileWatcherQueue;
|
|
||||||
|
|
||||||
IBOutlet NSMenuItem * fOpenIgnoreDownloadFolder;
|
IBOutlet NSMenuItem * fOpenIgnoreDownloadFolder;
|
||||||
IBOutlet NSButton * fActionButton, * fSpeedLimitButton, * fClearCompletedButton;
|
IBOutlet NSButton * fActionButton, * fSpeedLimitButton, * fClearCompletedButton;
|
||||||
IBOutlet NSTextField * fTotalTorrentsField;
|
IBOutlet NSTextField * fTotalTorrentsField;
|
||||||
|
|
||||||
StatusBarController * fStatusBar;
|
|
||||||
|
|
||||||
FilterBarController * fFilterBar;
|
|
||||||
IBOutlet NSMenuItem * fNextFilterItem;
|
IBOutlet NSMenuItem * fNextFilterItem;
|
||||||
|
|
||||||
IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem;
|
IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem;
|
||||||
|
@ -89,26 +67,6 @@ typedef enum
|
||||||
|
|
||||||
IBOutlet NSMenu * fShareMenu, * fShareContextMenu;
|
IBOutlet NSMenu * fShareMenu, * fShareContextMenu;
|
||||||
IBOutlet NSMenuItem * fShareMenuItem, * fShareContextMenuItem; // remove when dropping 10.6
|
IBOutlet NSMenuItem * fShareMenuItem, * fShareContextMenuItem; // remove when dropping 10.6
|
||||||
|
|
||||||
QLPreviewPanel * fPreviewPanel;
|
|
||||||
BOOL fQuitting;
|
|
||||||
BOOL fQuitRequested;
|
|
||||||
BOOL fPauseOnLaunch;
|
|
||||||
|
|
||||||
Badger * fBadger;
|
|
||||||
|
|
||||||
NSMutableArray * fAutoImportedNames;
|
|
||||||
NSTimer * fAutoImportTimer;
|
|
||||||
|
|
||||||
NSMutableDictionary * fPendingTorrentDownloads;
|
|
||||||
|
|
||||||
NSMutableSet * fAddingTransfers;
|
|
||||||
|
|
||||||
NSMutableSet * fAddWindows;
|
|
||||||
URLSheetWindowController * fUrlSheetController;
|
|
||||||
|
|
||||||
BOOL fGlobalPopoverShown;
|
|
||||||
BOOL fSoundPlaying;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NSString *) path;
|
- (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NSString *) path;
|
||||||
|
|
|
@ -234,8 +234,51 @@ static void removeKeRangerRansomware()
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation Controller
|
@implementation Controller
|
||||||
|
{
|
||||||
|
tr_session * fLib;
|
||||||
|
|
||||||
|
NSMutableArray * fTorrents, * fDisplayedTorrents;
|
||||||
|
|
||||||
|
PrefsController * fPrefsController;
|
||||||
|
InfoWindowController * fInfoController;
|
||||||
|
MessageWindowController * fMessageController;
|
||||||
|
|
||||||
|
NSUserDefaults * fDefaults;
|
||||||
|
|
||||||
|
NSString * fConfigDirectory;
|
||||||
|
|
||||||
|
DragOverlayWindow * fOverlayWindow;
|
||||||
|
|
||||||
|
io_connect_t fRootPort;
|
||||||
|
NSTimer * fTimer;
|
||||||
|
|
||||||
|
VDKQueue * fFileWatcherQueue;
|
||||||
|
|
||||||
|
StatusBarController * fStatusBar;
|
||||||
|
|
||||||
|
FilterBarController * fFilterBar;
|
||||||
|
|
||||||
|
QLPreviewPanel * fPreviewPanel;
|
||||||
|
BOOL fQuitting;
|
||||||
|
BOOL fQuitRequested;
|
||||||
|
BOOL fPauseOnLaunch;
|
||||||
|
|
||||||
|
Badger * fBadger;
|
||||||
|
|
||||||
|
NSMutableArray * fAutoImportedNames;
|
||||||
|
NSTimer * fAutoImportTimer;
|
||||||
|
|
||||||
|
NSMutableDictionary * fPendingTorrentDownloads;
|
||||||
|
|
||||||
|
NSMutableSet * fAddingTransfers;
|
||||||
|
|
||||||
|
NSMutableSet * fAddWindows;
|
||||||
|
URLSheetWindowController * fUrlSheetController;
|
||||||
|
|
||||||
|
BOOL fGlobalPopoverShown;
|
||||||
|
BOOL fSoundPlaying;
|
||||||
|
}
|
||||||
|
|
||||||
#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
|
|
||||||
@synthesize prefsController = fPrefsController;
|
@synthesize prefsController = fPrefsController;
|
||||||
@synthesize messageWindowController = fMessageController;
|
@synthesize messageWindowController = fMessageController;
|
||||||
@synthesize fileWatcherQueue = fFileWatcherQueue;
|
@synthesize fileWatcherQueue = fFileWatcherQueue;
|
||||||
|
|
|
@ -25,17 +25,6 @@
|
||||||
@class Torrent;
|
@class Torrent;
|
||||||
|
|
||||||
@interface FileListNode : NSObject <NSCopying>
|
@interface FileListNode : NSObject <NSCopying>
|
||||||
{
|
|
||||||
NSMutableIndexSet * fIndexes;
|
|
||||||
|
|
||||||
NSString * fName;
|
|
||||||
NSString * fPath;
|
|
||||||
Torrent * __weak fTorrent;
|
|
||||||
uint64_t fSize;
|
|
||||||
NSImage * fIcon;
|
|
||||||
BOOL fIsFolder;
|
|
||||||
NSMutableArray * fChildren;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString * name;
|
@property (nonatomic, copy, readonly) NSString * name;
|
||||||
@property (nonatomic, copy, readonly) NSString * path;
|
@property (nonatomic, copy, readonly) NSString * path;
|
||||||
|
|
|
@ -29,8 +29,18 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation FileListNode
|
@implementation FileListNode
|
||||||
|
{
|
||||||
|
NSMutableIndexSet * fIndexes;
|
||||||
|
|
||||||
|
NSString * fName;
|
||||||
|
NSString * fPath;
|
||||||
|
Torrent * __weak fTorrent;
|
||||||
|
uint64_t fSize;
|
||||||
|
NSImage * fIcon;
|
||||||
|
BOOL fIsFolder;
|
||||||
|
NSMutableArray * fChildren;
|
||||||
|
}
|
||||||
|
|
||||||
#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
|
|
||||||
@synthesize name = fName;
|
@synthesize name = fName;
|
||||||
@synthesize path = fPath;
|
@synthesize path = fPath;
|
||||||
@synthesize torrent = fTorrent;
|
@synthesize torrent = fTorrent;
|
||||||
|
|
|
@ -12,17 +12,6 @@
|
||||||
@class Torrent;
|
@class Torrent;
|
||||||
|
|
||||||
@interface FileRenameSheetController : NSWindowController
|
@interface FileRenameSheetController : NSWindowController
|
||||||
{
|
|
||||||
Torrent * _torrent;
|
|
||||||
FileListNode * _node;
|
|
||||||
void (^_completionHandler)(BOOL);
|
|
||||||
NSString * _originalName;
|
|
||||||
|
|
||||||
IBOutlet NSTextField * __weak _labelField;
|
|
||||||
IBOutlet NSTextField * __weak _inputField;
|
|
||||||
IBOutlet NSButton * __weak _renameButton;
|
|
||||||
IBOutlet NSButton * __weak _cancelButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void) presentSheetForTorrent: (Torrent *) torrent modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler;
|
+ (void) presentSheetForTorrent: (Torrent *) torrent modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler;
|
||||||
+ (void) presentSheetForFileListNode: (FileListNode *) node modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler;
|
+ (void) presentSheetForFileListNode: (FileListNode *) node modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler;
|
||||||
|
|
|
@ -23,16 +23,12 @@ typedef void (^CompletionBlock)(BOOL);
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation FileRenameSheetController
|
@implementation FileRenameSheetController
|
||||||
|
{
|
||||||
#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
|
Torrent * _torrent;
|
||||||
@synthesize torrent = _torrent;
|
FileListNode * _node;
|
||||||
@synthesize node = _node;
|
void (^_completionHandler)(BOOL);
|
||||||
@synthesize completionHandler = _completionHandler;
|
NSString * _originalName;
|
||||||
@synthesize originalName = _originalName;
|
}
|
||||||
@synthesize labelField = _labelField;
|
|
||||||
@synthesize inputField = _inputField;
|
|
||||||
@synthesize renameButton = _renameButton;
|
|
||||||
@synthesize cancelButton = _cancelButton;
|
|
||||||
|
|
||||||
+ (void) presentSheetForTorrent: (Torrent *) torrent modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler
|
+ (void) presentSheetForTorrent: (Torrent *) torrent modalForWindow: (NSWindow *) window completionHandler: (void (^)(BOOL didRename)) completionHandler
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,35 +35,6 @@ typedef enum {
|
||||||
#define kTorrentDidChangeGroupNotification @"TorrentDidChangeGroup"
|
#define kTorrentDidChangeGroupNotification @"TorrentDidChangeGroup"
|
||||||
|
|
||||||
@interface Torrent : NSObject <NSCopying, QLPreviewItem>
|
@interface Torrent : NSObject <NSCopying, QLPreviewItem>
|
||||||
{
|
|
||||||
tr_torrent * fHandle;
|
|
||||||
const tr_info * fInfo;
|
|
||||||
const tr_stat * fStat;
|
|
||||||
|
|
||||||
NSUserDefaults * fDefaults;
|
|
||||||
|
|
||||||
NSImage * fIcon;
|
|
||||||
|
|
||||||
NSString * fHashString;
|
|
||||||
|
|
||||||
tr_file_stat * fFileStat;
|
|
||||||
NSArray * fFileList, * fFlatFileList;
|
|
||||||
|
|
||||||
NSIndexSet * fPreviousFinishedIndexes;
|
|
||||||
NSDate * fPreviousFinishedIndexesDate;
|
|
||||||
|
|
||||||
BOOL fRemoveWhenFinishSeeding;
|
|
||||||
|
|
||||||
NSInteger fGroupValue;
|
|
||||||
TorrentDeterminationType fGroupValueDetermination;
|
|
||||||
|
|
||||||
TorrentDeterminationType fDownloadFolderDetermination;
|
|
||||||
|
|
||||||
BOOL fResumeOnWake;
|
|
||||||
|
|
||||||
BOOL fTimeMachineExcludeInitialized;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (BOOL) torrentDelete
|
- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (BOOL) torrentDelete
|
||||||
lib: (tr_session *) lib;
|
lib: (tr_session *) lib;
|
||||||
- (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib;
|
- (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib;
|
||||||
|
|
|
@ -130,8 +130,35 @@ bool trashDataFile(const char * filename, tr_error ** error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation Torrent
|
@implementation Torrent
|
||||||
|
{
|
||||||
|
tr_torrent * fHandle;
|
||||||
|
const tr_info * fInfo;
|
||||||
|
const tr_stat * fStat;
|
||||||
|
|
||||||
|
NSUserDefaults * fDefaults;
|
||||||
|
|
||||||
|
NSImage * fIcon;
|
||||||
|
|
||||||
|
NSString * fHashString;
|
||||||
|
|
||||||
|
tr_file_stat * fFileStat;
|
||||||
|
NSArray * fFileList, * fFlatFileList;
|
||||||
|
|
||||||
|
NSIndexSet * fPreviousFinishedIndexes;
|
||||||
|
NSDate * fPreviousFinishedIndexesDate;
|
||||||
|
|
||||||
|
BOOL fRemoveWhenFinishSeeding;
|
||||||
|
|
||||||
|
NSInteger fGroupValue;
|
||||||
|
TorrentDeterminationType fGroupValueDetermination;
|
||||||
|
|
||||||
|
TorrentDeterminationType fDownloadFolderDetermination;
|
||||||
|
|
||||||
|
BOOL fResumeOnWake;
|
||||||
|
|
||||||
|
BOOL fTimeMachineExcludeInitialized;
|
||||||
|
}
|
||||||
|
|
||||||
#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
|
|
||||||
@synthesize removeWhenFinishSeeding = fRemoveWhenFinishSeeding;
|
@synthesize removeWhenFinishSeeding = fRemoveWhenFinishSeeding;
|
||||||
|
|
||||||
- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (BOOL) torrentDelete
|
- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (BOOL) torrentDelete
|
||||||
|
|
|
@ -27,11 +27,6 @@
|
||||||
@class Torrent;
|
@class Torrent;
|
||||||
|
|
||||||
@interface TrackerNode : NSObject
|
@interface TrackerNode : NSObject
|
||||||
{
|
|
||||||
tr_tracker_stat fStat;
|
|
||||||
|
|
||||||
Torrent * __weak fTorrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@property (nonatomic, weak, readonly) Torrent * torrent;
|
@property (nonatomic, weak, readonly) Torrent * torrent;
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,16 @@
|
||||||
#import "NSStringAdditions.h"
|
#import "NSStringAdditions.h"
|
||||||
|
|
||||||
@implementation TrackerNode
|
@implementation TrackerNode
|
||||||
|
{
|
||||||
#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
|
tr_tracker_stat fStat;
|
||||||
@synthesize torrent = fTorrent;
|
}
|
||||||
|
|
||||||
- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent
|
- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
fStat = *stat;
|
fStat = *stat;
|
||||||
fTorrent = torrent; //weak reference
|
_torrent = torrent; //weak reference
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
Loading…
Reference in a new issue