Revision: 14915
http://sourceforge.net/p/skim-app/code/14915
Author: hofman
Date: 2025-02-04 17:04:47 +0000 (Tue, 04 Feb 2025)
Log Message:
-----------
task is never nil, so don't handle nil case
Modified Paths:
--------------
trunk/SKFileShare.m
Modified: trunk/SKFileShare.m
===================================================================
--- trunk/SKFileShare.m 2025-02-04 16:39:44 UTC (rev 14914)
+++ trunk/SKFileShare.m 2025-02-04 17:04:47 UTC (rev 14915)
@@ -53,6 +53,7 @@
if (url) {
NSArray *items = @[url];
if ([[self sharingService] canPerformWithItems:items]) {
+ [[self sharingService] setDelegate:self];
[[self sharingService] performWithItems:items];
return;
}
@@ -72,19 +73,9 @@
- (void)launchTask:(NSTask *)task {
strongSelf = self;
- if (task) {
- [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(taskFinished:) name:NSTaskDidTerminateNotification
object:task];
- @try {
- [task launch];
- }
- @catch (id exception) {
- [self taskFinished:nil];
- }
- } else if ([[self fileURL] checkResourceIsReachableAndReturnError:NULL]) {
- [self shareFileURL];
- } else {
- [self finishWithSuccess:NO];
- }
+ [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(taskFinished:) name:NSTaskDidTerminateNotification
object:task];
+ @try { [task launch]; }
+ @catch (id e) { [self taskFinished:nil]; }
}
@@ -101,7 +92,6 @@
[sharer setFileURL:aFileURL];
[sharer setSharingService:aSharingService];
[sharer setCompletionHandler:aCompletionHandler];
- [aSharingService setDelegate:sharer];
[sharer launchTask:task];
}
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