- Timestamp:
- 05/29/08 21:02:30 (7 months ago)
- Location:
- trunk
- Files:
-
- 12 modified
-
MFClient.m (modified) (1 diff)
-
MFClientFS.m (modified) (1 diff)
-
MFCommunicationServer.m (modified) (2 diffs)
-
MFCore.h (modified) (1 diff)
-
MFCore.m (modified) (4 diffs)
-
MFFilesystemController.m (modified) (1 diff)
-
MFLogReader.m (modified) (1 diff)
-
MFMainController.h (modified) (2 diffs)
-
MFMainController.m (modified) (1 diff)
-
MFPreferences.m (modified) (1 diff)
-
MFServerFS.m (modified) (1 diff)
-
Settings/MFSettingsController.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/MFClient.m
r54 r63 213 213 { 214 214 MFClientFS* fs = [self filesystemWithUUID: uuid]; 215 MFLogSO(self, fs, @"Note status changed for fs %@", fs);216 215 [fs noteStatusInfoChanged]; 216 MFLogSO(self, fs, @"Note status changed for fs %@ to %@", fs, fs.status); 217 217 } 218 218 -
trunk/MFClientFS.m
r57 r63 122 122 to:(NSString*)newStatus 123 123 { 124 MFLogS(self, @"Notifying for status %@ -> %@", previousStatus, newStatus);125 124 if ([previousStatus isEqualToString: newStatus]) 126 125 { -
trunk/MFCommunicationServer.m
r54 r63 57 57 toObjectsAtIndexes:indexes 58 58 forKeyPath:@"status" 59 options:NSKeyValueObservingOptionNew 59 options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld 60 60 context:nil]; 61 61 [filesystems addObserver:self … … 111 111 context:(void *)context 112 112 { 113 114 // MFLogS(self, @"Observes: keypath %@ object %@, change %@", keyPath, object, change); 115 // TODO: We need to provide a way to call noteParametersChangedForFSWithUUID: here as well 116 117 if ([keyPath isEqualToString:@"status"] && [object isKindOfClass: [MFFilesystem class]]) 113 if ([keyPath isEqualToString:@"status"] && [object isKindOfClass: [MFFilesystem class]] 114 && ![[change objectForKey: NSKeyValueChangeOldKey] isEqualToString: [change objectForKey: NSKeyValueChangeNewKey]]) 118 115 { 119 116 MFFilesystem* fs = (MFFilesystem*)object; -
trunk/MFCore.h
r62 r63 40 40 // FUSE versioning 41 41 NSString* mfcGetMacFuseVersion(); 42 43 // Trashing 44 void mfcSetupTrashMonitoring(); -
trunk/MFCore.m
r62 r63 157 157 CFStringRef processName; 158 158 FSRef bundleFSRef; 159 OSErr getBundleError;160 id runningAgentPath , runningMenulingPath;159 OSErr error; 160 id runningAgentPath=nil, runningMenulingPath=nil; 161 161 pid_t runningAgentPID, runningMenulingPID; 162 162 … … 171 171 [ (NSString*)processName isEqualToString: @"macfusionMenuling"] ) 172 172 { 173 getBundleError = GetProcessBundleLocation( ¤tPSN, &bundleFSRef);173 error = GetProcessBundleLocation( ¤tPSN, &bundleFSRef); 174 174 GetProcessPID( ¤tPSN , &processPID); 175 175 176 if ( getBundleError == noErr)176 if (error == noErr) 177 177 { 178 178 CFURLRef bundleURLRef = CFURLCreateFromFSRef( kCFAllocatorDefault, &bundleFSRef); … … 207 207 { 208 208 // Agent is in the trash or running from the wrong path. Kill it & restart it. 209 MFLogS( self, @"Killing old or bad agent, and restarting." ); 209 210 kill( runningAgentPID, SIGKILL); 210 211 mfcLaunchAgent(); … … 215 216 { 216 217 // Menuling is in the trash or running from the wrong path. Kill it & restart it. 218 MFLogS( self, @"Killing old or bad menuling, and restarting." ); 217 219 kill( runningMenulingPID, SIGKILL ); 218 220 mfcLaunchMenuling(); 219 221 } 220 222 } 223 224 # pragma mark Trashing 225 226 void trashFSEventCallBack(ConstFSEventStreamRef streamRef, 227 void *clientCallBackInfo, 228 size_t numEvents, 229 void *eventPaths, 230 const FSEventStreamEventFlags eventFlags[], 231 const FSEventStreamEventId eventIds[]) 232 { 233 if (![[NSFileManager defaultManager] fileExistsAtPath: mfcMainBundlePath()]) 234 { 235 MFLogS(self, @"I have been deleted. Goodbye!"); 236 exit(0); 237 } 238 } 239 240 void mfcSetupTrashMonitoring() 241 { 242 FSEventStreamRef eventStream = FSEventStreamCreate( NULL, trashFSEventCallBack, NULL, 243 (CFArrayRef)[NSArray arrayWithObject: 244 [mfcMainBundlePath() stringByDeletingLastPathComponent]], 245 kFSEventStreamEventIdSinceNow, 246 0, kFSEventStreamCreateFlagUseCFTypes ); 247 FSEventStreamScheduleWithRunLoop( eventStream, [[NSRunLoop currentRunLoop] getCFRunLoop], 248 kCFRunLoopDefaultMode ); 249 FSEventStreamStart( eventStream ); 250 } -
trunk/MFFilesystemController.m
r44 r63 98 98 [self loadRecentFilesystems]; 99 99 [self setUpVolumeMonitoring]; 100 MFLogS(self, @"Init complete!");101 100 102 101 } -
trunk/MFLogReader.m
r58 r63 75 75 [self performSelectorOnMainThread:@selector(addASLEntries:) 76 76 withObject:logMessagesToAdd waitUntilDone:NO]; 77 // NSLog(@"Read entries from ASL Done. Added %d", [logMessagesToAdd count]);78 77 } 79 78 80 79 - (void)recordASLMessageDict:(NSDictionary*)messageDict 81 80 { 82 // NSLog(@"Processing %@", messageDict);83 84 81 [[self mutableArrayValueForKey: @"logMessages"] addObject: 85 82 messageDict]; -
trunk/MFMainController.h
r24 r63 16 16 17 17 #import <Cocoa/Cocoa.h> 18 #define TEMP_SSHFS_PATH @"/Users/mgorbach/Library/Macfusion/Plugins/SSHFS.bundle"19 18 20 19 @interface MFMainController : NSObject { … … 24 23 + (MFMainController*)sharedController; 25 24 - (void)initialize; 26 27 // - (void)loadPlugins;28 25 @end -
trunk/MFMainController.m
r44 r63 59 59 - (void)initialize 60 60 { 61 mfcSetupTrashMonitoring(); 61 62 MFPluginController* pluginController = [MFPluginController sharedController]; 62 63 [pluginController loadPlugins]; -
trunk/MFPreferences.m
r57 r63 158 158 - (id)valueForUndefinedKey:(NSString*)key 159 159 { 160 NSLog(@"Value being called");161 160 return [self getValueForPreference: key]; 162 161 } -
trunk/MFServerFS.m
r59 r63 732 732 - (void)setStatus:(NSString*)newStatus 733 733 { 734 if (newStatus )734 if (newStatus && ![newStatus isEqualToString: self.status] ) 735 735 { 736 736 // Hack this a bit so that we can set an error on faliure 737 737 // Do this only if an error hasn't already been set 738 738 [statusInfo setObject: newStatus forKey:kMFSTStatusKey ]; 739 740 /*741 if ([newStatus isEqualToString: kMFStatusFSMounted] )742 [self tagMountPoint];743 */744 739 745 740 if( [newStatus isEqualToString: kMFStatusFSFailed] ) -
trunk/Settings/MFSettingsController.m
r55 r63 95 95 - (BOOL)setup 96 96 { 97 mfcSetupTrashMonitoring(); 97 98 if ([client establishCommunication]) 98 99 {
