Revision: 7010
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7010&view=rev
Author:   hofman
Date:     2010-12-23 18:22:26 +0000 (Thu, 23 Dec 2010)

Log Message:
-----------
Move file update checking code to a separate object. This also avoids collision 
between different sheet end notification handlers.

Modified Paths:
--------------
    trunk/SKMainDocument.h
    trunk/SKMainDocument.m
    trunk/Skim.xcodeproj/project.pbxproj

Added Paths:
-----------
    trunk/SKFileUpdateChecker.h
    trunk/SKFileUpdateChecker.m

Added: trunk/SKFileUpdateChecker.h
===================================================================
--- trunk/SKFileUpdateChecker.h                         (rev 0)
+++ trunk/SKFileUpdateChecker.h 2010-12-23 18:22:26 UTC (rev 7010)
@@ -0,0 +1,70 @@
+//
+//  SKFileUpdateChecker.h
+//  Skim
+//
+//  Created by Christiaan Hofman on 12/23/10.
+/*
+ This software is Copyright (c) 2010
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+
+...@interface SKFileUpdateChecker : NSObject {
+    NSDocument *document;
+    
+    NSString *watchedFile;
+    
+    struct _fucFlags {
+        unsigned int autoUpdate:1;
+        unsigned int disableAutoReload:1;
+        unsigned int isUpdatingFile:1;
+        unsigned int receivedFileUpdateNotification:1;
+        unsigned int fileChangedOnDisk:1;
+    } fucFlags;
+    
+    // only used for network filesystems; fileUpdateTimer is not retained by us
+    NSDate *lastModifiedDate;
+    NSTimer *fileUpdateTimer;
+}
+
+- (id)initForDocument:(NSDocument *)aDocument;
+
+- (BOOL)fileChangedOnDisk;
+- (BOOL)isUpdatingFile;
+
+- (void)didUpdateFromURL:(NSURL *)fileURL;
+
+- (void)checkFileUpdatesIfNeeded;
+- (void)stopCheckingFileUpdates;
+
+...@end

Added: trunk/SKFileUpdateChecker.m
===================================================================
--- trunk/SKFileUpdateChecker.m                         (rev 0)
+++ trunk/SKFileUpdateChecker.m 2010-12-23 18:22:26 UTC (rev 7010)
@@ -0,0 +1,325 @@
+//
+//  SKFileUpdateChecker.m
+//  Skim
+//
+//  Created by Christiaan Hofman on 12/23/10.
+/*
+ This software is Copyright (c) 2010
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "SKFileUpdateChecker.h"
+#import "UKKQueue.h"
+#import "SKStringConstants.h"
+#import "NSDocument_SKExtensions.h"
+#import "NSData_SKExtensions.h"
+#import <SkimNotes/SkimNotes.h>
+#import "NSUserDefaultsController_SKExtensions.h"
+
+#define SKAutoReloadFileUpdateKey @"SKAutoReloadFileUpdate"
+
+#define PATH_KEY @"path"
+
+static char SKFileUpdateCheckerDefaultsObservationContext;
+
+...@interface SKFileUpdateChecker (SKPrivate)
+- (void)fileUpdated;
+- (void)handleFileUpdateNotification:(NSNotification *)notification;
+- (void)handleFileMoveNotification:(NSNotification *)notification;
+- (void)handleFileDeleteNotification:(NSNotification *)notification;
+- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification;
+...@end
+
+...@implementation SKFileUpdateChecker
+
+- (id)initForDocument:(NSDocument *)aDocument {
+    if (self = [super init]) {
+        document = aDocument;
+        [[NSUserDefaultsController sharedUserDefaultsController] 
addObserver:self forKey:SKAutoCheckFileUpdateKey 
context:&SKFileUpdateCheckerDefaultsObservationContext];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    @try { [[NSUserDefaultsController sharedUserDefaultsController] 
removeObserver:self forKey:SKAutoCheckFileUpdateKey]; }
+    @catch (id) {}
+    document = nil;
+    [super dealloc];
+}
+
+- (void)stopCheckingFileUpdates {
+    if (watchedFile) {
+        // remove from kqueue and invalidate timer; maybe we've changed 
filesystems
+        UKKQueue *kQueue = [UKKQueue sharedFileWatcher];
+        [kQueue removePath:watchedFile];
+        NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+        [nc removeObserver:self name:UKFileWatcherWriteNotification 
object:kQueue];
+        [nc removeObserver:self name:UKFileWatcherRenameNotification 
object:kQueue];
+        [nc removeObserver:self name:UKFileWatcherDeleteNotification 
object:kQueue];
+        SKDESTROY(watchedFile);
+    }
+    if (fileUpdateTimer) {
+        [fileUpdateTimer invalidate];
+        fileUpdateTimer = nil;
+    }
+}
+
+static BOOL isFileOnHFSVolume(NSString *fileName)
+{
+    FSRef fileRef;
+    OSStatus err;
+    err = FSPathMakeRef((const UInt8 *)[fileName fileSystemRepresentation], 
&fileRef, NULL);
+    
+    FSCatalogInfo fileInfo;
+    if (noErr == err)
+        err = FSGetCatalogInfo(&fileRef, kFSCatInfoVolume, &fileInfo, NULL, 
NULL, NULL);
+    
+    FSVolumeInfo volInfo;
+    if (noErr == err)
+        err = FSGetVolumeInfo(fileInfo.volume, 0, NULL, kFSVolInfoFSInfo, 
&volInfo, NULL, NULL);
+    
+    // HFS and HFS+ are documented to have zero for filesystemID; AFP at least 
is non-zero
+    BOOL isHFSVolume = (noErr == err) ? (0 == volInfo.filesystemID) : NO;
+    
+    return isHFSVolume;
+}
+
+- (void)checkForFileModification:(NSTimer *)timer {
+    NSDate *currentFileModifiedDate = [[[NSFileManager defaultManager] 
attributesOfItemAtPath:[[document fileURL] path] error:NULL] 
fileModificationDate];
+    if (nil == lastModifiedDate) {
+        lastModifiedDate = [currentFileModifiedDate copy];
+    } else if ([lastModifiedDate compare:currentFileModifiedDate] == 
NSOrderedAscending) {
+        // Always reset mod date to prevent repeating messages; note that the 
kqueue also notifies only once
+        [lastModifiedDate release];
+        lastModifiedDate = [currentFileModifiedDate copy];
+        [self handleFileUpdateNotification:nil];
+    }
+}
+
+- (void)checkFileUpdatesIfNeeded {
+    NSString *fileName = [[document fileURL] path];
+    if (fileName) {
+        [self stopCheckingFileUpdates];
+        if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoCheckFileUpdateKey]) {
+            
+            // AFP, NFS, SMB etc. don't support kqueues, so we have to 
manually poll and compare mod dates
+            if (isFileOnHFSVolume(fileName)) {
+                watchedFile = [fileName retain];
+                
+                UKKQueue *kQueue = [UKKQueue sharedFileWatcher];
+                [kQueue addPath:watchedFile];
+                NSNotificationCenter *nc = [NSNotificationCenter 
defaultCenter];
+                [nc addObserver:self 
selector:@selector(handleFileUpdateNotification:) 
name:UKFileWatcherWriteNotification object:kQueue];
+                [nc addObserver:self 
selector:@selector(handleFileMoveNotification:) 
name:UKFileWatcherRenameNotification object:kQueue];
+                [nc addObserver:self 
selector:@selector(handleFileDeleteNotification:) 
name:UKFileWatcherDeleteNotification object:kQueue];
+            } else if (nil == fileUpdateTimer) {
+                // Let the runloop retain the timer; timer retains us.  Use a 
fairly long delay since this is likely a network volume.
+                fileUpdateTimer = [NSTimer 
scheduledTimerWithTimeInterval:(double)2.0 target:self 
selector:@selector(checkForFileModification:) userInfo:nil repeats:YES];
+            }
+        }
+    }
+}
+
+- (BOOL)revertDocument {
+    NSError *error = nil;
+    BOOL didRevert = [document revertToContentsOfURL:[document fileURL] 
ofType:[document fileType] error:&error];
+    if (didRevert == NO && error != nil && 
+        ([[error domain] isEqualToString:NSCocoaErrorDomain] == NO || [error 
code] != NSUserCancelledError))
+        [document presentError:error modalForWindow:[document windowForSheet] 
delegate:nil didPresentSelector:NULL contextInfo:NULL];
+    return didRevert;
+}
+
+- (void)fileUpdateAlertDidEnd:(NSAlert *)alert 
returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
+    
+    if (returnCode == NSAlertOtherReturn) {
+        fucFlags.autoUpdate = NO;
+        fucFlags.disableAutoReload = YES;
+    } else {
+        [[alert window] orderOut:nil];
+        
+        if ([self revertDocument])
+            fucFlags.receivedFileUpdateNotification = NO;
+        if (returnCode == NSAlertAlternateReturn)
+            fucFlags.autoUpdate = YES;
+        fucFlags.disableAutoReload = NO;
+        if (fucFlags.receivedFileUpdateNotification)
+            [self performSelector:@selector(fileUpdated) withObject:nil 
afterDelay:0.0];
+    }
+    fucFlags.isUpdatingFile = NO;
+    fucFlags.receivedFileUpdateNotification = NO;
+}
+
+- (BOOL)canUpdateFromFile:(NSString *)fileName {
+    NSString *extension = [fileName pathExtension];
+    BOOL isDVI = NO;
+    if (extension) {
+        NSWorkspace *ws = [NSWorkspace sharedWorkspace];
+        NSString *theUTI = [ws typeOfFile:[[fileName 
stringByStandardizingPath] stringByResolvingSymlinksInPath] error:NULL];
+        if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame || [ws 
type:theUTI conformsToType:@"net.sourceforge.skim-app.pdfd"]) {
+            fileName = [[NSFileManager defaultManager] 
bundledFileWithExtension:@"pdf" inPDFBundleAtPath:fileName error:NULL];
+            if (fileName == nil)
+                return NO;
+        } else if ([extension caseInsensitiveCompare:@"dvi"] == NSOrderedSame 
|| [extension caseInsensitiveCompare:@"xdv"] == NSOrderedSame) {
+            isDVI = YES;
+        }
+    }
+    
+    NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:fileName];
+    
+    // read the last 1024 bytes of the file (or entire file); Adobe's spec 
says they allow %%EOF anywhere in that range
+    unsigned long long fileEnd = [fh seekToEndOfFile];
+    unsigned long long startPos = fileEnd < 1024 ? 0 : fileEnd - 1024;
+    [fh seekToFileOffset:startPos];
+    NSData *trailerData = [fh readDataToEndOfFile];
+    NSRange range = NSMakeRange(0, [trailerData length]);
+    NSData *pattern = [NSData dataWithBytes:"%%EOF" length:5];
+    NSDataSearchOptions options = NSDataSearchBackwards;
+    
+    if (isDVI) {
+        const char bytes[4] = {0xDF, 0xDF, 0xDF, 0xDF};
+        pattern = [NSData dataWithBytes:bytes length:4];
+        options |= NSDataSearchAnchored;
+    }
+    return NSNotFound != [trailerData rangeOfData:pattern options:options 
range:range].location;
+}
+
+- (void)fileUpdated {
+    NSString *fileName = [[document fileURL] path];
+    
+    // should never happen
+    if (fucFlags.isUpdatingFile)
+        NSLog(@"*** already busy updating file %@", fileName);
+    
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoCheckFileUpdateKey] &&
+        [[NSFileManager defaultManager] fileExistsAtPath:fileName]) {
+        
+        fucFlags.fileChangedOnDisk = YES;
+        
+        fucFlags.isUpdatingFile = YES;
+        fucFlags.receivedFileUpdateNotification = NO;
+        
+        NSWindow *docWindow = [document windowForSheet];
+        
+        // check for attached sheet, since reloading the document while an 
alert is up looks a bit strange
+        if ([docWindow attachedSheet]) {
+            [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleWindowDidEndSheetNotification:) 
+                                                         
name:NSWindowDidEndSheetNotification object:docWindow];
+        } else if ([self canUpdateFromFile:fileName]) {
+            BOOL shouldAutoUpdate = fucFlags.autoUpdate || [[NSUserDefaults 
standardUserDefaults] boolForKey:SKAutoReloadFileUpdateKey];
+            BOOL documentHasEdits = [document isDocumentEdited] || [[document 
notes] count] > 0;
+            if (fucFlags.disableAutoReload == NO && shouldAutoUpdate && 
documentHasEdits) {
+                // tried queuing this with a delayed perform/cancel previous, 
but revert takes long enough that the cancel was never used
+                [self fileUpdateAlertDidEnd:nil 
returnCode:NSAlertDefaultReturn contextInfo:NULL];
+            } else {
+                NSString *message;
+                if (documentHasEdits)
+                    message = NSLocalizedString(@"The PDF file has changed on 
disk. If you reload, your changes will be lost. Do you want to reload this 
document now?", @"Informative text in alert dialog");
+                else 
+                    message = NSLocalizedString(@"The PDF file has changed on 
disk. Do you want to reload this document now? Choosing Auto will reload this 
file automatically for future changes.", @"Informative text in alert dialog");
+                
+                NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"File Updated", @"Message in alert 
dialog") 
+                                                 
defaultButton:NSLocalizedString(@"Yes", @"Button title")
+                                               
alternateButton:NSLocalizedString(@"Auto", @"Button title")
+                                                   
otherButton:NSLocalizedString(@"No", @"Button title")
+                                     informativeTextWithFormat:message];
+                [alert beginSheetModalForWindow:docWindow
+                                  modalDelegate:self
+                                 
didEndSelector:@selector(fileUpdateAlertDidEnd:returnCode:contextInfo:) 
+                                    contextInfo:NULL];
+            }
+        } else {
+            fucFlags.isUpdatingFile = NO;
+            fucFlags.receivedFileUpdateNotification = NO;
+        }
+    } else {
+        fucFlags.isUpdatingFile = NO;
+        fucFlags.receivedFileUpdateNotification = NO;
+    }
+}
+
+- (void)handleFileUpdateNotification:(NSNotification *)notification {
+    NSString *path = [[notification userInfo] objectForKey:PATH_KEY];
+    
+    if ([watchedFile isEqualToString:path] || notification == nil) {
+        // should never happen
+        if (notification && [path isEqualToString:[[document fileURL] path]] 
== NO)
+            NSLog(@"*** received change notice for %@", path);
+        
+        if (fucFlags.isUpdatingFile)
+            fucFlags.receivedFileUpdateNotification = YES;
+        else
+            [self fileUpdated];
+    }
+}
+
+- (void)handleFileMoveNotification:(NSNotification *)notification {
+    if ([watchedFile isEqualToString:[[notification userInfo] 
objectForKey:PATH_KEY]])
+        [self stopCheckingFileUpdates];
+    // If the file is moved, NSDocument will notice and will call setFileURL, 
where we start watching again
+}
+
+- (void)handleFileDeleteNotification:(NSNotification *)notification {
+    if ([watchedFile isEqualToString:[[notification userInfo] 
objectForKey:PATH_KEY]])
+        [self stopCheckingFileUpdates];
+    fucFlags.fileChangedOnDisk = YES;
+}
+
+- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification {
+    // This is only called to delay a file update handling
+    [[NSNotificationCenter defaultCenter] removeObserver:self 
name:NSWindowDidEndSheetNotification object:[notification object]];
+    // Make sure we finish the sheet event first. E.g. the documentEdited 
status may need to be updated.
+    [self performSelector:@selector(fileUpdated) withObject:nil 
afterDelay:0.0];
+}
+
+
+- (BOOL)fileChangedOnDisk {
+    return fucFlags.fileChangedOnDisk;
+}
+
+- (BOOL)isUpdatingFile {
+    return fucFlags.isUpdatingFile;
+}
+
+- (void)didUpdateFromURL:(NSURL *)fileURL {
+    fucFlags.fileChangedOnDisk = NO;
+    [lastModifiedDate release];
+    lastModifiedDate = [[[[NSFileManager defaultManager] 
attributesOfItemAtPath:[fileURL path] error:NULL] fileModificationDate] retain];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 
change:(NSDictionary *)change context:(void *)context {
+    if (context == &SKFileUpdateCheckerDefaultsObservationContext)
+        [self checkFileUpdatesIfNeeded];
+    else
+        [super observeValueForKeyPath:keyPath ofObject:object change:change 
context:context];
+}
+
+...@end

Modified: trunk/SKMainDocument.h
===================================================================
--- trunk/SKMainDocument.h      2010-12-23 12:54:17 UTC (rev 7009)
+++ trunk/SKMainDocument.h      2010-12-23 18:22:26 UTC (rev 7010)
@@ -41,7 +41,7 @@
 
 extern NSString *SKSkimFileDidSaveNotification;
 
-...@class PDFDocument, SKMainWindowController, SKPDFView, SKLine, 
SKProgressController, SKTemporaryData;
+...@class PDFDocument, SKMainWindowController, SKPDFView, SKLine, 
SKProgressController, SKTemporaryData, SKFileUpdateChecker;
 
 @interface SKMainDocument : NSDocument <SKPDFSynchronizerDelegate>
 {
@@ -60,21 +60,11 @@
     SKProgressController *progressController;
     
     SKPDFSynchronizer *synchronizer;
-    NSString *watchedFile;
     
-    struct _docFlags {
-        unsigned int autoUpdate:1;
-        unsigned int disableAutoReload:1;
-        unsigned int isSaving:1;
-        unsigned int isUpdatingFile:1;
-        unsigned int receivedFileUpdateNotification:1;
-        unsigned int fileChangedOnDisk:1;
-        unsigned int exportUsingPanel:1;
-    } docFlags;
+    SKFileUpdateChecker *fileUpdateChecker;
     
-    // only used for network filesystems; fileUpdateTimer is not retained by 
the doc
-    NSDate *lastModifiedDate;
-    NSTimer *fileUpdateTimer;
+    BOOL isSaving;
+    BOOL exportUsingPanel;
     
     NSInvocation *printCallback;
 }

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2010-12-23 12:54:17 UTC (rev 7009)
+++ trunk/SKMainDocument.m      2010-12-23 18:22:26 UTC (rev 7010)
@@ -55,7 +55,6 @@
 #import "SKDocumentController.h"
 #import "SKTemplateParser.h"
 #import "SKApplicationController.h"
-#import "UKKQueue.h"
 #import "PDFSelection_SKExtensions.h"
 #import "SKInfoWindowController.h"
 #import "SKLine.h"
@@ -82,6 +81,7 @@
 #import "SKSyncPreferences.h"
 #import "NSScreen_SKExtensions.h"
 #import "NSURL_SKExtensions.h"
+#import "SKFileUpdateChecker.h"
 
 #define BUNDLE_DATA_FILENAME @"data"
 #define PRESENTATION_OPTIONS_KEY 
@"net_sourceforge_skim-app_presentation_options"
@@ -91,7 +91,6 @@
 NSString *SKSkimFileDidSaveNotification = @"SKSkimFileDidSaveNotification";
 
 #define SKLastExportedTypeKey @"SKLastExportedType"
-#define SKAutoReloadFileUpdateKey @"SKAutoReloadFileUpdate"
 #define SKDisableReloadAlertKey @"SKDisableReloadAlert"
 
 #define URL_KEY             @"URL"
@@ -104,15 +103,11 @@
 #define TARGETPATH_KEY  @"targetPath"
 #define EMAIL_KEY       @"email"
 
-#define PATH_KEY @"path"
-
 #define SKPresentationOptionsKey    @"PresentationOptions"
 #define SKTagsKey                   @"Tags"
 #define SKRatingKey                 @"Rating"
 
-static char SKMainDocumentDefaultsObservationContext;
 
-
 @interface PDFAnnotation (SKPrivateDeclarations)
 - (void)setPage:(PDFPage *)newPage;
 @end
@@ -139,13 +134,6 @@
 
 - (BOOL)tryToUnlockDocument:(PDFDocument *)document;
 
-- (void)checkFileUpdatesIfNeeded;
-- (void)stopCheckingFileUpdates;
-- (void)fileUpdated;
-- (void)handleFileUpdateNotification:(NSNotification *)notification;
-- (void)handleFileMoveNotification:(NSNotification *)notification;
-- (void)handleFileDeleteNotification:(NSNotification *)notification;
-- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification;
 - (void)handleWindowWillCloseNotification:(NSNotification *)notification;
 
 - (SKProgressController *)progressController;
@@ -161,17 +149,23 @@
 
 + (BOOL)isPDFDocument { return YES; }
 
+- (id)init {
+    if (self = [super init]) {
+        fileUpdateChecker = [[SKFileUpdateChecker alloc] initForDocument:self];
+    }
+    return self;
+}
+
 - (void)dealloc {
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     SKDESTROY(mainWindowController);
     [synchronizer terminate];
     [synchronizer setDelegate:nil];
     SKDESTROY(synchronizer);
-    SKDESTROY(watchedFile);
+    SKDESTROY(fileUpdateChecker);
     SKDESTROY(pdfData);
     SKDESTROY(psOrDviData);
     SKDESTROY(readNotesAccessoryView);
-    SKDESTROY(lastModifiedDate);
     SKDESTROY(progressController);
     SKDESTROY(tmpData);
     SKDESTROY(printCallback);
@@ -211,7 +205,6 @@
     
     [[self undoManager] enableUndoRegistration];
     
-    [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self 
forKey:SKAutoCheckFileUpdateKey 
context:&SKMainDocumentDefaultsObservationContext];
        [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleWindowWillCloseNotification:) 
                                                  
name:NSWindowWillCloseNotification object:[[self mainWindowController] window]];
 }
@@ -318,7 +311,7 @@
 
 - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel {
     BOOL success = [super prepareSavePanel:savePanel];
-    if (success && docFlags.exportUsingPanel) {
+    if (success && exportUsingPanel) {
         NSPopUpButton *formatPopup = [[savePanel accessoryView] 
subviewOfClass:[NSPopUpButton class]];
         NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKLastExportedTypeKey];
         if (formatPopup && lastExportedType) {
@@ -335,7 +328,7 @@
 
 - (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation 
delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void 
*)contextInfo {
     // Override so we can determine if this is a save, saveAs or export 
operation, so we can prepare the correct accessory view
-    docFlags.exportUsingPanel = (saveOperation == NSSaveToOperation);
+    exportUsingPanel = (saveOperation == NSSaveToOperation);
     [super runModalSavePanelForSaveOperation:saveOperation delegate:delegate 
didSaveSelector:didSaveSelector contextInfo:contextInfo];
 }
 
@@ -436,9 +429,7 @@
         if (saveOperation == NSSaveOperation || saveOperation == 
NSSaveAsOperation) {
             [[self undoManager] removeAllActions];
             [self updateChangeCount:NSChangeCleared];
-            docFlags.fileChangedOnDisk = NO;
-            [lastModifiedDate release];
-            lastModifiedDate = [[[[NSFileManager defaultManager] 
attributesOfItemAtPath:[[self fileURL] path] error:NULL] fileModificationDate] 
retain];
+            [fileUpdateChecker didUpdateFromURL:[self fileURL]];
         }
     
         if ([[self class] isNativeType:typeName])
@@ -449,12 +440,12 @@
         [[NSFileManager defaultManager] removeItemAtPath:tmpPath error:NULL];
     
     if (saveOperation == NSSaveOperation || saveOperation == 
NSSaveAsOperation) {
-        [self checkFileUpdatesIfNeeded];
-        docFlags.isSaving = NO;
+        [fileUpdateChecker checkFileUpdatesIfNeeded];
+        isSaving = NO;
     }
     
     // in case we saved using the panel we should reset this for the next save
-    docFlags.exportUsingPanel = NO;
+    exportUsingPanel = NO;
     
     NSInvocation *invocation = [info objectForKey:CALLBACK_KEY];
     if (invocation) {
@@ -467,9 +458,9 @@
 // Don't use -saveToURL:ofType:forSaveOperation:error:, because that may 
return before the actual saving when NSDoucment needs to ask the user for 
permission, for instance to override a file lock
 - (void)saveToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName 
forSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate 
didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo {
     if (saveOperation == NSSaveOperation || saveOperation == 
NSSaveAsOperation) {
-        [self stopCheckingFileUpdates];
-        docFlags.isSaving = YES;
-    } else if (docFlags.exportUsingPanel) {
+        [fileUpdateChecker stopCheckingFileUpdates];
+        isSaving = YES;
+    } else if (exportUsingPanel) {
         [[NSUserDefaults standardUserDefaults] setObject:typeName 
forKey:SKLastExportedTypeKey];
     }
     
@@ -791,9 +782,7 @@
             if ([docType isEqualToString:SKPostScriptDocumentType] || [docType 
isEqualToString:SKDVIDocumentType] || [docType 
isEqualToString:SKXDVDocumentType])
                 [self setPSOrDVIData:fileData];
             [pdfDoc release];
-            docFlags.fileChangedOnDisk = NO;
-            [lastModifiedDate release];
-            lastModifiedDate = [[[[NSFileManager defaultManager] 
attributesOfItemAtPath:[absoluteURL path] error:NULL] fileModificationDate] 
retain];
+            [fileUpdateChecker didUpdateFromURL:absoluteURL];
             
             NSDictionary *dictionary = nil;
             NSArray *array = nil;
@@ -851,9 +840,7 @@
         [self setDataFromTmpData];
         [[self undoManager] enableUndoRegistration];
         [[self undoManager] removeAllActions];
-        // file watching could have been disabled if the file was deleted
-        if (watchedFile == nil && fileUpdateTimer == nil)
-            [self checkFileUpdatesIfNeeded];
+        [fileUpdateChecker checkFileUpdatesIfNeeded];
     }
     
     [tmpData release];
@@ -1270,7 +1257,7 @@
      if ([self fileURL]) {      
          if ([self isDocumentEdited]) {         
              [super revertDocumentToSaved:sender];      
-         } else if (docFlags.fileChangedOnDisk) {       
+         } else if ([fileUpdateChecker fileChangedOnDisk]) {    
              NSAlert *alert = [NSAlert alertWithMessageText:[NSString 
stringWithFormat:NSLocalizedString(@"Do you want to revert to the version of 
the document \"%...@\" on disk?", @"Message in alert dialog"), [[[self fileURL] 
path] lastPathComponent]]    
                                               
defaultButton:NSLocalizedString(@"Revert", @"Button title")       
                                             
alternateButton:NSLocalizedString(@"Cancel", @"Button title")       
@@ -1295,7 +1282,7 @@
         NSString *fileName = [[self fileURL] path];
         if (fileName == nil || [[NSFileManager defaultManager] 
fileExistsAtPath:fileName] == NO)
             return NO;
-        return [self isDocumentEdited] || docFlags.fileChangedOnDisk;
+        return [self isDocumentEdited] || [fileUpdateChecker 
fileChangedOnDisk];
     } else if ([anItem action] == @selector(printDocument:)) {
         return [[self pdfDocument] allowsPrinting];
     } else if ([anItem action] == @selector(convertNotes:)) {
@@ -1311,265 +1298,35 @@
     [[self mainWindowController] remoteButtonPressed:theEvent];
 }
 
-
-#pragma mark File update checking
-
-- (void)stopCheckingFileUpdates {
-    if (watchedFile) {
-        // remove from kqueue and invalidate timer; maybe we've changed 
filesystems
-        UKKQueue *kQueue = [UKKQueue sharedFileWatcher];
-        [kQueue removePath:watchedFile];
-        NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
-        [nc removeObserver:self name:UKFileWatcherWriteNotification 
object:kQueue];
-        [nc removeObserver:self name:UKFileWatcherRenameNotification 
object:kQueue];
-        [nc removeObserver:self name:UKFileWatcherDeleteNotification 
object:kQueue];
-        [watchedFile release];
-        watchedFile = nil;
-    }
-    if (fileUpdateTimer) {
-        [fileUpdateTimer invalidate];
-        fileUpdateTimer = nil;
-    }
-}
-
-static BOOL isFileOnHFSVolume(NSString *fileName)
-{
-    FSRef fileRef;
-    OSStatus err;
-    err = FSPathMakeRef((const UInt8 *)[fileName fileSystemRepresentation], 
&fileRef, NULL);
-    
-    FSCatalogInfo fileInfo;
-    if (noErr == err)
-        err = FSGetCatalogInfo(&fileRef, kFSCatInfoVolume, &fileInfo, NULL, 
NULL, NULL);
-    
-    FSVolumeInfo volInfo;
-    if (noErr == err)
-        err = FSGetVolumeInfo(fileInfo.volume, 0, NULL, kFSVolInfoFSInfo, 
&volInfo, NULL, NULL);
-    
-    // HFS and HFS+ are documented to have zero for filesystemID; AFP at least 
is non-zero
-    BOOL isHFSVolume = (noErr == err) ? (0 == volInfo.filesystemID) : NO;
-    
-    return isHFSVolume;
-}
-
-- (void)checkForFileModification:(NSTimer *)timer {
-    NSDate *currentFileModifiedDate = [[[NSFileManager defaultManager] 
attributesOfItemAtPath:[[self fileURL] path] error:NULL] fileModificationDate];
-    if (nil == lastModifiedDate) {
-        lastModifiedDate = [currentFileModifiedDate copy];
-    } else if ([lastModifiedDate compare:currentFileModifiedDate] == 
NSOrderedAscending) {
-        // Always reset mod date to prevent repeating messages; note that the 
kqueue also notifies only once
-        [lastModifiedDate release];
-        lastModifiedDate = [currentFileModifiedDate copy];
-        [self handleFileUpdateNotification:nil];
-    }
-        
-}
-
-- (void)checkFileUpdatesIfNeeded {
-    if ([self fileURL]) {
-        [self stopCheckingFileUpdates];
-        if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoCheckFileUpdateKey]) {
-            
-            // AFP, NFS, SMB etc. don't support kqueues, so we have to 
manually poll and compare mod dates
-            if (isFileOnHFSVolume([[self fileURL] path])) {
-                watchedFile = [[[self fileURL] path] retain];
-                
-                UKKQueue *kQueue = [UKKQueue sharedFileWatcher];
-                [kQueue addPath:watchedFile];
-                NSNotificationCenter *nc = [NSNotificationCenter 
defaultCenter];
-                [nc addObserver:self 
selector:@selector(handleFileUpdateNotification:) 
name:UKFileWatcherWriteNotification object:kQueue];
-                [nc addObserver:self 
selector:@selector(handleFileMoveNotification:) 
name:UKFileWatcherRenameNotification object:kQueue];
-                [nc addObserver:self 
selector:@selector(handleFileDeleteNotification:) 
name:UKFileWatcherDeleteNotification object:kQueue];
-            } else if (nil == fileUpdateTimer) {
-                // Let the runloop retain the timer; timer retains us.  Use a 
fairly long delay since this is likely a network volume.
-                fileUpdateTimer = [NSTimer 
scheduledTimerWithTimeInterval:(double)2.0 target:self 
selector:@selector(checkForFileModification:) userInfo:nil repeats:YES];
-            }
-        }
-    }
-}
-
-- (void)fileUpdateAlertDidEnd:(NSAlert *)alert 
returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
-    
-    if (returnCode == NSAlertOtherReturn) {
-        docFlags.autoUpdate = NO;
-        docFlags.disableAutoReload = YES;
-    } else {
-        NSError *error = nil;
-        
-        [[alert window] orderOut:nil];
-        
-        if ([self revertToContentsOfURL:[self fileURL] ofType:[self fileType] 
error:&error])
-            docFlags.receivedFileUpdateNotification = NO;
-        else if (error && ([[error domain] isEqualToString:NSCocoaErrorDomain] 
== NO || [error code] != NSUserCancelledError))
-            [self presentError:error modalForWindow:[self windowForSheet] 
delegate:nil didPresentSelector:NULL contextInfo:NULL];
-        if (returnCode == NSAlertAlternateReturn)
-            docFlags.autoUpdate = YES;
-        docFlags.disableAutoReload = NO;
-        if (docFlags.receivedFileUpdateNotification)
-            [self performSelector:@selector(fileUpdated) withObject:nil 
afterDelay:0.0];
-    }
-    docFlags.isUpdatingFile = NO;
-    docFlags.receivedFileUpdateNotification = NO;
-}
-
-- (BOOL)canUpdateFromFile:(NSString *)fileName {
-    NSString *extension = [fileName pathExtension];
-    BOOL isDVI = NO;
-    if (extension) {
-        NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-        NSString *theUTI = [ws typeOfFile:[[fileName 
stringByStandardizingPath] stringByResolvingSymlinksInPath] error:NULL];
-        if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame || [ws 
type:theUTI conformsToType:@"net.sourceforge.skim-app.pdfd"]) {
-            fileName = [[NSFileManager defaultManager] 
bundledFileWithExtension:@"pdf" inPDFBundleAtPath:fileName error:NULL];
-            if (fileName == nil)
-                return NO;
-        } else if ([extension caseInsensitiveCompare:@"dvi"] == NSOrderedSame 
|| [extension caseInsensitiveCompare:@"xdv"] == NSOrderedSame) {
-            isDVI = YES;
-        }
-    }
-    
-    NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:fileName];
-    
-    // read the last 1024 bytes of the file (or entire file); Adobe's spec 
says they allow %%EOF anywhere in that range
-    unsigned long long fileEnd = [fh seekToEndOfFile];
-    unsigned long long startPos = fileEnd < 1024 ? 0 : fileEnd - 1024;
-    [fh seekToFileOffset:startPos];
-    NSData *trailerData = [fh readDataToEndOfFile];
-    NSRange range = NSMakeRange(0, [trailerData length]);
-    NSData *pattern = [NSData dataWithBytes:"%%EOF" length:5];
-    NSDataSearchOptions options = NSDataSearchBackwards;
-    
-    if (isDVI) {
-        const char bytes[4] = {0xDF, 0xDF, 0xDF, 0xDF};
-        pattern = [NSData dataWithBytes:bytes length:4];
-        options |= NSDataSearchAnchored;
-    }
-    return NSNotFound != [trailerData rangeOfData:pattern options:options 
range:range].location;
-}
-
-- (void)fileUpdated {
-    NSString *fileName = [[self fileURL] path];
-    
-    // should never happen
-    if (docFlags.isUpdatingFile)
-        NSLog(@"*** already busy updating file %@", fileName);
-    
-    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoCheckFileUpdateKey] &&
-        [[NSFileManager defaultManager] fileExistsAtPath:fileName]) {
-        
-        docFlags.fileChangedOnDisk = YES;
-        
-        docFlags.isUpdatingFile = YES;
-        docFlags.receivedFileUpdateNotification = NO;
-        
-        // check for attached sheet, since reloading the document while an 
alert is up looks a bit strange
-        if ([[self windowForSheet] attachedSheet]) {
-            [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleWindowDidEndSheetNotification:) 
-                                                         
name:NSWindowDidEndSheetNotification object:[self windowForSheet]];
-        } else if ([self canUpdateFromFile:fileName]) {
-            BOOL shouldAutoUpdate = docFlags.autoUpdate || [[NSUserDefaults 
standardUserDefaults] boolForKey:SKAutoReloadFileUpdateKey];
-            if (docFlags.disableAutoReload == NO && shouldAutoUpdate && [self 
isDocumentEdited] == NO && [[self notes] count] == 0) {
-                // tried queuing this with a delayed perform/cancel previous, 
but revert takes long enough that the cancel was never used
-                [self fileUpdateAlertDidEnd:nil 
returnCode:NSAlertDefaultReturn contextInfo:NULL];
-            } else {
-                NSString *message;
-                if ([self isDocumentEdited] || [[self notes] count] > 0)
-                    message = NSLocalizedString(@"The PDF file has changed on 
disk. If you reload, your changes will be lost. Do you want to reload this 
document now?", @"Informative text in alert dialog");
-                else 
-                    message = NSLocalizedString(@"The PDF file has changed on 
disk. Do you want to reload this document now? Choosing Auto will reload this 
file automatically for future changes.", @"Informative text in alert dialog");
-                
-                NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"File Updated", @"Message in alert 
dialog") 
-                                                 
defaultButton:NSLocalizedString(@"Yes", @"Button title")
-                                               
alternateButton:NSLocalizedString(@"Auto", @"Button title")
-                                                   
otherButton:NSLocalizedString(@"No", @"Button title")
-                                     informativeTextWithFormat:message];
-                [alert beginSheetModalForWindow:[self windowForSheet]
-                                  modalDelegate:self
-                                 
didEndSelector:@selector(fileUpdateAlertDidEnd:returnCode:contextInfo:) 
-                                    contextInfo:NULL];
-            }
-        } else {
-            docFlags.isUpdatingFile = NO;
-            docFlags.receivedFileUpdateNotification = NO;
-        }
-    } else {
-        docFlags.isUpdatingFile = NO;
-        docFlags.receivedFileUpdateNotification = NO;
-    }
-}
-
-- (void)handleFileUpdateNotification:(NSNotification *)notification {
-    NSString *path = [[notification userInfo] objectForKey:PATH_KEY];
-    
-    if ([watchedFile isEqualToString:path] || notification == nil) {
-        // should never happen
-        if (notification && [path isEqualToString:[[self fileURL] path]] == NO)
-            NSLog(@"*** received change notice for %@", path);
-        
-        if (docFlags.isUpdatingFile)
-            docFlags.receivedFileUpdateNotification = YES;
-        else
-            [self fileUpdated];
-    }
-}
-
-- (void)handleFileMoveNotification:(NSNotification *)notification {
-    if ([watchedFile isEqualToString:[[notification userInfo] 
objectForKey:PATH_KEY]])
-        [self stopCheckingFileUpdates];
-    // If the file is moved, NSDocument will notice and will call setFileURL, 
where we start watching again
-}
-
-- (void)handleFileDeleteNotification:(NSNotification *)notification {
-    if ([watchedFile isEqualToString:[[notification userInfo] 
objectForKey:PATH_KEY]])
-        [self stopCheckingFileUpdates];
-    docFlags.fileChangedOnDisk = YES;
-}
-
-- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification {
-    // This is only called to delay a file update handling
-    [[NSNotificationCenter defaultCenter] removeObserver:self 
name:NSWindowDidEndSheetNotification object:[notification object]];
-    // Make sure we finish the sheet event first. E.g. the documentEdited 
status may need to be updated.
-    [self performSelector:@selector(fileUpdated) withObject:nil 
afterDelay:0.0];
-}
-
 #pragma mark Notification handlers
 
 - (void)handleWindowWillCloseNotification:(NSNotification *)notification {
     NSWindow *window = [notification object];
     // ignore when we're switching fullscreen/main windows
     if ([window isEqual:[[window windowController] window]]) {
-        [[NSUserDefaultsController sharedUserDefaultsController] 
removeObserver:self forKey:SKAutoCheckFileUpdateKey];
-        [self stopCheckingFileUpdates];
+        [fileUpdateChecker stopCheckingFileUpdates];
+        SKDESTROY(fileUpdateChecker);
         [self saveRecentDocumentInfo];
     }
 }
 
-#pragma mark Notification observation
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 
change:(NSDictionary *)change context:(void *)context {
-    if (context == &SKMainDocumentDefaultsObservationContext) {
-        NSString *key = [keyPath substringFromIndex:7];
-        if ([key isEqualToString:SKAutoCheckFileUpdateKey]) {
-            [self checkFileUpdatesIfNeeded];
-        }
-    } else {
-        [super observeValueForKeyPath:keyPath ofObject:object change:change 
context:context];
-    }
-}
-
 #pragma mark Pdfsync support
 
 - (void)setFileURL:(NSURL *)absoluteURL {
     // this shouldn't be necessary, but better be sure
     if ([self fileURL] && [[self fileURL] isEqual:absoluteURL] == NO)
-        [self stopCheckingFileUpdates];
+        [fileUpdateChecker stopCheckingFileUpdates];
+    
     [super setFileURL:absoluteURL];
+    
+    // if we're saving this will be called when saving has finished
+    if (isSaving == NO)
+        [fileUpdateChecker checkFileUpdatesIfNeeded];
+    
     if ([absoluteURL isFileURL])
         [synchronizer setFileName:[absoluteURL path]];
     else
         [synchronizer setFileName:nil];
-    // if we're saving this will be called when saving has finished
-    if (docFlags.isSaving == NO)
-        [self checkFileUpdatesIfNeeded];
 }
 
 - (SKPDFSynchronizer *)synchronizer {
@@ -2050,7 +1807,7 @@
 
 - (void)handleRevertScriptCommand:(NSScriptCommand *)command {
     if ([self fileURL] && [[NSFileManager defaultManager] 
fileExistsAtPath:[[self fileURL] path]]) {
-        if (docFlags.isUpdatingFile == NO && [self revertToContentsOfURL:[self 
fileURL] ofType:[self fileType] error:NULL] == NO) {
+        if ([fileUpdateChecker isUpdatingFile] == NO && [self 
revertToContentsOfURL:[self fileURL] ofType:[self fileType] error:NULL] == NO) {
             [command setScriptErrorNumber:NSInternalScriptError];
             [command setScriptErrorString:@"Revert failed."];
         }
@@ -2205,4 +1962,3 @@
 }
 
 @end
-

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2010-12-23 12:54:17 UTC (rev 
7009)
+++ trunk/Skim.xcodeproj/project.pbxproj        2010-12-23 18:22:26 UTC (rev 
7010)
@@ -72,6 +72,7 @@
                CE121AC81180644A00951425 /* SKScriptMenu.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE121AC71180644A00951425 /* SKScriptMenu.m */; };
                CE121B2D1180770900951425 /* ScriptMenu.tiff in Resources */ = 
{isa = PBXBuildFile; fileRef = CE121B2C1180770900951425 /* ScriptMenu.tiff */; 
};
                CE121BFB11529D15001D92ED /* SKIBArray.m in Sources */ = {isa = 
PBXBuildFile; fileRef = CE121BFA11529D15001D92ED /* SKIBArray.m */; };
+               CE171E3512C3AC1600291179 /* SKFileUpdateChecker.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE171E3412C3AC1600291179 /* 
SKFileUpdateChecker.m */; };
                CE17F47E0F1A17E200E741DD /* SKPDFSynchronizerServer.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE17F47D0F1A17E200E741DD /* 
SKPDFSynchronizerServer.m */; };
                CE19446310627483007E8770 /* BookmarksWindow.xib in Resources */ 
