You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2015/03/19 17:56:04 UTC

[15/50] [abbrv] ios commit: CB-8677 - Remove conditional IsAtLeastIosVersion code (plus style fix-ups)

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/unplug-whitelist
Commit: 3112354f45afb57cd275fbb433487b683c5ab96b
Parents: c7fcf30
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Mar 16 16:09:32 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
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