Revision: 24021
          http://sourceforge.net/p/bibdesk/svn/24021
Author:   hofman
Date:     2019-07-14 09:43:43 +0000 (Sun, 14 Jul 2019)
Log Message:
-----------
Remove download subclasses, no need to provide session based downloads, as we 
don't use them anyway

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.xcodeproj/project.pbxproj

Removed Paths:
-------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h      2019-07-14 
09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h      2019-07-14 
09:43:43 UTC (rev 24021)
@@ -49,6 +49,7 @@
     long long                _expectedLength;
     long long                _receivedLength;
     id                       _delegate;
+    NSURLDownload           *_download;
 }
 - (id)initWithDownloadURL:(NSURL *)aURL indexInView:(NSUInteger)indexInView 
replace:(BOOL)replace;
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m      2019-07-14 
09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m      2019-07-14 
09:43:43 UTC (rev 24021)
@@ -37,6 +37,7 @@
  */
 
 #import "FVDownload.h"
+#import <WebKit/WebKit.h>
 
 /*
  FVDownload associates a URL/index combination, and stores the download 
destination (temp directory) for a given download, along with some other data 
(download progress, progress indicator rotation angle for indeterminate 
indicators).
@@ -124,9 +125,81 @@
 
 - (void)setDelegate:(id)obj { _delegate = obj; }
 
-- (void)start {}
+- (void)start
+{
+    NSAssert1(nil == _download, @"Error: already called -start on %@", self);
+    _download = [[WebDownload alloc] initWithRequest:[NSURLRequest 
requestWithURL:[self downloadURL]] delegate:self];
+}
 
-- (void)cancel {}
+- (void)cancel
+{
+    [_download cancel];
+    [_download release];
+    _download = nil;
+}
 
+- (void)download:(NSURLDownload *)download 
decideDestinationWithSuggestedFilename:(NSString *)filename;
+{
+    if ([[self delegate] 
respondsToSelector:@selector(download:setDestinationWithSuggestedFilename:)])
+        [[self delegate] download:self 
setDestinationWithSuggestedFilename:filename];
+    NSURL *fileURL = [self fileURL];
+    if (fileURL == nil)
+        fileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() 
stringByAppendingPathComponent:filename]];
+    NSFileManager *fm = [NSFileManager defaultManager];
+    if ([fm fileExistsAtPath:[fileURL path]]) {
+        NSString *basePath = [[fileURL URLByDeletingPathExtension] path];
+        NSString *path = nil;
+        NSString *extension = [fileURL pathExtension];
+        NSUInteger i;
+        for (i = 1;;++i) {
+            path = [[basePath stringByAppendingFormat:@"-%lu", (unsigned 
long)i] stringByAppendingPathExtension:extension];
+            if ([fm fileExistsAtPath:path] == NO)
+                break;
+        }
+        fileURL = [NSURL fileURLWithPath:path];
+    }
+    [_download setDestination:[fileURL path] allowOverwrite:NO];
+}
+
+- (void)download:(NSURLDownload *)download didCreateDestination:(NSString 
*)path
+{
+    [self setFileURL:[NSURL fileURLWithPath:path]];
+}
+
+- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse 
*)response;
+{
+    long long expectedLength = [response expectedContentLength];
+    [self setExpectedLength:expectedLength];
+    if ([[self delegate] respondsToSelector:@selector(downloadUpdated:)])
+        [[self delegate] downloadUpdated:self];
+}
+
+- (void)download:(NSURLDownload *)download 
didReceiveDataOfLength:(NSUInteger)length;
+{
+    [self incrementReceivedLengthBy:length];
+    if ([[self delegate] respondsToSelector:@selector(downloadUpdated:)])
+        [[self delegate] downloadUpdated:self];
+}
+
+- (void)downloadDidFinish:(NSURLDownload *)download;
+{
+    if ([[self delegate] respondsToSelector:@selector(downloadFinished:)])
+        [[self delegate] downloadFinished:self];
+}
+
+- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
+{
+    if ([[self delegate] respondsToSelector:@selector(downloadFailed:)])
+        [[self delegate] downloadFailed:self];
+}
+
+- (NSWindow *)downloadWindowForAuthenticationSheet:(WebDownload *)download;
+{
+    if ([[self delegate] 
respondsToSelector:@selector(downloadWindowForSheet:)])
+        return [[self delegate] downloadWindowForSheet:self];
+    else
+        return nil;
+}
+
 @end
 

Deleted: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.h    
2019-07-14 09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.h    
2019-07-14 09:43:43 UTC (rev 24021)
@@ -1,48 +0,0 @@
-//
-//  FVDownloadDeprecated.h
-//  FileView
-//
-//  Created by Christiaan Hofman on 15/03/2019.
-/*
- This software is Copyright (c) 2019
- Christiaan Hofman. All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- 
- - Neither the name of Adam Maxwell nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-#import "FVDownload.h"
-
-
-@interface FVDownloadDeprecated : FVDownload <NSURLDownloadDelegate>
-{
-    @private
-    NSURLDownload *_download;
-}
-@end

Deleted: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.m    
2019-07-14 09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadDeprecated.m    
2019-07-14 09:43:43 UTC (rev 24021)
@@ -1,120 +0,0 @@
-//
-//  FVDownloadDeprecated.m
-//  FileView
-//
-//  Created by Christiaan Hofman on 15/03/2019.
-/*
- This software is Copyright (c) 2019
- Christiaan Hofman. All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- 
- - Neither the name of Adam Maxwell nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "FVDownloadDeprecated.h"
-#import <WebKit/WebKit.h>
-
-@implementation FVDownloadDeprecated
-
-- (void)start
-{
-    NSAssert1(nil == _download, @"Error: already called -start on %@", self);
-    _download = [[WebDownload alloc] initWithRequest:[NSURLRequest 
requestWithURL:[self downloadURL]] delegate:self];
-}
-
-- (void)cancel
-{
-    [_download cancel];
-    [_download release];
-    _download = nil;
-}
-
-- (void)download:(NSURLDownload *)download 
decideDestinationWithSuggestedFilename:(NSString *)filename;
-{
-    if ([[self delegate] 
respondsToSelector:@selector(download:setDestinationWithSuggestedFilename:)])
-        [[self delegate] download:self 
setDestinationWithSuggestedFilename:filename];
-    NSURL *fileURL = [self fileURL];
-    if (fileURL == nil)
-        fileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() 
stringByAppendingPathComponent:filename]];
-    NSFileManager *fm = [NSFileManager defaultManager];
-    if ([fm fileExistsAtPath:[fileURL path]]) {
-        NSString *basePath = [[fileURL URLByDeletingPathExtension] path];
-        NSString *path = nil;
-        NSString *extension = [fileURL pathExtension];
-        NSUInteger i;
-        for (i = 1;;++i) {
-            path = [[basePath stringByAppendingFormat:@"-%lu", (unsigned 
long)i] stringByAppendingPathExtension:extension];
-            if ([fm fileExistsAtPath:path] == NO)
-                break;
-        }
-        fileURL = [NSURL fileURLWithPath:path];
-    }
-    [_download setDestination:[fileURL path] allowOverwrite:NO];
-}
-
-- (void)download:(NSURLDownload *)download didCreateDestination:(NSString 
*)path
-{
-    [self setFileURL:[NSURL fileURLWithPath:path]];
-}
-
-- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse 
*)response;
-{
-    long long expectedLength = [response expectedContentLength];
-    [self setExpectedLength:expectedLength];
-    if ([[self delegate] respondsToSelector:@selector(downloadUpdated:)])
-        [[self delegate] downloadUpdated:self];
-}
-
-- (void)download:(NSURLDownload *)download 
didReceiveDataOfLength:(NSUInteger)length;
-{
-    [self incrementReceivedLengthBy:length];
-    if ([[self delegate] respondsToSelector:@selector(downloadUpdated:)])
-        [[self delegate] downloadUpdated:self];
-}
-
-- (void)downloadDidFinish:(NSURLDownload *)download;
-{
-    if ([[self delegate] respondsToSelector:@selector(downloadFinished:)])
-        [[self delegate] downloadFinished:self];
-}
-
-- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
-{
-    if ([[self delegate] respondsToSelector:@selector(downloadFailed:)])
-        [[self delegate] downloadFailed:self];
-}
-
-- (NSWindow *)downloadWindowForAuthenticationSheet:(WebDownload *)download;
-{
-    if ([[self delegate] 
respondsToSelector:@selector(downloadWindowForSheet:)])
-        return [[self delegate] downloadWindowForSheet:self];
-    else
-        return nil;
-}
-
-@end

Deleted: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.h       
2019-07-14 09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.h       
2019-07-14 09:43:43 UTC (rev 24021)
@@ -1,49 +0,0 @@
-//
-//  FVDownloadSession.h
-//  FileView
-//
-//  Created by Christiaan Hofman on 15/03/2019.
-/*
- This software is Copyright (c) 2019
- Christiaan Hofman. All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- 
- - Neither the name of Adam Maxwell nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-#import "FVDownload.h"
-
-@class NSURLSessionDownloadTask;
-
-@interface FVDownloadSession : FVDownload
-{
-    @private
-    NSURLSessionDownloadTask *_downloadTask;
-}
-@end

Deleted: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.m       
2019-07-14 09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownloadSession.m       
2019-07-14 09:43:43 UTC (rev 24021)
@@ -1,187 +0,0 @@
-//
-//  FVDownloadSession.m
-//  FileView
-//
-//  Created by Christiaan Hofman on 15/03/2019.
-/*
- This software is Copyright (c) 2019
- Christiaan Hofman. All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- 
- - Neither the name of Adam Maxwell nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "FVDownloadSession.h"
-
-#if !defined(MAC_OS_X_VERSION_10_9) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_9
-
-@interface NSURLSessionTask : NSObject <NSCopying>
-@property (readonly, copy) NSURLResponse *response;
-- (void)cancel;
-@end
-
-@interface NSURLSessionDataTask : NSURLSessionTask
-@end
-
-@interface NSURLSessionConfiguration : NSObject <NSCopying>
-+ (NSURLSessionConfiguration *)defaultSessionConfiguration;
-@end
-
-@protocol NSURLSessionDelegate <NSObject>
-@end
-
-@interface NSURLSession : NSObject
-+ (NSURLSession *)sharedSession;
-+ (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration 
*)configuration delegate:(id <NSURLSessionDelegate>)delegate 
delegateQueue:(NSOperationQueue *)queue;
-- (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url;
-@end
-
-#endif
-
-@interface FVDownloadSessionDelegate : NSObject <NSURLSessionDelegate>
-{
-    @private
-    NSURLSession *_session;
-    NSMapTable *_downloads;
-}
-
-+ (FVDownloadSessionDelegate *)sharedSessionDelegate;
-
-- (NSURLSessionDownloadTask *)downloadTaskForDownload:(FVDownloadSession 
*)download;
-
-- (void)removeDownloadTask:(NSURLSessionDownloadTask *)downloadTask;
-
-@end
-
-#pragma mark -
-
-@implementation FVDownloadSession
-
-- (void)start
-{
-    _downloadTask = [[[FVDownloadSessionDelegate sharedSessionDelegate] 
downloadTaskForDownload:self] retain];
-    [_downloadTask resume];
-}
-
-- (void)cancel
-{
-    [_downloadTask cancel];
-    [[FVDownloadSessionDelegate sharedSessionDelegate] 
removeDownloadTask:_downloadTask];
-    [_downloadTask release];
-    _downloadTask = nil;
-}
-
-@end
-
-#pragma mark -
-
-@implementation FVDownloadSessionDelegate
-
-+ (FVDownloadSessionDelegate *)sharedSessionDelegate
-{
-    static FVDownloadSessionDelegate *downloadSessionDelegate = nil;
-    if (downloadSessionDelegate == nil) {
-        downloadSessionDelegate = [[self alloc] init];
-    }
-    return downloadSessionDelegate;
-}
-
-- (id)init
-{
-    self = [super init];
-    if (self) {
-        _session = [[NSClassFromString(@"NSURLSession") 
sessionWithConfiguration:[NSClassFromString(@"NSURLSessionConfiguration") 
defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue 
mainQueue]] retain];
-        _downloads = [[NSMapTable alloc] 
initWithKeyOptions:NSPointerFunctionsStrongMemory | 
NSPointerFunctionsObjectPersonality valueOptions:NSPointerFunctionsStrongMemory 
| NSPointerFunctionsObjectPersonality capacity:0];
-    }
-    return self;
-}
-
-- (NSURLSessionDownloadTask *)downloadTaskForDownload:(FVDownloadSession 
*)download
-{
-    NSURLSessionDownloadTask *downloadTask = [_session 
downloadTaskWithURL:[download downloadURL]];
-    [_downloads setObject:download forKey:downloadTask];
-    return downloadTask;
-}
-
-- (void)removeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
-{
-    [_downloads removeObjectForKey:downloadTask];
-}
-
-- (void)URLSession:(NSURLSession *)session 
downloadTask:(NSURLSessionDownloadTask *)downloadTask 
didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten 
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
-{
-    FVDownloadSession *download = [_downloads objectForKey:downloadTask];
-    [download setExpectedLength:totalBytesExpectedToWrite];
-    [download incrementReceivedLengthBy:bytesWritten];
-    if ([[download delegate] respondsToSelector:@selector(downloadUpdated:)])
-        [[download delegate] downloadUpdated:download];
-}
-
-- (void)URLSession:(NSURLSession *)session 
downloadTask:(NSURLSessionDownloadTask *)downloadTask 
didFinishDownloadingToURL:(NSURL *)location
-{
-    FVDownloadSession *download = [_downloads objectForKey:downloadTask];
-    NSString *filename = [[downloadTask response] suggestedFilename];
-    if (filename == nil)
-        filename = [location lastPathComponent];
-    if ([[download delegate] 
respondsToSelector:@selector(download:setDestinationWithSuggestedFilename:)])
-        [[download delegate] download:download 
setDestinationWithSuggestedFilename:filename];
-    NSURL *fileURL = [download fileURL];
-    if (fileURL == nil)
-        fileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() 
stringByAppendingPathComponent:filename]];
-    NSFileManager *fm = [NSFileManager defaultManager];
-    if ([fm fileExistsAtPath:[fileURL path]]) {
-        NSString *basePath = [[fileURL URLByDeletingPathExtension] path];
-        NSString *path = nil;
-        NSString *extension = [fileURL pathExtension];
-        NSUInteger i;
-        for (i = 1;;++i) {
-            path = [[basePath stringByAppendingFormat:@"-%lu", (unsigned 
long)i] stringByAppendingPathExtension:extension];
-            if ([fm fileExistsAtPath:path] == NO)
-                break;
-        }
-        fileURL = [NSURL fileURLWithPath:path];
-    }
-    if ([fm moveItemAtURL:location toURL:fileURL error:NULL]) {
-        [download setFileURL:fileURL];
-    }
-}
-
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask 
*)downloadTask didCompleteWithError:(NSError *)error
-{
-    FVDownloadSession *download = [_downloads objectForKey:downloadTask];
-    if (error == nil) {
-        if ([[download delegate] 
respondsToSelector:@selector(downloadFinished:)])
-            [[download delegate] downloadFinished:download];
-    } else {
-        if ([[download delegate] 
respondsToSelector:@selector(downloadFailed:)])
-            [[download delegate] downloadFailed:download];
-    }
-    [self removeDownloadTask:(NSURLSessionDownloadTask *)downloadTask];
-}
-
-@end

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-07-14 
09:17:07 UTC (rev 24020)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-07-14 
09:43:43 UTC (rev 24021)
@@ -48,8 +48,6 @@
 #import "FVOperationQueue.h"
 #import "FVIconOperation.h"
 #import "FVDownload.h"
-#import "FVDownloadSession.h"
-#import "FVDownloadDeprecated.h"
 #import "FVProgressIndicatorCell.h"
 #import "FVSlider.h"
 #import "FVColorMenuView.h"
@@ -4147,8 +4145,7 @@
         NSURL *theURL = [self URLAtIndex:anIndex];
         if ([[self delegate] 
respondsToSelector:@selector(fileView:shouldDownloadURL:atIndex:replace:)] == 
NO ||
             [[self delegate] fileView:self shouldDownloadURL:theURL 
atIndex:anIndex replace:replace] == YES) {
-            Class downloadClass = NSClassFromString(@"NSURLSession") ? 
[FVDownloadSession class] : [FVDownloadDeprecated class];
-            FVDownload *download = [[downloadClass alloc] 
initWithDownloadURL:theURL indexInView:anIndex replace:replace];
+            FVDownload *download = [[FVDownload alloc] 
initWithDownloadURL:theURL indexInView:anIndex replace:replace];
             [_downloads addObject:download];
             [download setDelegate:self];
             [download start];

Modified: 
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.xcodeproj/project.pbxproj
===================================================================
--- 
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.xcodeproj/project.pbxproj    
    2019-07-14 09:17:07 UTC (rev 24020)
+++ 
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.xcodeproj/project.pbxproj    
    2019-07-14 09:43:43 UTC (rev 24021)
@@ -35,10 +35,6 @@
                CE65FC5D0F72578D0089F9DC /* _FVMappedDataProvider.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CE65FC590F72578D0089F9DC /* 
_FVMappedDataProvider.m */; };
                CE65FC5E0F72578D0089F9DC /* _FVSplitSet.h in Headers */ = {isa 
= PBXBuildFile; fileRef = CE65FC5A0F72578D0089F9DC /* _FVSplitSet.h */; };
                CE65FC5F0F72578D0089F9DC /* _FVSplitSet.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE65FC5B0F72578D0089F9DC /* _FVSplitSet.m */; };
