Revision: 6912
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6912&view=rev
Author:   hofman
Date:     2010-11-30 19:21:00 +0000 (Tue, 30 Nov 2010)

Log Message:
-----------
don't show errors for all failed documents from folder, as we don't get a 
useful error anyway

Modified Paths:
--------------
    trunk/SKDocumentController.m

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2010-11-30 18:51:05 UTC (rev 6911)
+++ trunk/SKDocumentController.m        2010-11-30 19:21:00 UTC (rev 6912)
@@ -309,6 +309,7 @@
         NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] 
enumeratorAtPath:basePath];
         NSString *path;
         NSMutableArray *urls = [NSMutableArray array];
+        BOOL failed = NO;
         
         while (path = [dirEnum nextObject]) {
             NSURL *url = [NSURL fileURLWithPath:[basePath 
stringByAppendingPathComponent:path]];
@@ -324,16 +325,17 @@
                                  
informativeTextWithFormat:NSLocalizedString(@"Each document opens in a separate 
window.", @"Informative text in alert dialog")];
             
             if (NSAlertDefaultReturn == [alert runModal])
-                [urls removeAllObjects];
+                urls = nil;
         }
         
         for (NSURL *url in urls) {
-            // if we had a previous error and the caller isn't ignoring 
errors, we should inform the user now, as we will lose this error
-            if (outError && error)
-                [self presentError:error];
-            if (doc = [self openDocumentWithContentsOfURL:url 
display:displayDocument error:&error])
-                error = nil;
+           doc = [self openDocumentWithContentsOfURL:url 
display:displayDocument error:&error];
+           if (doc == nil)
+                failed = YES;
         }
+        
+        if (failed)
+            doc = nil;
         if (doc == nil && outError)
             *outError = error ?: [NSError 
errorWithDomain:SKDocumentErrorDomain code:SKReadFileError 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Unable 
to load file", @"Error description"), NSLocalizedDescriptionKey, nil]];
         return doc;


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

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to