Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D86FD17E85 for ; Mon, 16 Mar 2015 23:09:34 +0000 (UTC) Received: (qmail 56358 invoked by uid 500); 16 Mar 2015 23:09:34 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 56326 invoked by uid 500); 16 Mar 2015 23:09:34 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 56317 invoked by uid 99); 16 Mar 2015 23:09:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2015 23:09:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3408AE1104; Mon, 16 Mar 2015 23:09:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Message-Id: <5e7f798c953045bf8c07efa8bdeba5f9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ios commit: CB-8677 - Remove conditional IsAtLeastIosVersion code (plus style fix-ups) Date: Mon, 16 Mar 2015 23:09:34 +0000 (UTC) Repository: cordova-ios Updated Branches: refs/heads/4.0.x c7fcf3030 -> 3112354f4 CB-8677 - Remove conditional IsAtLeastIosVersion code (plus style fix-ups) Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/3112354f Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/3112354f Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/3112354f Branch: refs/heads/4.0.x Commit: 3112354f45afb57cd275fbb433487b683c5ab96b Parents: c7fcf30 Author: Shazron Abdullah Authored: Mon Mar 16 16:09:32 2015 -0700 Committer: Shazron Abdullah Committed: Mon Mar 16 16:09:32 2015 -0700 ---------------------------------------------------------------------- CordovaLib/Classes/CDVLocalStorage.m | 7 +------ CordovaLib/Classes/CDVUIWebViewDelegate.m | 13 ------------- CordovaLib/Classes/CDVViewController.m | 14 ++++++-------- 3 files changed, 7 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3112354f/CordovaLib/Classes/CDVLocalStorage.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVLocalStorage.m b/CordovaLib/Classes/CDVLocalStorage.m index 8aec403..252dfaf 100644 --- a/CordovaLib/Classes/CDVLocalStorage.m +++ b/CordovaLib/Classes/CDVLocalStorage.m @@ -121,10 +121,9 @@ + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL*)URL skip:(BOOL)skip { - NSAssert(IsAtLeastiOSVersion(@"5.1"), @"Cannot mark files for NSURLIsExcludedFromBackupKey on iOS less than 5.1"); - NSError* error = nil; BOOL success = [URL setResourceValue:[NSNumber numberWithBool:skip] forKey:NSURLIsExcludedFromBackupKey error:&error]; + if (!success) { NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); } @@ -330,10 +329,6 @@ + (void)__restoreLegacyDatabaseLocationsWithBackupType:(NSString*)backupType { // on iOS 6, if you toggle between cloud/local backup, you must move database locations. Default upgrade from iOS5.1 to iOS6 is like a toggle from local to cloud. - if (!IsAtLeastiOSVersion(@"6.0")) { - return; - } - NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3112354f/CordovaLib/Classes/CDVUIWebViewDelegate.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVUIWebViewDelegate.m b/CordovaLib/Classes/CDVUIWebViewDelegate.m index a248245..01872f6 100644 --- a/CordovaLib/Classes/CDVUIWebViewDelegate.m +++ b/CordovaLib/Classes/CDVUIWebViewDelegate.m @@ -278,19 +278,6 @@ static NSString *stripFragment(NSString* url) BOOL fireCallback = NO; switch (_state) { case STATE_IDLE: - if (IsAtLeastiOSVersion(@"6.0")) { - break; - } - // If history.go(-1) is used pre-iOS6, the shouldStartLoadWithRequest function is not called. - // Without shouldLoad, we can't distinguish an iframe from a top-level navigation. - // We could try to distinguish using [UIWebView canGoForward], but that's too much complexity, - // and would work only on the first time it was used. - - // Our work-around is to set a JS variable and poll until it disappears (from a navigation). - _state = STATE_IOS5_POLLING_FOR_LOAD_START; - _loadStartPollCount = 0; - [self setLoadToken:webView]; - [self pollForPageLoadStart:webView]; break; case STATE_CANCELLED: http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3112354f/CordovaLib/Classes/CDVViewController.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m index 26bfa6e..6f271ce 100644 --- a/CordovaLib/Classes/CDVViewController.m +++ b/CordovaLib/Classes/CDVViewController.m @@ -130,8 +130,8 @@ - (void)printPlatformVersionWarning { - if (!IsAtLeastiOSVersion(@"6.0")) { - NSLog(@"CRITICAL: For Cordova 3.5.0 and above, you will need to upgrade to at least iOS 6.0 or greater. Your current version of iOS is %@.", + if (!IsAtLeastiOSVersion(@"7.0")) { + NSLog(@"CRITICAL: For Cordova 4.0.0 and above, you will need to upgrade to at least iOS 7.0 or greater. Your current version of iOS is %@.", [[UIDevice currentDevice] systemVersion] ); } @@ -279,9 +279,7 @@ } [self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"]; - if (IsAtLeastiOSVersion(@"5.1")) { - [CDVLocalStorage __fixupDatabaseLocationsWithBackupType:backupWebStorageType]; - } + [CDVLocalStorage __fixupDatabaseLocationsWithBackupType:backupWebStorageType]; // // Instantiate the WebView /////////////// @@ -296,9 +294,9 @@ /* * Fire up CDVLocalStorage to work-around WebKit storage limitations: on all iOS 5.1+ versions for local-only backups, but only needed on iOS 5.1 for cloud backup. + With minimum iOS 6/7 supported, only first clause applies. */ - if (IsAtLeastiOSVersion(@"5.1") && (([backupWebStorageType isEqualToString:@"local"]) || - ([backupWebStorageType isEqualToString:@"cloud"] && !IsAtLeastiOSVersion(@"6.0")))) { + if ([backupWebStorageType isEqualToString:@"local"]) { [self registerPlugin:[[CDVLocalStorage alloc] initWithWebViewEngine:self.webViewEngine] withClassName:NSStringFromClass([CDVLocalStorage class])]; } @@ -695,7 +693,7 @@ + (NSString*)applicationDocumentsDirectory { NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString* basePath = (([paths count] > 0) ? ([paths objectAtIndex : 0]) : nil); + NSString* basePath = (([paths count] > 0) ? ([paths objectAtIndex:0]) : nil); return basePath; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org