Changeset 13804
- Timestamp:
- Jan 19, 2013, 5:03:00 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AUTHORS
r13338 r13804 53 53 The Growl Development Team for Growl. <http://growl.info/> 54 54 Andy Matuschak for Sparkle. <http://sparkle.andymatuschak.org/> 55 Christian Hammond for SexyIconEntry. <http://www.chipx86.com/wiki/Libsexy> 56 M. Uli Kusterer for UKKQueue.55 Christian Hammond for SexyIconEntry. <http://www.chipx86.com/wiki/Libsexy> 56 Bryan D K Jones for VDKQueue. <https://github.com/bdkjones/VDKQueue> -
trunk/Transmission.xcodeproj/project.pbxproj
r13789 r13804 250 250 A29E653613F1603100048D71 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A29E653513F1603100048D71 /* evutil_rand.c */; }; 251 251 A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */; }; 252 A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; };253 A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; };254 A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; };255 A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; };256 252 A2A4E9210DE0F7E9000CE197 /* web.h in Headers */ = {isa = PBXBuildFile; fileRef = A29EBE530DC01FC9006CEE80 /* web.h */; }; 257 253 A2A4E9220DE0F7EB000CE197 /* web.c in Sources */ = {isa = PBXBuildFile; fileRef = A29EBE520DC01FC9006CEE80 /* web.c */; }; … … 270 266 A2AAB6650DE0D08B00E04DDA /* blocklist.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D307930D9EC4860051FD27 /* blocklist.h */; }; 271 267 A2AB76EA15D8130B009EFC95 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; 268 A2AB883E16A399A6008FAD50 /* VDKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AB883C16A399A6008FAD50 /* VDKQueue.m */; }; 272 269 A2AF1C390A3D0F6200F1575D /* FileOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AF1C370A3D0F6200F1575D /* FileOutlineView.m */; }; 273 270 A2B3FB460E5901E700FF78FB /* cli.c in Sources */ = {isa = PBXBuildFile; fileRef = A2B3FB450E5901E700FF78FB /* cli.c */; }; … … 953 950 A2A1CB770BF29D5500AE959F /* PeerProgressIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PeerProgressIndicatorCell.h; path = macosx/PeerProgressIndicatorCell.h; sourceTree = "<group>"; }; 954 951 A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PeerProgressIndicatorCell.m; path = macosx/PeerProgressIndicatorCell.m; sourceTree = "<group>"; }; 955 A2A306530AAD24A80049E2AC /* UKFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKFileWatcher.h; path = macosx/UKKQueue/UKFileWatcher.h; sourceTree = "<group>"; };956 A2A306540AAD24A80049E2AC /* UKFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKFileWatcher.m; path = macosx/UKKQueue/UKFileWatcher.m; sourceTree = "<group>"; };957 A2A306550AAD24A80049E2AC /* UKFNSubscribeFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKFNSubscribeFileWatcher.h; path = macosx/UKKQueue/UKFNSubscribeFileWatcher.h; sourceTree = "<group>"; };958 A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKFNSubscribeFileWatcher.m; path = macosx/UKKQueue/UKFNSubscribeFileWatcher.m; sourceTree = "<group>"; };959 A2A306570AAD24A80049E2AC /* UKKQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKKQueue.h; path = macosx/UKKQueue/UKKQueue.h; sourceTree = "<group>"; };960 A2A306580AAD24A80049E2AC /* UKKQueue.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKKQueue.m; path = macosx/UKKQueue/UKKQueue.m; sourceTree = "<group>"; };961 A2A306590AAD24A80049E2AC /* UKMainThreadProxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKMainThreadProxy.h; path = macosx/UKKQueue/UKMainThreadProxy.h; sourceTree = "<group>"; };962 A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKMainThreadProxy.m; path = macosx/UKKQueue/UKMainThreadProxy.m; sourceTree = "<group>"; };963 952 A2A4EA0A0DE106E8000CE197 /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ConvertUTF.c; path = libtransmission/ConvertUTF.c; sourceTree = "<group>"; }; 964 953 A2A4EA0B0DE106E8000CE197 /* ConvertUTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConvertUTF.h; path = libtransmission/ConvertUTF.h; sourceTree = "<group>"; }; … … 976 965 A2AAB65A0DE0CF6200E04DDA /* rpc-server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "rpc-server.h"; path = "libtransmission/rpc-server.h"; sourceTree = "<group>"; }; 977 966 A2AAB65B0DE0CF6200E04DDA /* rpcimpl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rpcimpl.c; path = libtransmission/rpcimpl.c; sourceTree = "<group>"; }; 967 A2AB883B16A399A6008FAD50 /* VDKQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VDKQueue.h; sourceTree = "<group>"; }; 968 A2AB883C16A399A6008FAD50 /* VDKQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VDKQueue.m; sourceTree = "<group>"; }; 978 969 A2AC81D60D987E2D00A2878C /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/AddWindow.xib; sourceTree = "<group>"; }; 979 970 A2AF1C360A3D0F6200F1575D /* FileOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileOutlineView.h; path = macosx/FileOutlineView.h; sourceTree = "<group>"; }; … … 1364 1355 E1B6FBFD0C0D72430015FE4D /* Prefs Window */, 1365 1356 E1B6FC000C0D72A00015FE4D /* Overlay Window */, 1366 E1B6FBEB0C0D70AC0015FE4D /* UKKQueue */,1367 1357 E138A9750C04D88F00C5426C /* ProgressGradients.h */, 1368 1358 E138A9760C04D88F00C5426C /* ProgressGradients.m */, … … 1395 1385 A222EA790E6C32C4009FB003 /* BlocklistScheduler.h */, 1396 1386 A222EA7A0E6C32C4009FB003 /* BlocklistScheduler.m */, 1387 A2AB883916A399A6008FAD50 /* VDKQueue */, 1397 1388 ); 1398 1389 name = Sources; … … 1805 1796 sourceTree = "<group>"; 1806 1797 }; 1798 A2AB883916A399A6008FAD50 /* VDKQueue */ = { 1799 isa = PBXGroup; 1800 children = ( 1801 A2AB883B16A399A6008FAD50 /* VDKQueue.h */, 1802 A2AB883C16A399A6008FAD50 /* VDKQueue.m */, 1803 ); 1804 name = VDKQueue; 1805 path = macosx/VDKQueue; 1806 sourceTree = "<group>"; 1807 }; 1807 1808 A2E384BF130DFA49001F501B /* libutp */ = { 1808 1809 isa = PBXGroup; … … 1927 1928 ); 1928 1929 name = daemon; 1929 sourceTree = "<group>";1930 };1931 E1B6FBEB0C0D70AC0015FE4D /* UKKQueue */ = {1932 isa = PBXGroup;1933 children = (1934 A2A306570AAD24A80049E2AC /* UKKQueue.h */,1935 A2A306580AAD24A80049E2AC /* UKKQueue.m */,1936 A2A306530AAD24A80049E2AC /* UKFileWatcher.h */,1937 A2A306540AAD24A80049E2AC /* UKFileWatcher.m */,1938 A2A306550AAD24A80049E2AC /* UKFNSubscribeFileWatcher.h */,1939 A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */,1940 A2A306590AAD24A80049E2AC /* UKMainThreadProxy.h */,1941 A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */,1942 );1943 name = UKKQueue;1944 1930 sourceTree = "<group>"; 1945 1931 }; … … 2710 2696 A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */, 2711 2697 A256588D0A9A695400E8A03B /* MessageWindowController.m in Sources */, 2712 A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */,2713 A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */,2714 A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */,2715 A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */,2716 2698 A29C8B370ACC6EB3000ED9F9 /* PortChecker.m in Sources */, 2717 2699 A2AA579D0ADFCAB400CA59F6 /* PiecesView.m in Sources */, … … 2767 2749 A2966E8713DAF74C007B52DF /* GlobalOptionsPopoverViewController.m in Sources */, 2768 2750 A234EA541453563B000F3E97 /* NSImageAdditions.m in Sources */, 2751 A2AB883E16A399A6008FAD50 /* VDKQueue.m in Sources */, 2769 2752 ); 2770 2753 runOnlyForDeploymentPostprocessing = 0; -
trunk/macosx/Controller.h
r13414 r13804 27 27 #import <Quartz/Quartz.h> 28 28 #import <Growl/Growl.h> 29 #import "VDKQueue.h" 29 30 30 31 @class AddMagnetWindowController; … … 50 51 } addType; 51 52 52 @interface Controller : NSObject <GrowlApplicationBridgeDelegate, NSURLDownloadDelegate, NSUserNotificationCenterDelegate, NSPopoverDelegate, NSSoundDelegate, NSToolbarDelegate, NSWindowDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate >53 @interface Controller : NSObject <GrowlApplicationBridgeDelegate, NSURLDownloadDelegate, NSUserNotificationCenterDelegate, NSPopoverDelegate, NSSoundDelegate, NSToolbarDelegate, NSWindowDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate, VDKQueueDelegate> 53 54 { 54 55 tr_session * fLib; … … 233 234 234 235 - (void) sleepCallback: (natural_t) messageType argument: (void *) messageArgument; 236 237 @property (retain, readonly) VDKQueue * fileWatcherQueue; 235 238 236 239 - (void) torrentTableViewSelectionDidChange: (NSNotification *) notification; -
trunk/macosx/Controller.m
r13684 r13804 61 61 #import "variant.h" 62 62 63 #import " UKKQueue.h"63 #import "VDKQueue.h" 64 64 #import <Sparkle/Sparkle.h> 65 65 … … 161 161 @synthesize prefsController = fPrefsController; 162 162 @synthesize messageWindowController = fMessageController; 163 @synthesize fileWatcherQueue = fFileWatcherQueue; 163 164 164 165 + (void) initialize … … 372 373 fInfoController = [[InfoWindowController alloc] init]; 373 374 375 //needs to be done before init-ing the prefs controller 376 fFileWatcherQueue = [[[VDKQueue alloc] init] autorelease]; 377 [fFileWatcherQueue setDelegate: self]; 378 374 379 fPrefsController = [[PrefsController alloc] initWithHandle: fLib]; 375 380 … … 385 390 386 391 [GrowlApplicationBridge setGrowlDelegate: self]; 387 388 [[UKKQueue sharedFileWatcher] setDelegate: self];389 392 390 393 [[SUUpdater sharedUpdater] setDelegate: self]; … … 777 780 778 781 [fConfigDirectory release]; 782 783 [fFileWatcherQueue release]; 779 784 780 785 //complete cleanup … … 2930 2935 } 2931 2936 2932 - (void) watcher: (id<UKFileWatcher>) watcher receivedNotification: (NSString *) notification forPath: (NSString *) path 2933 { 2934 if ([notification isEqualToString: UKFileWatcherWriteNotification]) 2935 { 2936 if (![fDefaults boolForKey: @"AutoImport"] || ![fDefaults stringForKey: @"AutoImportDirectory"]) 2937 return; 2938 2939 if (fAutoImportTimer) 2940 { 2941 if ([fAutoImportTimer isValid]) 2942 [fAutoImportTimer invalidate]; 2943 [fAutoImportTimer release]; 2944 fAutoImportTimer = nil; 2945 } 2946 2947 //check again in 10 seconds in case torrent file wasn't complete 2948 fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self 2949 selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain]; 2950 2951 [self checkAutoImportDirectory]; 2952 } 2937 -(void) VDKQueue: (VDKQueue *) queue receivedNotification: (NSString*) notification forPath: (NSString*) fpath 2938 { 2939 NSParameterAssert([notification isEqualToString:VDKQueueWriteNotification]);NSLog(@"%@",notification); 2940 2941 if (![fDefaults boolForKey: @"AutoImport"] || ![fDefaults stringForKey: @"AutoImportDirectory"]) 2942 return; 2943 2944 if (fAutoImportTimer) 2945 { 2946 if ([fAutoImportTimer isValid]) 2947 [fAutoImportTimer invalidate]; 2948 [fAutoImportTimer release]; 2949 fAutoImportTimer = nil; 2950 } 2951 2952 //check again in 10 seconds in case torrent file wasn't complete 2953 fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self 2954 selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain]; 2955 2956 [self checkAutoImportDirectory]; 2953 2957 } 2954 2958 -
trunk/macosx/PrefsController.m
r13492 r13804 31 31 #import "NSApplicationAdditions.h" 32 32 #import "NSStringAdditions.h" 33 #import " UKKQueue.h"33 #import "VDKQueue.h" 34 34 35 35 #import "transmission.h" … … 109 109 NSString * autoPath; 110 110 if ([fDefaults boolForKey: @"AutoImport"] && (autoPath = [fDefaults stringForKey: @"AutoImportDirectory"])) 111 [[ UKKQueue sharedFileWatcher] addPath: [autoPath stringByExpandingTildeInPath]];111 [[(Controller *)[NSApp delegate] fileWatcherQueue] addPath: [autoPath stringByExpandingTildeInPath] notifyingAbout: VDKQueueNotifyAboutWrite]; 112 112 113 113 //set blocklist scheduler … … 925 925 if ((path = [fDefaults stringForKey: @"AutoImportDirectory"])) 926 926 { 927 path = [path stringByExpandingTildeInPath];927 VDKQueue * watcherQueue = [(Controller *)[NSApp delegate] fileWatcherQueue]; 928 928 if ([fDefaults boolForKey: @"AutoImport"]) 929 [[UKKQueue sharedFileWatcher] addPath: path]; 929 { 930 path = [path stringByExpandingTildeInPath]; 931 [watcherQueue addPath: path notifyingAbout: VDKQueueNotifyAboutWrite]; 932 } 930 933 else 931 [ [UKKQueue sharedFileWatcher] removePathFromQueue: path];934 [watcherQueue removeAllPaths]; 932 935 933 936 [[NSNotificationCenter defaultCenter] postNotificationName: @"AutoImportSettingChange" object: self]; … … 948 951 949 952 [panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) { 950 NSString * path = [fDefaults stringForKey: @"AutoImportDirectory"];951 953 if (result == NSFileHandlingPanelOKButton) 952 954 { 953 UKKQueue * sharedQueue = [UKKQueue sharedFileWatcher]; 954 if (path) 955 [sharedQueue removePathFromQueue: [path stringByExpandingTildeInPath]]; 955 VDKQueue * watcherQueue = [(Controller *)[NSApp delegate] fileWatcherQueue]; 956 [watcherQueue removeAllPaths]; 956 957 957 path = [[[panel URLs] objectAtIndex: 0] path];958 NSString * path = [[[panel URLs] objectAtIndex: 0] path]; 958 959 [fDefaults setObject: path forKey: @"AutoImportDirectory"]; 959 [ sharedQueue addPath: [path stringByExpandingTildeInPath]];960 [watcherQueue addPath: [path stringByExpandingTildeInPath] notifyingAbout: VDKQueueNotifyAboutWrite]; 960 961 961 962 [[NSNotificationCenter defaultCenter] postNotificationName: @"AutoImportSettingChange" object: self]; 962 963 } 963 else if (!path) 964 [fDefaults setBool: NO forKey: @"AutoImport"]; 964 else 965 { 966 NSString * path = [fDefaults stringForKey: @"AutoImportDirectory"]; 967 if (!path) 968 [fDefaults setBool: NO forKey: @"AutoImport"]; 969 } 965 970 966 971 [fImportFolderPopUp selectItemAtIndex: 0];
Note: See TracChangeset
for help on using the changeset viewer.