[Content] Remove the codes checking if latitude and longitude are zero and Add the...
authortaekeun.kang <taekeun.kang@samsung.com>
Thu, 9 Jul 2015 04:43:17 +0000 (13:43 +0900)
committerJuwon(Julia) Ahn <juwon.ahn@samsung.com>
Fri, 17 Jul 2015 04:37:50 +0000 (13:37 +0900)
Change-Id: If31ed04db65d5b30714514afa23adb5d6ebf6660
Signed-off-by: taekeun.kang <taekeun.kang@samsung.com>
src/content/content_manager.cc
src/content/js/datatypes.js

index 594fe5d7ce0be51f89ee99aadd1fe1bed4b39260..072d0488cbbe35ef192936f8fda7814286b8f6e4 100755 (executable)
@@ -408,15 +408,20 @@ static int setContent(media_info_h media, const picojson::value& content) {
 
   if (type == MEDIA_CONTENT_TYPE_IMAGE || type == MEDIA_CONTENT_TYPE_VIDEO) {
     picojson::value geo = content.get("geolocation");
-    double latitude = atof(geo.get("latitude").to_str().c_str());
-    double longitude = atof(geo.get("longitude").to_str().c_str());
-    ret = media_info_set_latitude(media, latitude);
-    if (ret != MEDIA_CONTENT_ERROR_NONE) {
-      LoggerE("Updating geolocation is failed.");
-    }
-    ret = media_info_set_longitude(media, longitude);
-    if (ret != MEDIA_CONTENT_ERROR_NONE) {
-      LoggerD("Updating geolocation is failed.");
+    if (geo.evaluate_as_boolean()) {
+      LoggerD("geolocation is not null");
+      double latitude = atof(geo.get("latitude").to_str().c_str());
+      double longitude = atof(geo.get("longitude").to_str().c_str());
+      ret = media_info_set_latitude(media, latitude);
+      if (ret != MEDIA_CONTENT_ERROR_NONE) {
+        LoggerE("Updating geolocation is failed.");
+      }
+      ret = media_info_set_longitude(media, longitude);
+      if (ret != MEDIA_CONTENT_ERROR_NONE) {
+        LoggerD("Updating geolocation is failed.");
+      }
+    } else {
+      LoggerD("geolocation is null");
     }
   }
 
index e04df4d23f6215ce3bafd7079d0e2a29c97ec066..a4e526555315cb968e4eab6ee98b784fa4e59dec 100755 (executable)
@@ -322,7 +322,7 @@ function VideoContent(data) {
         return geolocation;
       },
       set: function(v) {
-        if (!type_.isNull(v) && v.latitude && v.longitude) {
+        if (!type_.isNull(v)) {
           var latitude = converter_.toDouble(v.latitude, false);
           var longitude = converter_.toDouble(v.longitude, false);
           geolocation = new tizen.SimpleCoordinates(latitude, longitude);
@@ -629,7 +629,7 @@ function ImageContent(data) {
         return geolocation;
       },
       set: function(v) {
-        if (!type_.isNull(v) && v.latitude && v.longitude) {
+        if (!type_.isNull(v)) {
           var latitude = converter_.toDouble(v.latitude, false);
           var longitude = converter_.toDouble(v.longitude, false);
           geolocation = new tizen.SimpleCoordinates(latitude, longitude);