Revision: 14701
          http://sourceforge.net/p/skim-app/code/14701
Author:   hofman
Date:     2024-11-16 10:11:28 +0000 (Sat, 16 Nov 2024)
Log Message:
-----------
Remove convenience method to add a download from a URL, createe download and 
add it instead.

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

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2024-11-16 10:05:48 UTC (rev 14700)
+++ trunk/SKApplicationController.m     2024-11-16 10:11:28 UTC (rev 14701)
@@ -477,7 +477,10 @@
                 }];
             }
         } else if (theURL) {
-            [[self downloadController] addDownloadForURL:theURL];
+            SKDownload *download = [[SKDownload alloc] initWithURL:theURL];
+            [[self downloadController] addObjectToDownloads:download];
+            if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoOpenDownloadsWindowKey])
+                [[self downloadController] showWindow:self];
         }
     }
 }

Modified: trunk/SKDownloadController.h
===================================================================
--- trunk/SKDownloadController.h        2024-11-16 10:05:48 UTC (rev 14700)
+++ trunk/SKDownloadController.h        2024-11-16 10:11:28 UTC (rev 14701)
@@ -60,8 +60,6 @@
 @property (nonatomic, nullable, strong) IBOutlet SKTableView *tableView;
 @property (nonatomic, nullable, strong) IBOutlet NSButton *clearButton;
 
-- (void)addDownloadForURL:(nullable NSURL *)aURL;
-
 - (IBAction)showDownloadPreferences:(nullable id)sender;
 - (IBAction)clearDownloads:(nullable id)sender;
 

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2024-11-16 10:05:48 UTC (rev 14700)
+++ trunk/SKDownloadController.m        2024-11-16 10:11:28 UTC (rev 14701)
@@ -159,19 +159,6 @@
     [tbClearButton setEnabled:[[self downloads] 
valueForKeyPath:@"@max.canRemove"]];
 }
 
-- (void)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
-    if (aURL) {
-        SKDownload *download = [[SKDownload alloc] initWithURL:aURL];
-        [self addObjectToDownloads:download];
-        if (flag)
-            [self showWindow:nil];
-    }
-}
-
-- (void)addDownloadForURL:(NSURL *)aURL {
-    return [self addDownloadForURL:aURL showWindow:[[NSUserDefaults 
standardUserDefaults] boolForKey:SKAutoOpenDownloadsWindowKey]];
-}
-
 - (BOOL)pasteFromPasteboard:(NSPasteboard *)pboard {
     NSArray *theURLs = [NSURL readURLsFromPasteboard:pboard];
     for (NSURL *theURL in theURLs) {
@@ -178,7 +165,8 @@
         if ([theURL isFileURL]) {
             [[NSDocumentController sharedDocumentController] 
openDocumentWithContentsOfURL:theURL display:YES completionHandler:^(NSDocument 
*document, BOOL documentWasAlreadyOpen, NSError *error){}];
         } else {
-            [self addDownloadForURL:theURL showWindow:NO];
+            SKDownload *download = [[SKDownload alloc] initWithURL:theURL];
+            [self addObjectToDownloads:download];
         }
     }
     return [theURLs count] > 0;

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to