= {isa = PBXBuildFile; fileRef = CE19445C10627483007E8770 /* 
BookmarksWindow.xib */; };
                CE19446410627483007E8770 /* ConversionProgressWindow.xib in 
Resources */ = {isa = PBXBuildFile; fileRef = CE19445D10627483007E8770 /* 
ConversionProgressWindow.xib */; };
@@ -590,6 +591,8 @@
                CE121B2C1180770900951425 /* ScriptMenu.tiff */ = {isa = 
PBXFileReference; lastKnownFileType = image.tiff; path = ScriptMenu.tiff; 
sourceTree = "<group>"; };
                CE121BF911529D15001D92ED /* SKIBArray.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKIBArray.h; sourceTree = "<group>"; };
                CE121BFA11529D15001D92ED /* SKIBArray.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKIBArray.m; sourceTree = "<group>"; };
+               CE171E3312C3AC1600291179 /* SKFileUpdateChecker.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKFileUpdateChecker.h; sourceTree = "<group>"; };
+               CE171E3412C3AC1600291179 /* SKFileUpdateChecker.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKFileUpdateChecker.m; sourceTree = "<group>"; };
                CE17EE460E24ED7C00DE06EA /* Skim-App.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = 
"Skim-App.xcconfig"; sourceTree = "<group>"; };
                CE17F47C0F1A17E200E741DD /* SKPDFSynchronizerServer.h */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path 
