Revision: 7801
http://skim-app.svn.sourceforge.net/skim-app/?rev=7801&view=rev
Author: hofman
Date: 2012-11-17 18:44:54 +0000 (Sat, 17 Nov 2012)
Log Message:
-----------
Set update flag for script menu through instance method, pass self through
context
Modified Paths:
--------------
trunk/SKScriptMenu.m
Modified: trunk/SKScriptMenu.m
===================================================================
--- trunk/SKScriptMenu.m 2012-11-15 19:23:49 UTC (rev 7800)
+++ trunk/SKScriptMenu.m 2012-11-17 18:44:54 UTC (rev 7801)
@@ -52,9 +52,11 @@
FSEventStreamRef streamRef;
NSArray *scriptFolders;
NSArray *sortDescriptors;
+ BOOL menuNeedsUpdate;
}
@property (nonatomic, readonly) NSMenu *scriptMenu;
+@property (nonatomic) BOOL menuNeedsUpdate;
+ (id)sharedController;
@@ -66,10 +68,8 @@
@implementation SKScriptMenuController
-static BOOL menuNeedsUpdate = NO;
+@synthesize scriptMenu, menuNeedsUpdate;
-@synthesize scriptMenu;
-
+ (id)sharedController {
static SKScriptMenuController *sharedController = nil;
if (sharedController == nil)
@@ -78,7 +78,7 @@
}
static void fsevents_callback(FSEventStreamRef streamRef, void
*clientCallBackInfo, int numEvents, const char *const eventPaths[], const
FSEventStreamEventFlags *eventMasks, const uint64_t *eventIDs) {
- menuNeedsUpdate = YES;
+ [(id)clientCallBackInfo setMenuNeedsUpdate:YES];
}
- (id)init {
@@ -103,6 +103,8 @@
[menuItem setImage:[NSImage imageNamed:@"ScriptMenu"]];
[[NSApp mainMenu] insertItem:menuItem atIndex:itemIndex];
+ FSEventStreamContext context = {0, (void *)self, NULL, NULL, NULL};
+
scriptMenu = [[menuItem submenu] retain];
sortDescriptors = [[NSArray alloc]
initWithObjects:[[[NSSortDescriptor alloc] initWithKey:FILENAME_KEY
ascending:YES selector:@selector(localizedCaseInsensitiveNumericCompare:)]
autorelease], nil];
@@ -111,7 +113,7 @@
streamRef = FSEventStreamCreate(kCFAllocatorDefault,
(FSEventStreamCallback)&fsevents_callback, // callback
- NULL, // context
+ &context, // context
(CFArrayRef)[scriptFolders
valueForKey:@"path"], // pathsToWatch
kFSEventStreamEventIdSinceNow, //
sinceWhen
1.0, // latency
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit