Revision: 18494
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18494&view=rev
Author:   hofman
Date:     2012-02-06 17:58:58 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
check whether window controller were loaded to distinguish initial load from 
revert

Modified Paths:
--------------
    trunk/bibdesk/BibDocument.h
    trunk/bibdesk/BibDocument.m

Modified: trunk/bibdesk/BibDocument.h
===================================================================
--- trunk/bibdesk/BibDocument.h 2012-02-06 11:05:40 UTC (rev 18493)
+++ trunk/bibdesk/BibDocument.h 2012-02-06 17:58:58 UTC (rev 18494)
@@ -243,7 +243,6 @@
         unsigned int        tmpSortDescending:1;
         unsigned int        sortGroupsDescending:1;
         unsigned int        dragFromExternalGroups:1;
-        unsigned int        isReverting:1;
         unsigned int        isDocumentClosed:1;
         unsigned int        didImport:1;
         unsigned int        displayMigrationAlert:1;

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2012-02-06 11:05:40 UTC (rev 18493)
+++ trunk/bibdesk/BibDocument.m 2012-02-06 17:58:58 UTC (rev 18494)
@@ -1713,13 +1713,6 @@
 #pragma mark -
 #pragma mark Opening and Loading Files
 
-- (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName 
error:(NSError **)outError{
-    docFlags.isReverting = YES;
-    BOOL success = [super revertToContentsOfURL:absoluteURL ofType:typeName 
error:outError];
-    docFlags.isReverting = NO;
-    return success;
-}
-
 - (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)aType 
error:(NSError **)outError
 {
     BOOL success = NO;
@@ -1893,7 +1886,8 @@
         [recoveryError setValue:[BDSKErrorObjectController 
sharedErrorObjectController] forKey:NSRecoveryAttempterErrorKey];
         [recoveryError setValue:[NSArray 
arrayWithObjects:NSLocalizedString(@"Give Up", @"Button title"), 
NSLocalizedString(@"Keep Going", @"Button title"), NSLocalizedString(@"Edit 
File", @"Button title"), nil] forKey:NSLocalizedRecoveryOptionsErrorKey];
         [recoveryError setValue:error forKey:NSUnderlyingErrorKey];
-        if (docFlags.isReverting == NO)
+        // initial read is before makeWindowControllers, tell the 
recoveryAttempter to remove this document when accepting the error
+        if ([[self windowControllers] count] == 0)
             [recoveryError setValue:self forKey:BDSKFailedDocumentErrorKey];
         
         if ([self presentError:recoveryError])

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


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to