cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [1/5] ios commit: Seperate config.xml parsing logic
Date Fri, 24 Oct 2014 20:17:42 GMT
Repository: cordova-ios
Updated Branches:
  refs/heads/unplug-whitelist [created] 2e12c3e8a


Seperate config.xml parsing logic

Separates the logic of finding config.xml and feeding its contents to a parser from the task
of choosing that parser and using its results


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/0c013f69
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/0c013f69
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/0c013f69

Branch: refs/heads/unplug-whitelist
Commit: 0c013f6915580b69d35332c16fbd7079675a1e93
Parents: 01b3d19
Author: Ian Clelland <iclelland@chromium.org>
Authored: Thu Oct 23 16:02:59 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Thu Oct 23 16:02:59 2014 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.h |  2 ++
 CordovaLib/Classes/CDVViewController.m | 12 ++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0c013f69/CordovaLib/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.h b/CordovaLib/Classes/CDVViewController.h
index 51863a5..73315a6 100644
--- a/CordovaLib/Classes/CDVViewController.h
+++ b/CordovaLib/Classes/CDVViewController.h
@@ -81,4 +81,6 @@
 - (BOOL)URLisAllowed:(NSURL*)url;
 - (void)processOpenUrl:(NSURL*)url;
 
+- (void)parseSettingsWithParser:(NSObject<NSXMLParserDelegate> *)delegate;
+
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0c013f69/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index acb88f7..f7e43f3 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -160,10 +160,8 @@
     return [self.whitelist URLIsAllowed:url];
 }
 
-- (void)loadSettings
+- (void)parseSettingsWithParser:(NSObject<NSXMLParserDelegate> *)delegate
 {
-    CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
-
     // read from config.xml in the app bundle
     NSString* path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"xml"];
 
@@ -179,8 +177,14 @@
         NSLog(@"Failed to initialize XML parser.");
         return;
     }
-    [configParser setDelegate:((id < NSXMLParserDelegate >)delegate)];
+    [configParser setDelegate:delegate];
     [configParser parse];
+}
+
+- (void)loadSettings
+{
+    CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
+    [self parseSettingsWithParser:delegate];
 
     // Get the plugin dictionary, whitelist and settings from the delegate.
     self.pluginsMap = delegate.pluginsDict;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message