Changeset 5858
- Timestamp:
- May 20, 2008, 3:16:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Transmission.xcodeproj/project.pbxproj
r5849 r5858 342 342 containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 343 343 proxyType = 1; 344 remoteGlobalIDString = A2AAB6BA0DE0D55D00E04DDA /* shttpd */;344 remoteGlobalIDString = A2AAB6BA0DE0D55D00E04DDA; 345 345 remoteInfo = shttpd; 346 346 }; -
trunk/macosx/Controller.h
r5851 r5858 231 231 - (void) beginCreateFile: (NSNotification *) notification; 232 232 233 - (void) sleepCall Back: (natural_t) messageType argument: (void *) messageArgument;233 - (void) sleepCallback: (natural_t) messageType argument: (void *) messageArgument; 234 234 235 235 - (void) torrentTableViewSelectionDidChange: (NSNotification *) notification; … … 262 262 - (void) prepareForUpdate: (NSNotification *) notification; 263 263 264 - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_torrent *) torrentStruct; 265 264 266 @end -
trunk/macosx/Controller.m
r5851 r5858 139 139 #define DONATE_URL @"http://www.transmissionbt.com/donate.php" 140 140 141 void sleepCallBack(void * controller, io_service_t y, natural_t messageType, void * messageArgument) 142 { 143 [(Controller *)controller sleepCallBack: messageType argument: messageArgument]; 141 static void rpcCallback(tr_handle * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct, void * controller) 142 { 143 [(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct]; 144 } 145 146 static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument) 147 { 148 [(Controller *)controller sleepCallback: messageType argument: messageArgument]; 144 149 } 145 150 … … 228 233 fSoundPlaying = NO; 229 234 235 tr_sessionSetRPCCallback(fLib, rpcCallback, self); 236 230 237 [GrowlApplicationBridge setGrowlDelegate: self]; 231 238 [[UKKQueue sharedFileWatcher] setDelegate: self]; … … 336 343 IONotificationPortRef notify; 337 344 io_object_t iterator; 338 if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCall Back, &iterator)))345 if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCallback, &iterator))) 339 346 CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes); 340 347 else … … 3759 3766 } 3760 3767 3761 - (void) sleepCall Back: (natural_t) messageType argument: (void *) messageArgument3768 - (void) sleepCallback: (natural_t) messageType argument: (void *) messageArgument 3762 3769 { 3763 3770 NSEnumerator * enumerator; … … 4047 4054 } 4048 4055 4056 - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_torrent *) torrentStruct 4057 { 4058 //get the torrent 4059 if (torrentStruct != NULL) 4060 { 4061 NSEnumerator * enumerator = [fTorrents objectEnumerator]; 4062 Torrent * torrent; 4063 while ((torrent = [enumerator nextObject])) 4064 if (torrentStruct == [torrent torrentStruct]) 4065 break; 4066 4067 if (!torrent) 4068 { 4069 NSLog(@"No torrent found matching torrent struct given in RPC callback!"); 4070 return; 4071 } 4072 } 4073 4074 switch (type) 4075 { 4076 case TR_RPC_TORRENT_ADDED: 4077 break; 4078 case TR_RPC_TORRENT_STARTED: 4079 break; 4080 case TR_RPC_TORRENT_STOPPED: 4081 break; 4082 case TR_RPC_TORRENT_CLOSING: 4083 break; 4084 case TR_RPC_TORRENT_CHANGED: 4085 break; 4086 case TR_RPC_SESSION_CHANGED: 4087 break; 4088 } 4089 } 4090 4049 4091 /*- (void) ipcQuit 4050 4092 { -
trunk/macosx/Torrent.h
r5678 r5858 40 40 const tr_info * fInfo; 41 41 const tr_stat * fStat; 42 43 int fID;44 42 45 43 BOOL fResumeOnWake; … … 252 250 - (NSNumber *) stateSortKey; 253 251 254 - (int) torrentID;255 252 - (tr_torrent *) torrentStruct; 256 253 -
trunk/macosx/Torrent.m
r5849 r5858 27 27 #import "NSApplicationAdditions.h" 28 28 #import "NSStringAdditions.h" 29 30 static int static_lastid = 0;31 29 32 30 @interface Torrent (Private) … … 1518 1516 } 1519 1517 1520 - (int) torrentID1521 {1522 return fID;1523 }1524 1525 1518 - (tr_torrent *) torrentStruct 1526 1519 { … … 1545 1538 if (!(self = [super init])) 1546 1539 return nil; 1547 1548 static_lastid++;1549 fID = static_lastid;1550 1540 1551 1541 fDefaults = [NSUserDefaults standardUserDefaults];
Note: See TracChangeset
for help on using the changeset viewer.