cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [04/50] ios commit: Seperate config.xml parsing logic
Date Thu, 25 Jun 2015 01:08:52 GMT
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/9ad1c7c9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/9ad1c7c9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/9ad1c7c9

Branch: refs/heads/master
Commit: 9ad1c7c94179cdeb0d0cf9f0b44bff2b4f07570b
Parents: 2e5510e
Author: Ian Clelland <iclelland@chromium.org>
Authored: Thu Oct 23 16:02:59 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Thu Mar 19 10:56:26 2015 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/Public/CDVViewController.h |  2 ++
 CordovaLib/Classes/Public/CDVViewController.m | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/9ad1c7c9/CordovaLib/Classes/Public/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVViewController.h b/CordovaLib/Classes/Public/CDVViewController.h
index e3ead2f..534c649 100644
--- a/CordovaLib/Classes/Public/CDVViewController.h
+++ b/CordovaLib/Classes/Public/CDVViewController.h
@@ -84,4 +84,6 @@
 
 - (BOOL)URLisAllowed:(NSURL*)url;
 
+- (void)parseSettingsWithParser:(NSObject<NSXMLParserDelegate> *)delegate;
+
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/9ad1c7c9/CordovaLib/Classes/Public/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVViewController.m b/CordovaLib/Classes/Public/CDVViewController.m
index bf7e532..a6b7fae 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -163,10 +163,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"];
 
@@ -184,6 +182,12 @@
     }
     [self.configParser setDelegate:((id < NSXMLParserDelegate >)delegate)];
     [self.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