Revision: 27641
http://sourceforge.net/p/bibdesk/svn/27641
Author: hofman
Date: 2022-06-17 22:34:09 +0000 (Fri, 17 Jun 2022)
Log Message:
-----------
get data and response from download object
Modified Paths:
--------------
trunk/bibdesk/BDSKAsynchronousWebParser.h
trunk/bibdesk/BDSKAsynchronousWebParser.m
Modified: trunk/bibdesk/BDSKAsynchronousWebParser.h
===================================================================
--- trunk/bibdesk/BDSKAsynchronousWebParser.h 2022-06-17 16:55:33 UTC (rev
27640)
+++ trunk/bibdesk/BDSKAsynchronousWebParser.h 2022-06-17 22:34:09 UTC (rev
27641)
@@ -83,9 +83,7 @@
@interface BDSKCitationDownload : NSObject {
BDSKDownload *download;
id<BDSKCitationDownloadDelegate> delegate;
- NSData *data;
NSURLRequest *request;
- NSURLResponse *response;
NSError *error;
BOOL failed;
id contextInfo;
Modified: trunk/bibdesk/BDSKAsynchronousWebParser.m
===================================================================
--- trunk/bibdesk/BDSKAsynchronousWebParser.m 2022-06-17 16:55:33 UTC (rev
27640)
+++ trunk/bibdesk/BDSKAsynchronousWebParser.m 2022-06-17 22:34:09 UTC (rev
27641)
@@ -177,8 +177,8 @@
@implementation BDSKCitationDownload
-@synthesize data, error, failed, contextInfo;
-@dynamic URL, string;
+@synthesize error, failed, contextInfo;
+@dynamic URL, data, string;
- (void)dealloc {
delegate = nil;
@@ -185,9 +185,7 @@
[download cancel];
BDSKDESTROY(download);
BDSKDESTROY(request);
- BDSKDESTROY(response);
BDSKDESTROY(error);
- BDSKDESTROY(data);
BDSKDESTROY(contextInfo);
[super dealloc];
}
@@ -205,12 +203,17 @@
return [request URL];
}
+- (NSData *)data {
+ return [download data];
+}
+
- (NSString *)string {
if ([self failed])
return nil;
NSString *string = nil;
- NSString *encodingName = [response textEncodingName];
+ NSData *data = [self data];
+ NSString *encodingName = [[download response] textEncodingName];
NSStringEncoding encoding = kCFStringEncodingInvalidId;
if (nil != encodingName)
@@ -233,9 +236,6 @@
if (downloadError) {
error = [downloadError retain];
failed = YES;
- } else {
- data = [[download data] retain];
- response = [[download response] retain];
}
[delegate downloadDidFinish:self];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit