Revision: 14698
          http://sourceforge.net/p/skim-app/code/14698
Author:   hofman
Date:     2024-11-15 22:55:32 +0000 (Fri, 15 Nov 2024)
Log Message:
-----------
return only bool instead of download

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

Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m        2024-11-15 22:30:56 UTC (rev 14697)
+++ trunk/SKDocumentController.m        2024-11-15 22:55:32 UTC (rev 14698)
@@ -346,9 +346,9 @@
             }
         }
     } else if (showNotes == NO && theURL) {
-        id download = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL];
+        BOOL success = [[SKDownloadController sharedDownloadController] 
addDownloadForURL:theURL];
         if (completionHandler)
-            completionHandler(nil, NO, download ? nil : [NSError 
readFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to load file", 
@"Error description")]);
+            completionHandler(nil, NO, success ? nil : [NSError 
readFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to load file", 
@"Error description")]);
     } else if (completionHandler) {
         completionHandler(nil, NO, [NSError 
readPasteboardErrorWithLocalizedDescription:NSLocalizedString(@"Unable to load 
data from clipboard", @"Error description")]);
     }

Modified: trunk/SKDownloadController.h
===================================================================
--- trunk/SKDownloadController.h        2024-11-15 22:30:56 UTC (rev 14697)
+++ trunk/SKDownloadController.h        2024-11-15 22:55:32 UTC (rev 14698)
@@ -62,7 +62,7 @@
 
 @property (class, nonatomic, readonly) SKDownloadController 
*sharedDownloadController;
 
-- (nullable SKDownload *)addDownloadForURL:(nullable NSURL *)aURL;
+- (BOOL)addDownloadForURL:(nullable NSURL *)aURL;
 
 - (IBAction)showDownloadPreferences:(nullable id)sender;
 - (IBAction)clearDownloads:(nullable id)sender;

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2024-11-15 22:30:56 UTC (rev 14697)
+++ trunk/SKDownloadController.m        2024-11-15 22:55:32 UTC (rev 14698)
@@ -167,10 +167,9 @@
     [tbClearButton setEnabled:[[self downloads] 
valueForKeyPath:@"@max.canRemove"]];
 }
 
-- (SKDownload *)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
-    SKDownload *download = nil;
+- (BOOL)addDownloadForURL:(NSURL *)aURL showWindow:(BOOL)flag {
     if (aURL) {
-        download = [[SKDownload alloc] initWithURL:aURL];
+        SKDownload *download = [[SKDownload alloc] initWithURL:aURL];
         NSInteger row = [self countOfDownloads];
         [self addObjectToDownloads:download];
         if (flag)
@@ -177,11 +176,12 @@
             [self showWindow:nil];
         [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] 
byExtendingSelection:NO];
         [tableView scrollRowToVisible:row];
+        return YES;
     }
-    return download;
+    return NO;
 }
 
-- (SKDownload *)addDownloadForURL:(NSURL *)aURL {
+- (BOOL)addDownloadForURL:(NSURL *)aURL {
     return [self addDownloadForURL:aURL showWindow:[[NSUserDefaults 
standardUserDefaults] boolForKey:SKAutoOpenDownloadsWindowKey]];
 }
 

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