cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject cordova-plugin-splashscreen git commit: WP8: Avoid config `value` of a wrong element.
Date Fri, 26 Jun 2015 00:29:46 GMT
Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 57ad3602f -> ac23964ac


WP8: Avoid config `value` of a wrong element.

If you have an element that shares the `name`, like <feature
name="SplashScreen">, then the `value` attribute was read of that
instead (since it can appear *before* the preference element). Thus, the
config of `SplashScreen` preference was not settable at all.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/ac23964a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/ac23964a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/ac23964a

Branch: refs/heads/master
Commit: ac23964ac6e5f7a77a62ed9923344857109e71fb
Parents: 57ad360
Author: Roel van Uden <r.h.g.v.uden@outlook.com>
Authored: Mon Jun 22 11:50:07 2015 +0200
Committer: Roel van Uden <r.h.g.v.uden@outlook.com>
Committed: Mon Jun 22 11:50:07 2015 +0200

----------------------------------------------------------------------
 src/wp/SplashScreen.cs | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/ac23964a/src/wp/SplashScreen.cs
----------------------------------------------------------------------
diff --git a/src/wp/SplashScreen.cs b/src/wp/SplashScreen.cs
index 680a805..c56d4ad 100644
--- a/src/wp/SplashScreen.cs
+++ b/src/wp/SplashScreen.cs
@@ -105,6 +105,7 @@ namespace WPCordovaClassLib.Cordova.Commands
                     XDocument configFile = XDocument.Parse(sr.ReadToEnd());
 
                     string configAutoHide = configFile.Descendants()
+                                        .Where(x => x.Name.LocalName == "preference")
                                         .Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen")
                                         .Select(x => (string)x.Attribute("value"))
                                         .FirstOrDefault();
@@ -113,6 +114,7 @@ namespace WPCordovaClassLib.Cordova.Commands
                     prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide;
 
                     string configDelay = configFile.Descendants()
+                                      .Where(x => x.Name.LocalName == "preference")
                                       .Where(x => (string)x.Attribute("name") == "SplashScreenDelay")
                                       .Select(x => (string)x.Attribute("value"))
                                       .FirstOrDefault();
@@ -120,6 +122,7 @@ namespace WPCordovaClassLib.Cordova.Commands
                     prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay;
 
                     string configImage = configFile.Descendants()
+                                        .Where(x => x.Name.LocalName == "preference")
                                         .Where(x => (string)x.Attribute("name") == "SplashScreen")
                                         .Select(x => (string)x.Attribute("value"))
                                         .FirstOrDefault();


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


Mime
View raw message