You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2014/05/05 18:10:23 UTC

[3/9] git commit: CB-5105 Removed dead code for device.version

CB-5105 Removed dead code for device.version

Dead code has been removed from the native side for the following
platforms:

-Android
-WP8
-BB10
-Windows 8
Every variable, method or argument related with retrieve the cordova
version from the native side has been removed. Given the fact that
cordova.js, it's providing the cordova.version.

The plugin has been tested under each platform involved with the
expected results, everything settled to be added to the repository.

github: close #13


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

Branch: refs/heads/cdvtest
Commit: 90f115618a58ad942c5c97ae5534b6563cf38212
Parents: 2162105
Author: martincgg <ma...@gmail.com>
Authored: Mon Mar 3 12:28:01 2014 -0600
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 3 14:11:34 2014 -0500

----------------------------------------------------------------------
 src/android/Device.java     | 11 -----------
 src/blackberry10/index.js   |  3 +--
 src/windows8/DeviceProxy.js |  2 +-
 src/wp/Device.cs            | 14 +-------------
 4 files changed, 3 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/90f11561/src/android/Device.java
----------------------------------------------------------------------
diff --git a/src/android/Device.java b/src/android/Device.java
index 6aef460..ad9002b 100644
--- a/src/android/Device.java
+++ b/src/android/Device.java
@@ -33,7 +33,6 @@ import android.provider.Settings;
 public class Device extends CordovaPlugin {
     public static final String TAG = "Device";
 
-    public static String cordovaVersion = "dev";              // Cordova version
     public static String platform;                            // Device OS
     public static String uuid;                                // Device UUID
 
@@ -73,7 +72,6 @@ public class Device extends CordovaPlugin {
             r.put("uuid", Device.uuid);
             r.put("version", this.getOSVersion());
             r.put("platform", this.getPlatform());
-            r.put("cordova", Device.cordovaVersion);
             r.put("model", this.getModel());
             callbackContext.success(r);
         }
@@ -112,15 +110,6 @@ public class Device extends CordovaPlugin {
         return uuid;
     }
 
-    /**
-     * Get the Cordova version.
-     *
-     * @return
-     */
-    public String getCordovaVersion() {
-        return Device.cordovaVersion;
-    }
-
     public String getModel() {
         String model = android.os.Build.MODEL;
         return model;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/90f11561/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index 639ac64..4d09492 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -60,8 +60,7 @@ module.exports = {
                 platform: "blackberry10",
                 version: window.qnx.webplatform.device.scmBundle,
                 model: modelName,
-                uuid: uuid,
-                cordova: "dev"
+                uuid: uuid
             };
 
         result.ok(info);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/90f11561/src/windows8/DeviceProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/DeviceProxy.js b/src/windows8/DeviceProxy.js
index 16145c0..1567d28 100644
--- a/src/windows8/DeviceProxy.js
+++ b/src/windows8/DeviceProxy.js
@@ -40,7 +40,7 @@ module.exports = {
         }
 
         setTimeout(function () {
-            win({ platform: "windows8", version: "8", uuid: deviceId, cordova: '0.0.0', model: window.clientInformation.platform });
+            win({ platform: "windows8", version: "8", uuid: deviceId, model: window.clientInformation.platform });
         }, 0);
     }
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/90f11561/src/wp/Device.cs
----------------------------------------------------------------------
diff --git a/src/wp/Device.cs b/src/wp/Device.cs
index 0d2576d..b8a8045 100644
--- a/src/wp/Device.cs
+++ b/src/wp/Device.cs
@@ -35,16 +35,13 @@ namespace WPCordovaClassLib.Cordova.Commands
         public void getDeviceInfo(string notused)
         {
 
-            string res = String.Format("\"name\":\"{0}\",\"cordova\":\"{1}\",\"platform\":\"{2}\",\"uuid\":\"{3}\",\"version\":\"{4}\",\"model\":\"{5}\"",
+            string res = String.Format("\"name\":\"{0}\",\"platform\":\"{1}\",\"uuid\":\"{2}\",\"version\":\"{3}\",\"model\":\"{4}\"",
                                         this.name,
-                                        this.cordova,
                                         this.platform,
                                         this.uuid,
                                         this.version,
                                         this.model);
 
-
-
             res = "{" + res + "}";
             //Debug.WriteLine("Result::" + res);
             DispatchCommandResult(new PluginResult(PluginResult.Status.OK, res));
@@ -68,15 +65,6 @@ namespace WPCordovaClassLib.Cordova.Commands
             }
         }
 
-        public string cordova
-        {
-            get
-            {
-                // TODO: should be able to dynamically read the Cordova version from somewhere...
-                return "3.0.0";
-            }
-        }
-
         public string platform
         {
             get