Revision: 7502
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7502&view=rev
Author:   hofman
Date:     2011-09-26 11:11:47 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
separate private generic and public method for adding a download

Modified Paths:
--------------
    trunk/SKApplicationController.m
    trunk/SKDocumentController.m
    trunk/SKDownloadController.h
    trunk/SKDownloadController.m

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2011-09-21 16:48:49 UTC (rev 7501)
+++ trunk/SKApplicationController.m     2011-09-26 11:11:47 UTC (rev 7502)
@@ -413,7 +413,7 @@
                 if (document == nil && errorReporting && error && [error 
isUserCancelledError] == NO)
                     [NSApp presentError:error];
             } else {
-                document = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL wantsWindow:YES];
+                document = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL];
             }
         }
     }

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2011-09-21 16:48:49 UTC (rev 7501)
+++ trunk/SKDocumentController.m        2011-09-26 11:11:47 UTC (rev 7502)
@@ -284,7 +284,7 @@
             }
         }
     } else if (showNotes == NO && theURL) {
-        document = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL wantsWindow:YES];
+        document = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL];
     } else if (outError) {
         *outError = [NSError 
readPasteboardErrorWithLocalizedDescription:NSLocalizedString(@"Unable to load 
data from clipboard", @"Error description")];
     }

Modified: trunk/SKDownloadController.h
===================================================================
--- trunk/SKDownloadController.h        2011-09-21 16:48:49 UTC (rev 7501)
+++ trunk/SKDownloadController.h        2011-09-26 11:11:47 UTC (rev 7502)
@@ -62,7 +62,7 @@
 + (NSImage *)deleteImage;
 + (NSImage *)resumeImage;
 
-- (SKDownload *)addDownloadForURL:(NSURL *)aURL wantsWindow:(BOOL)flag;
+- (SKDownload *)addDownloadForURL:(NSURL *)aURL;
 
 - (IBAction)showDownloadPreferences:(id)sender;
 - (IBAction)clearDownloads:(id)sender;

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2011-09-21 16:48:49 UTC (rev 7501)
+++ trunk/SKDownloadController.m        2011-09-26 11:11:47 UTC (rev 7502)
@@ -115,13 +115,13 @@
     [tableView registerForDraggedTypes:[NSArray 
arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, 
nil]];
 }
 
-- (SKDownload *)addDownloadForURL:(NSURL *)aURL wantsWindow:(BOOL)flag {
+- (SKDownload *)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
     SKDownload *download = nil;
     if (aURL) {
         download = [[[SKDownload alloc] initWithURL:aURL] autorelease];
         NSInteger row = [self countOfDownloads];
         [[self mutableArrayValueForKey:DOWNLOADS_KEY] addObject:download];
-        if (flag && [[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoOpenDownloadsWindowKey])
+        if (flag)
             [self showWindow:nil];
         [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] 
byExtendingSelection:NO];
         [tableView scrollRowToVisible:row];
@@ -129,6 +129,10 @@
     return download;
 }
 
+- (SKDownload *)addDownloadForURL:(NSURL *)aURL {
+    return [self addDownloadForURL:aURL showWindow:[[NSUserDefaults 
standardUserDefaults] boolForKey:SKAutoOpenDownloadsWindowKey]];
+}
+
 #pragma mark Images
 
 + (NSImage *)cancelImage {
@@ -377,7 +381,7 @@
         if ([[NSDocumentController sharedDocumentController] 
openDocumentWithContentsOfURL:theURL display:YES error:NULL])
             return YES;
     } else if (theURL) {
-        [self addDownloadForURL:theURL wantsWindow:NO];
+        [self addDownloadForURL:theURL showWindow:NO];
         return YES;
     }
     return NO;
@@ -450,7 +454,7 @@
     if ([theURL isFileURL])
         [[NSDocumentController sharedDocumentController] 
openDocumentWithContentsOfURL:theURL display:YES error:NULL];
     else if (theURL)
-        [self addDownloadForURL:theURL wantsWindow:NO];
+        [self addDownloadForURL:theURL showWindow:NO];
 }
 
 - (BOOL)tableView:(NSTableView *)tv canPasteFromPasteboard:(NSPasteboard 
*)pboard {

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to