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

Unified Diff: Vermilion/Modules/Core/GoogleWebResultsSource.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 | « QuickSearchBox/QSB/QSB.xcodeproj/project.pbxproj ('k') | Vermilion/Modules/GoogleAccounts/GoogleAccount.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Vermilion/Modules/Core/GoogleWebResultsSource.m
===================================================================
--- Vermilion/Modules/Core/GoogleWebResultsSource.m (revision 1083)
+++ Vermilion/Modules/Core/GoogleWebResultsSource.m (working copy)
@@ -32,7 +32,7 @@
#import "Vermilion/Vermilion.h"
#import <JSON/JSON.h>
-#import <GData/GDataHTTPFetcher.h>
+#import <GData/GTMHTTPFetcher.h>
#import <GTM/GTMMethodCheck.h>
#import <GTM/GTMNSDictionary+URLArguments.h>
#import <GTM/GTMNSString+HTML.h>
@@ -49,13 +49,12 @@
@interface HGSGoogleWebSearchOperation : HGSSimpleArraySearchOperation {
@private
- GDataHTTPFetcher *fetcher_;
+ GTMHTTPFetcher *fetcher_;
}
-- (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 GoogleWebResultsSource : HGSSearchSource
@@ -188,16 +187,24 @@
[request setValue:@"http://google-mobile-internal.google.com" forHTTPHeaderField:@"Referer"];
if (!fetcher_) {
- fetcher_ = [[GDataHTTPFetcher httpFetcherWithRequest:request] retain];
+ fetcher_ = [[GTMHTTPFetcher fetcherWithRequest:request] retain];
[fetcher_ setUserData:self];
[fetcher_ beginFetchWithDelegate:self
- didFinishSelector:@selector(httpFetcher:finishedWithData:)
- didFailSelector:@selector(httpFetcher:didFail:)];
+ didFinishSelector:@selector(httpFetcher:finishedWithData:error:)];
}
}
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher
- finishedWithData:(NSData *)retrievedData {
+- (void)httpFetcher:(GTMHTTPFetcher *)fetcher
+ finishedWithData:(NSData *)retrievedData
+ error:(NSError *)error {
+ if (error) {
+ HGSLog(@"httpFetcher failed: %@ %@", error, [[fetcher mutableRequest] URL]);
+ [self finishQuery];
+ [fetcher_ release];
+ fetcher_ = nil;
+ return;
+ }
+
NSString *jsonResponse = [[[NSString alloc] initWithData:retrievedData
encoding:NSUTF8StringEncoding]
autorelease];
@@ -329,14 +336,6 @@
fetcher_ = nil;
}
-- (void)httpFetcher:(GDataHTTPFetcher *)fetcher
- didFail:(NSError *)error {
- HGSLog(@"httpFetcher failed: %@ %@", error, [[fetcher request] URL]);
- [self finishQuery];
- [fetcher_ release];
- fetcher_ = nil;
-}
-
- (void)cancel {
[fetcher_ stopFetching];
[super cancel];
« no previous file with comments | « QuickSearchBox/QSB/QSB.xcodeproj/project.pbxproj ('k') | Vermilion/Modules/GoogleAccounts/GoogleAccount.m » ('j') | no next file with comments »

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