Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(268)

Unified Diff: Vermilion/Vermilion/HGSSuggestSource.m

Issue 4675073: Fix up build Base URL: http://qsb-mac.googlecode.com/svn/trunk/
Patch Set: Created 14 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Vermilion/Vermilion/HGSOperation.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Vermilion/Vermilion/HGSSuggestSource.m
===================================================================
--- Vermilion/Vermilion/HGSSuggestSource.m (revision 1083)
+++ Vermilion/Vermilion/HGSSuggestSource.m (working copy)
@@ -41,7 +41,7 @@
#import "HGSDelegate.h"
#import "HGSType.h"
-#import <GData/GDataHTTPFetcher.h>
+#import <GData/GTMHTTPFetcher.h>
#import "GTMDefines.h"
#import "GTMGarbageCollection.h"
#import "GTMMethodCheck.h"
@@ -106,10 +106,9 @@
- (NSString *)clientID;
- (void)processQueue:(id)sender;
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher
- finishedWithData:(NSData *)retrievedData;
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher didFail:(NSError *)error;
-
+- (void)httpFetcher:(GTMHTTPFetcher *)fetcher
+ finishedWithData:(NSData *)retrievedData
+ error:(NSError *)error;
@end
@interface HGSSuggestSource (Filtering)
@@ -409,19 +408,27 @@
[request setHTTPShouldHandleCookies:NO];
// Start the http fetch.
- GDataHTTPFetcher *fetcher = [GDataHTTPFetcher httpFetcherWithRequest:request];
+ GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[fetcher setUserData:operation];
[fetcher beginFetchWithDelegate:self
- didFinishSelector:@selector(httpFetcher:finishedWithData:)
- didFailSelector:@selector(httpFetcher:didFail:)];
+ didFinishSelector:@selector(httpFetcher:finishedWithData:error:)];
#if TARGET_OS_IPHONE
[[GMONetworkIndicator sharedNetworkIndicator] pushEvent];
#endif // TARGET_OS_IPHONE
}
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher
- finishedWithData:(NSData *)retrievedData {
+- (void)httpFetcher:(GTMHTTPFetcher *)fetcher
+ finishedWithData:(NSData *)retrievedData
+ error:(NSError *)error {
+ if (error) {
+ HGSLog(@"httpFetcher failed: %@ %@", [error description], [[fetcher mutableRequest] URL]);
+ [self signalOperationCompletion];
+
+ HGSSearchOperation *fetchedOperation = (HGSSearchOperation *)[fetcher userData];
+ [self suggestionsRequestFailed:fetchedOperation];
+ return;
+ }
HGSSearchOperation *fetchedOperation = (HGSSearchOperation *)[[[fetcher userData] retain] autorelease];
[fetcher setUserData:nil]; // Make sure this operation isn't retained.
@@ -438,15 +445,6 @@
[self signalOperationCompletion];
}
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher
- didFail:(NSError *)error {
- HGSLog(@"httpFetcher failed: %@ %@", [error description], [[fetcher request] URL]);
- [self signalOperationCompletion];
-
- HGSSearchOperation *fetchedOperation = (HGSSearchOperation *)[fetcher userData];
- [self suggestionsRequestFailed:fetchedOperation];
-}
-
#pragma mark -
- (void)suggestionsRequestCompleted:(NSArray *)suggestions
« no previous file with comments | « Vermilion/Vermilion/HGSOperation.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b