-               CE85DC78223BF6B600B63D0C /* FVDownloadDeprecated.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = CE85DC76223BF6B600B63D0C /* 
FVDownloadDeprecated.h */; };
-               CE85DC79223BF6B600B63D0C /* FVDownloadDeprecated.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CE85DC77223BF6B600B63D0C /* 
FVDownloadDeprecated.m */; };
-               CE85DC7C223BF6CA00B63D0C /* FVDownloadSession.h in Headers */ = 
{isa = PBXBuildFile; fileRef = CE85DC7A223BF6CA00B63D0C /* FVDownloadSession.h 
*/; };
-               CE85DC7D223BF6CA00B63D0C /* FVDownloadSession.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE85DC7B223BF6CA00B63D0C /* FVDownloadSession.m 
*/; };
                CE8923300D7CBB0C006D514C /* FVConcreteOperationQueue.h in 
Headers */ = {isa = PBXBuildFile; fileRef = CE05D5D40D7C223E0034C2A8 /* 
FVConcreteOperationQueue.h */; };
                CE8923310D7CBB0D006D514C /* FVConcreteOperationQueue.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE05D5D50D7C223E0034C2A8 /* 
FVConcreteOperationQueue.m */; };
                CE8923320D7CBB0E006D514C /* FVMainThreadOperationQueue.h in 
Headers */ = {isa = PBXBuildFile; fileRef = CE05D5CE0D7C223E0034C2A8 /* 
FVMainThreadOperationQueue.h */; };
@@ -211,10 +207,6 @@
                CE65FC590F72578D0089F9DC /* _FVMappedDataProvider.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= _FVMappedDataProvider.m; sourceTree = "<group>"; };
                CE65FC5A0F72578D0089F9DC /* _FVSplitSet.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
_FVSplitSet.h; sourceTree = "<group>"; };
                CE65FC5B0F72578D0089F9DC /* _FVSplitSet.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= _FVSplitSet.m; sourceTree = "<group>"; };
-               CE85DC76223BF6B600B63D0C /* FVDownloadDeprecated.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
FVDownloadDeprecated.h; sourceTree = "<group>"; };
-               CE85DC77223BF6B600B63D0C /* FVDownloadDeprecated.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
FVDownloadDeprecated.m; sourceTree = "<group>"; };
-               CE85DC7A223BF6CA00B63D0C /* FVDownloadSession.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
FVDownloadSession.h; sourceTree = "<group>"; };
-               CE85DC7B223BF6CA00B63D0C /* FVDownloadSession.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
FVDownloadSession.m; sourceTree = "<group>"; };
                CEA831120DC1FAB500B551D1 /* FVAccessibilityIconElement.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = FVAccessibilityIconElement.h; sourceTree = "<group>"; };
                CEA831130DC1FAB500B551D1 /* FVAccessibilityIconElement.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = FVAccessibilityIconElement.m; sourceTree = "<group>"; 
};
                CEC9932C1072B6C50089F20D /* FVPreviewer.xib */ = {isa = 
PBXFileReference; lastKnownFileType = file.xib; path = FVPreviewer.xib; 
sourceTree = "<group>"; };
@@ -578,10 +570,6 @@
                        children = (
                                CE05D3C40D7B272A0034C2A8 /* FVDownload.h */,
                                CE05D3C50D7B272A0034C2A8 /* FVDownload.m */,
-                               CE85DC76223BF6B600B63D0C /* 
FVDownloadDeprecated.h */,
-                               CE85DC77223BF6B600B63D0C /* 
FVDownloadDeprecated.m */,
-                               CE85DC7A223BF6CA00B63D0C /* FVDownloadSession.h 
*/,
-                               CE85DC7B223BF6CA00B63D0C /* FVDownloadSession.m 
*/,
                                CE05D3CE0D7B27FC0034C2A8 /* 
FVProgressIndicatorCell.h */,
                                CE05D3CF0D7B27FC0034C2A8 /* 
FVProgressIndicatorCell.m */,
                        );
