Permalink
Browse files

removed deprecated sources 'Safari' and 'YouTube'

  • Loading branch information...
1 parent 66589ac commit d1c8bde690b4d96064d64e2596d0f91adb462ffc @nst committed Nov 1, 2010
@@ -13,8 +13,6 @@
@class SPSourceWifiTVC;
@class SPSourcePhoneTVC;
@class SPSourceLocationTVC;
-@class SPSourceSafariTVC;
-@class SPSourceYouTubeTVC;
@class SPSourcePhotosTVC;
@class SPSourceAddressBookTVC;
@class SPSourceKeyboardTVC;
@@ -26,8 +24,6 @@
IBOutlet SPSourceWifiTVC *sourceWifiTVC;
IBOutlet SPSourcePhoneTVC *sourcePhoneTVC;
IBOutlet SPSourceLocationTVC *sourceLocationTVC;
- IBOutlet SPSourceSafariTVC *sourceSafariTVC;
- IBOutlet SPSourceYouTubeTVC *sourceYouTubeTVC;
IBOutlet SPSourcePhotosTVC *sourcePhotosTVC;
IBOutlet SPSourceAddressBookTVC *sourceAddressBookTVC;
IBOutlet SPSourceKeyboardTVC *sourceKeyboardTVC;
@@ -25,8 +25,6 @@ - (void)loadSources {
sourceWifiTVC,
sourcePhoneTVC,
sourceLocationTVC,
- sourceSafariTVC,
- sourceYouTubeTVC,
sourcePhotosTVC,
sourceAddressBookTVC,
sourceKeyboardTVC,
@@ -67,19 +65,6 @@ - (NSString *)report {
return s;
}
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
-
- // Release any cached data, images, etc that aren't in use.
-}
-
-- (void)viewDidUnload {
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
-}
-
-
- (void)dealloc {
[sources release];
[super dealloc];
@@ -115,5 +100,4 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[self.navigationController pushViewController:sourceVC animated:YES];
}
-
@end
@@ -89,7 +89,8 @@ - (void)loadData {
path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.plist";
d = [NSDictionary dictionaryWithContentsOfFile:path];
- self.lastDialed = [NSString stringWithFormat:@"%@", [d valueForKey:@"DialerSavedNumber"]];
+ NSString *s = [NSString stringWithFormat:@"%@", [d valueForKey:@"DialerSavedNumber"]];
+ self.lastDialed = [s length] == 0 ? nil : s;
self.contentsDictionaries = [NSMutableArray array];
@@ -1,22 +0,0 @@
-//
-// SPSourceSafariTVC.h
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-#import <UIKit/UIKit.h>
-#import "SPSourceTVC.h"
-
-@class SPWebViewVC;
-
-@interface SPSourceSafariTVC : SPSourceTVC {
- IBOutlet SPWebViewVC *webViewVC;
-
-}
-
-@property (nonatomic, retain) SPWebViewVC *webViewVC;
-
-@end
@@ -1,56 +0,0 @@
-//
-// SPSourceSafariTVC.m
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-// <meta name="title" content="CATcerto. ENTIRE PERFORMANCE. Mindaugas Piecaitis, Nora The Piano Cat">
-
-#import "SPSourceSafariTVC.h"
-#import "SPCell.h"
-#import "SPWebViewVC.h"
-
-@implementation SPSourceSafariTVC
-
-@synthesize webViewVC;
-
-- (void)loadData {
- if(contentsDictionaries) return;
-
- self.contentsDictionaries = [NSMutableArray array];
-
- NSString *path = @"/var/mobile/Library/Preferences/com.apple.mobilesafari.plist";
- NSDictionary *d = [NSDictionary dictionaryWithContentsOfFile:path];
- NSArray *searches = [d valueForKey:@"RecentSearches"];
- if(!searches) searches = [NSArray array];
-
- [contentsDictionaries addObject:[NSDictionary dictionaryWithObject:searches forKey:@"Recent Searches"]];
-}
-
--(void)dealloc {
- [webViewVC release];
- [super dealloc];
-}
-
-#pragma mark UITableViewDelegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- NSArray *searches = [[[contentsDictionaries objectAtIndex:indexPath.section] allValues] lastObject];
- NSString *q = [[searches objectAtIndex:indexPath.row] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSString *s = [NSString stringWithFormat:@"http://www.google.com/search?q=%@", q];
- NSURL *url = [NSURL URLWithString:s];
- NSURLRequest *r = [NSURLRequest requestWithURL:url];
- webViewVC.request = r;
- [self.navigationController pushViewController:webViewVC animated:YES];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- return cell;
-}
-
-@end
@@ -1,23 +0,0 @@
-//
-// SPSourceYouTubeTVC.h
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-#import <UIKit/UIKit.h>
-#import "SPSourceTVC.h"
-
-@interface SPSourceYouTubeTVC : SPSourceTVC {
- NSString *lastSearch;
- NSArray *bookmarks;
- NSArray *history;
-}
-
-@property (nonatomic, retain) NSArray *bookmarks;
-@property (nonatomic, retain) NSArray *history;
-@property (nonatomic, retain) NSString *lastSearch;
-
-@end
@@ -1,69 +0,0 @@
-//
-// SPSourceYouTubeTVC.m
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-#import "SPSourceYouTubeTVC.h"
-#import "SPCell.h"
-
-@implementation SPSourceYouTubeTVC
-
-@synthesize lastSearch;
-@synthesize bookmarks;
-@synthesize history;
-
-- (void)loadData {
- if(contentsDictionaries) return;
-
- NSString *path = @"/var/mobile/Library/Preferences/com.apple.youtube.plist";
- NSDictionary *d = [NSDictionary dictionaryWithContentsOfFile:path];
-
- self.bookmarks = [d valueForKey:@"Bookmarks"];
- self.history = [d valueForKey:@"History"];
- self.lastSearch = [d valueForKey:@"lastSearch"];
-
- if(!lastSearch) self.lastSearch = @"";
- if(!bookmarks) self.bookmarks = [NSArray array];
- if(!history) self.history = [NSArray array];
-
- self.contentsDictionaries = [NSArray arrayWithObjects:
- [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:lastSearch] forKey:@"Last Search"],
- [NSDictionary dictionaryWithObject:bookmarks forKey:@"Bookmarks"],
- [NSDictionary dictionaryWithObject:history forKey:@"History"], nil];
-}
-
--(void)dealloc {
- [bookmarks release];
- [history release];
- [lastSearch release];
- [super dealloc];
-}
-
-#pragma mark UITableViewDelegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- NSString *s = nil;
- if(indexPath.section == 0) {
- s = [[NSString stringWithFormat:@"http://youtube.com/results?search_query=%@", lastSearch] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- } else if (indexPath.section == 1) {
- NSString *x = [bookmarks objectAtIndex:indexPath.row];
- s = [NSString stringWithFormat:@"http://youtube.com/watch?v=%@", x];
- } else if (indexPath.section == 2) {
- NSString *x = [history objectAtIndex:indexPath.row];
- s = [NSString stringWithFormat:@"http://youtube.com/watch?v=%@", x];
- }
- NSURL *url = [NSURL URLWithString:s];
- [[UIApplication sharedApplication] openURL:url];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- return cell;
-}
-
-@end
Oops, something went wrong.

0 comments on commit d1c8bde

Please sign in to comment.