= SKPDFSynchronizerServer.h; sourceTree = "<group>"; };
                CE17F47D0F1A17E200E741DD /* SKPDFSynchronizerServer.m */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; 
path = SKPDFSynchronizerServer.m; sourceTree = "<group>"; };
@@ -1557,6 +1560,8 @@
                                CEAA557E0C6DE030006BD633 /* 
SKDownloadController.m */,
                                CE9768811161195C008DCB8F /* 
SKDownloadPreferenceController.h */,
                                CE9768821161195C008DCB8F /* 
SKDownloadPreferenceController.m */,
+                               CE171E3312C3AC1600291179 /* 
SKFileUpdateChecker.h */,
+                               CE171E3412C3AC1600291179 /* 
SKFileUpdateChecker.m */,
                                CE2DEB1A0B8618DE00D0DA12 /* SKFindController.h 
*/,
                                CE2DEB1B0B8618DE00D0DA12 /* SKFindController.m 
*/,
                                CE54898D0B35D50E00F8AFB6 /* 
SKInfoWindowController.h */,
@@ -2580,6 +2585,7 @@
                                CE94D17B125535DE0053A520 /* 
synctex_parser_utils.m in Sources */,
                                CE1D798F129FE44E00EA3AF0 /* 
NSScriptCommand_SKExtensions.m in Sources */,
                                CE4E1E9A12BCFF5A005227ED /* HIDRemote.m in 
Sources */,
+                               CE171E3512C3AC1600291179 /* 
SKFileUpdateChecker.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to