@@ -632,7 +620,6 @@
                                F9A2D3E80CCBE12B002F517B /* FVImageIcon.h in 
Headers */,
                                F9A2D3EC0CCBE13F002F517B /* FVFinderIcon.h in 
Headers */,
                                F9A2D3F00CCBE14E002F517B /* FVPDFIcon.h in 
Headers */,
-                               CE85DC7C223BF6CA00B63D0C /* FVDownloadSession.h 
in Headers */,
                                F9A2D3F40CCBE15C002F517B /* FVTextIcon.h in 
Headers */,
                                F9A2D3FF0CCBE321002F517B /* FVIcon_Private.h in 
Headers */,
                                F9A2D4280CCBE6BA002F517B /* FVQuickLookIcon.h 
in Headers */,
@@ -663,7 +650,6 @@
                                CEFC1D090F6AB8AD00B2AEE6 /* FVBitmapContext.h 
in Headers */,
                                CEFC1D0B0F6AB8AD00B2AEE6 /* 
FVCGImageUtilities.h in Headers */,
                                CEFC1D0D0F6AB8AD00B2AEE6 /* FVImageBuffer.h in 
Headers */,
-                               CE85DC78223BF6B600B63D0C /* 
FVDownloadDeprecated.h in Headers */,
                                CEFC1D170F6AB94F00B2AEE6 /* FVObject.h in 
Headers */,
                                CEFC1D190F6AB94F00B2AEE6 /* FVAllocator.h in 
Headers */,
                                CEFC1D1B0F6AB94F00B2AEE6 /* fv_zone.h in 
Headers */,
@@ -826,7 +812,6 @@
                                CEFC1CFD0F6AB84000B2AEE6 /* FVCacheFile.mm in 
Sources */,
                                CEFC1CFF0F6AB84000B2AEE6 /* 
FVCGColorSpaceDescription.m in Sources */,
                                CEFC1D010F6AB84000B2AEE6 /* 
FVCGImageDescription.m in Sources */,
-                               CE85DC7D223BF6CA00B63D0C /* FVDownloadSession.m 
in Sources */,
                                CEFC1D020F6AB84000B2AEE6 /* FVCGImageCache.m in 
Sources */,
                                CEFC1D0A0F6AB8AD00B2AEE6 /* FVBitmapContext.m 
in Sources */,
                                CEFC1D0C0F6AB8AD00B2AEE6 /* 
FVCGImageUtilities.mm in Sources */,
@@ -838,7 +823,6 @@
                                CEFC1D290F6ABA2300B2AEE6 /* FVAliasBadge.m in 
Sources */,
                                CEFC1D2C0F6ABA2300B2AEE6 /* FVBaseIcon.m in 
Sources */,
                                CEFC1D300F6ABA3C00B2AEE6 /* FVCoreTextIcon.m in 
Sources */,
-                               CE85DC79223BF6B600B63D0C /* 
FVDownloadDeprecated.m in Sources */,
                                CEFC1F6E0F6AD4B300B2AEE6 /* FVQuickLookIcon.m 
in Sources */,
                                CE65FC5D0F72578D0089F9DC /* 
_FVMappedDataProvider.m in Sources */,
                                CE65FC5F0F72578D0089F9DC /* _FVSplitSet.m in 
Sources */,

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to