From: chanywa Date: Wed, 31 Aug 2016 14:18:54 +0000 (+0900) Subject: fixed bugs that media-data of place-image or place-review can be omitted X-Git-Tag: submit/tizen/20160907.014728~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F86363%2F3;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git fixed bugs that media-data of place-image or place-review can be omitted Change-Id: I6fe8d890f6d606e57cd9987befc047c84ff6ae4e --- diff --git a/inc/engine/common/HereMaps_global.h b/inc/engine/common/HereMaps_global.h index 3b5b698..cfe8530 100644 --- a/inc/engine/common/HereMaps_global.h +++ b/inc/engine/common/HereMaps_global.h @@ -134,4 +134,7 @@ extern void Stopwatch_Show(int aIndex); extern void Stopwatch_Reset(int aIndex); HERE_MAPS_END_NAMESPACE +#undef VERSION +#define VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) + #endif // HEREMAPS_GLOBAL_H diff --git a/inc/engine/finder/BaseContent.h b/inc/engine/finder/BaseContent.h index 2abe795..d40241a 100644 --- a/inc/engine/finder/BaseContent.h +++ b/inc/engine/finder/BaseContent.h @@ -30,7 +30,7 @@ class LinkObject; * * \ingroup finder */ -class BaseContent +class EXPORT_API BaseContent { public: diff --git a/inc/engine/routes/GeoRouteQuery.h b/inc/engine/routes/GeoRouteQuery.h index eb3480d..6507c1e 100644 --- a/inc/engine/routes/GeoRouteQuery.h +++ b/inc/engine/routes/GeoRouteQuery.h @@ -19,6 +19,7 @@ #define GEOROUTEQUERY_H #include +#include #include "common/HereMaps_global.h" #include "common/BaseQuery.h" @@ -371,6 +372,34 @@ public: * @return An integer indicating the realtime traffic status. */ size_t GetRealtimeTraffic(void) const; + + /** + * This method sets a value that indicates the departure time. + * + * @param time An value indicating the departure time. + */ + void SetDepartureTime(time_t time); + + /** + * This method retrieves a value that indicates the departure time. + * + * @return An value indicating the departure time. + */ + time_t GetDepartureTime(void) const; + + /** + * This method sets a value that indicates the arrival time. + * + * @param time An intevalueger indicating the arrival time. + */ + void SetArrivalTime(time_t time); + + /** + * This method retrieves a value that indicates the arrival time. + * + * @return An value indicating the arrival time. + */ + time_t GetArrivalTime(void) const; #endif /** diff --git a/inc/here_place.h b/inc/here_place.h index 76bff8a..419e5a7 100644 --- a/inc/here_place.h +++ b/inc/here_place.h @@ -32,6 +32,7 @@ #include #include #include +#include //map engine header #include @@ -100,8 +101,11 @@ private: void ProcessPlaceDetails(PlaceDetails herePlace, maps_place_h mapsPlace); void ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPlace); void ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPlace); - void ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace); + void ProcessPlaceRelated(PlaceDetails herePlace, maps_place_h mapsPlace); void ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h mapsPlace); + void ProcessPlaceSupplier(PlaceDetails herePlace, maps_place_h mapsPlace); + bool ProcessPlaceMedia(BaseContent hereContent, maps_place_media_h mapsMedia); + bool ProcessPlaceLinkObject(LinkObject hereLinkObject, maps_place_link_object_h mapsLinkObject); void __sortList(PlaceList &list); void __flushReplies(int error); diff --git a/lib/aarch64/libheremaps-engine.so.1 b/lib/aarch64/libheremaps-engine.so.1 index b3ec213..8d230ba 120000 --- a/lib/aarch64/libheremaps-engine.so.1 +++ b/lib/aarch64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_17 \ No newline at end of file +libheremaps-engine.so.1.0.6_18 \ No newline at end of file diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_17 b/lib/aarch64/libheremaps-engine.so.1.0.6_17 deleted file mode 100755 index 5d43807..0000000 Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_17 and /dev/null differ diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_18 b/lib/aarch64/libheremaps-engine.so.1.0.6_18 new file mode 100755 index 0000000..3d4c363 Binary files /dev/null and b/lib/aarch64/libheremaps-engine.so.1.0.6_18 differ diff --git a/lib/arm/libheremaps-engine.so.1 b/lib/arm/libheremaps-engine.so.1 index b3ec213..8d230ba 120000 --- a/lib/arm/libheremaps-engine.so.1 +++ b/lib/arm/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_17 \ No newline at end of file +libheremaps-engine.so.1.0.6_18 \ No newline at end of file diff --git a/lib/arm/libheremaps-engine.so.1.0.6_17 b/lib/arm/libheremaps-engine.so.1.0.6_17 deleted file mode 100755 index 84d9215..0000000 Binary files a/lib/arm/libheremaps-engine.so.1.0.6_17 and /dev/null differ diff --git a/lib/arm/libheremaps-engine.so.1.0.6_18 b/lib/arm/libheremaps-engine.so.1.0.6_18 new file mode 100755 index 0000000..8d26a6e Binary files /dev/null and b/lib/arm/libheremaps-engine.so.1.0.6_18 differ diff --git a/lib/i586/libheremaps-engine.so.1 b/lib/i586/libheremaps-engine.so.1 index b3ec213..8d230ba 120000 --- a/lib/i586/libheremaps-engine.so.1 +++ b/lib/i586/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_17 \ No newline at end of file +libheremaps-engine.so.1.0.6_18 \ No newline at end of file diff --git a/lib/i586/libheremaps-engine.so.1.0.6_17 b/lib/i586/libheremaps-engine.so.1.0.6_17 deleted file mode 100755 index a7bff41..0000000 Binary files a/lib/i586/libheremaps-engine.so.1.0.6_17 and /dev/null differ diff --git a/lib/i586/libheremaps-engine.so.1.0.6_18 b/lib/i586/libheremaps-engine.so.1.0.6_18 new file mode 100755 index 0000000..5d8be02 Binary files /dev/null and b/lib/i586/libheremaps-engine.so.1.0.6_18 differ diff --git a/lib/x86_64/libheremaps-engine.so.1 b/lib/x86_64/libheremaps-engine.so.1 index b3ec213..8d230ba 120000 --- a/lib/x86_64/libheremaps-engine.so.1 +++ b/lib/x86_64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_17 \ No newline at end of file +libheremaps-engine.so.1.0.6_18 \ No newline at end of file diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_17 b/lib/x86_64/libheremaps-engine.so.1.0.6_17 deleted file mode 100755 index e9a8145..0000000 Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_17 and /dev/null differ diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_18 b/lib/x86_64/libheremaps-engine.so.1.0.6_18 new file mode 100755 index 0000000..e302c29 Binary files /dev/null and b/lib/x86_64/libheremaps-engine.so.1.0.6_18 differ diff --git a/maps-plugin-here.changes b/maps-plugin-here.changes index 0917ac5..55b2a8d 100644 --- a/maps-plugin-here.changes +++ b/maps-plugin-here.changes @@ -1,3 +1,8 @@ +[Version] maps-plugin-here_0.3.5 +[Date] 31 Aug 2016 +[Title] fixed bugs that media-data of place-image or place-review can be omitted +[Developer] Seechan Kim + [Version] maps-plugin-here_0.3.4 [Date] 24 Aug 2016 [Title] modified to flush gl buffer after rendering diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index e38b1fc..0e2b767 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.4 +Version: 0.3.5 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE diff --git a/src/here_place.cpp b/src/here_place.cpp index 89e4cd4..2bca429 100644 --- a/src/here_place.cpp +++ b/src/here_place.cpp @@ -615,10 +615,12 @@ void HerePlace::OnPlaceDetailsReply(const PlaceDetailsReply &Reply) ProcessPlaceRatings(herePlace, mapsPlace); - ProcessPlaceRated(herePlace, mapsPlace); + ProcessPlaceRelated(herePlace, mapsPlace); ProcessPlaceAttributes(herePlace, mapsPlace); + ProcessPlaceSupplier(herePlace, mapsPlace); + if (!isPending) m_PlaceList.push_back(mapsPlace); @@ -850,9 +852,9 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac maps_item_list_h mapsImageList; maps_place_image_h mapsImage; maps_place_link_object_h mapsImageUser; - LinkObject hereImageUser; + maps_place_media_h mapsImageMedia; int error; - bool is_valid, is_valid2; + bool is_valid; if (hereImageList.empty()) return; @@ -864,10 +866,9 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac is_valid = false; /* here not supported - // maps_place_image_set_height(maps_place_image_h mapsPlace, const int height); */ - - /* here not supported - // maps_place_image_set_media(maps_place_image_h mapsPlace, maps_place_media_h media); */ + maps_place_image_set_height(maps_place_image_h mapsPlace, const int height); + maps_place_image_set_width(maps_place_image_h mapsPlace, const int height); + */ if (!hereImage->GetSource().empty()) { error = maps_place_image_set_url(mapsImage, (char*)hereImage->GetSource().c_str()); @@ -879,41 +880,22 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac is_valid |= (error == MAPS_ERROR_NONE); } - hereImageUser = hereImage->GetUser(); if (maps_place_link_object_create(&mapsImageUser) == MAPS_ERROR_NONE) { - is_valid2 = false; - - if (!hereImageUser.GetId().empty()) { - error = maps_place_link_object_set_id(mapsImageUser, - (char*)hereImageUser.GetId().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereImageUser.GetTitle().empty()) { - error = maps_place_link_object_set_name(mapsImageUser, - (char*)hereImageUser.GetTitle().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereImageUser.GetHref().empty()) { - error = maps_place_link_object_set_string(mapsImageUser, - (char*)hereImageUser.GetHref().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereImageUser.GetType().empty()) { - error = maps_place_link_object_set_type(mapsImageUser, - (char*)hereImageUser.GetType().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (is_valid2) { + if (ProcessPlaceLinkObject(hereImage->GetUser(), mapsImageUser)) { maps_place_image_set_user_link(mapsImage, mapsImageUser); - is_valid |= is_valid2; + is_valid = true; } maps_place_link_object_destroy(mapsImageUser); } + if (maps_place_media_create(&mapsImageMedia) == MAPS_ERROR_NONE) { + if (ProcessPlaceMedia(*hereImage, mapsImageMedia)) { + maps_place_image_set_media(mapsImage, mapsImageMedia); + is_valid = true; + } + maps_place_media_destroy(mapsImageMedia); + } + if (is_valid) maps_item_list_append(mapsImageList, mapsImage, maps_place_image_clone); @@ -980,8 +962,9 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla maps_item_list_h mapsReviewList; LinkObject hereReviewUser; maps_place_link_object_h mapsReviewUser; + maps_place_media_h mapsReviewMedia; int error; - bool is_valid, is_valid2; + bool is_valid; if (hereReviewList.empty()) return; @@ -1010,8 +993,6 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla is_valid |= (error == MAPS_ERROR_NONE); } - /* maps_place_review_set_media(mapsReview, maps_place_media_h media) */ - maps_place_review_set_rating(mapsReview, hereReview->GetRating()); if (!hereReview->GetTitle().empty()) { @@ -1020,42 +1001,22 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla is_valid |= (error == MAPS_ERROR_NONE); } - hereReviewUser = hereReview->GetUser(); if (maps_place_link_object_create(&mapsReviewUser) == MAPS_ERROR_NONE) { - is_valid2 = false; - - if (!hereReviewUser.GetId().empty()) { - error = maps_place_link_object_set_id(mapsReviewUser, - (char*)hereReviewUser.GetId().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereReviewUser.GetTitle().empty()) { - error = maps_place_link_object_set_name(mapsReviewUser, - (char*)hereReviewUser.GetTitle().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereReviewUser.GetHref().empty()) { - error = maps_place_link_object_set_string(mapsReviewUser, - (char*)hereReviewUser.GetHref().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (!hereReviewUser.GetType().empty()) { - error = maps_place_link_object_set_type(mapsReviewUser, - (char*)hereReviewUser.GetType().c_str()); - is_valid2 |= (error == MAPS_ERROR_NONE); - } - - if (is_valid2) { + if (ProcessPlaceLinkObject(hereReview->GetUser(), mapsReviewUser)) { maps_place_review_set_user_link(mapsReview, mapsReviewUser); - is_valid |= is_valid2; + is_valid = true; } - maps_place_link_object_destroy(mapsReviewUser); } + if (maps_place_media_create(&mapsReviewMedia) == MAPS_ERROR_NONE) { + if (ProcessPlaceMedia(*hereReview, mapsReviewMedia)) { + maps_place_review_set_media(mapsReview, mapsReviewMedia); + is_valid = true; + } + maps_place_media_destroy(mapsReviewMedia); + } + if (is_valid) maps_item_list_append(mapsReviewList, mapsReview, maps_place_review_clone); @@ -1082,7 +1043,7 @@ void HerePlace::ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPla maps_place_rating_destroy(mapsRating); } -void HerePlace::ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace) +void HerePlace::ProcessPlaceRelated(PlaceDetails herePlace, maps_place_h mapsPlace) { RelatedItem hereRelated = herePlace.GetRelatedItem(); maps_place_link_object_h mapsRelated; @@ -1091,8 +1052,7 @@ void HerePlace::ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace if (maps_place_link_object_create(&mapsRelated) != MAPS_ERROR_NONE) return; - //need to check if GetId() exist - //maps_place_link_object_set_id(mapsRelated, hereRelated.GetId()); + maps_place_link_object_set_id(mapsRelated, "recommended"); if (!hereRelated.GetTitle().empty()) { error = maps_place_link_object_set_name(mapsRelated, @@ -1168,6 +1128,78 @@ void HerePlace::ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h maps maps_item_list_destroy(mapsAttributeList); } +void HerePlace::ProcessPlaceSupplier(PlaceDetails herePlace, maps_place_h mapsPlace) +{ + maps_place_link_object_h mapsLinkObject; + + if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) { + if (ProcessPlaceLinkObject(herePlace.GetBaseContent().GetSupplier(), mapsLinkObject)) + maps_place_set_supplier_link(mapsPlace, mapsLinkObject); + maps_place_link_object_destroy(mapsLinkObject); + } +} + +bool HerePlace::ProcessPlaceMedia(BaseContent hereContent, maps_place_media_h mapsMedia) +{ + int error; + bool is_valid = false; + maps_place_link_object_h mapsLinkObject; + + if (!hereContent.GetAttribution().empty()) { + error = maps_place_media_set_attribution(mapsMedia, + (char*)hereContent.GetAttribution().c_str()); + is_valid = (error == MAPS_ERROR_NONE); + } + + if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) { + if (ProcessPlaceLinkObject(hereContent.GetSupplier(), mapsLinkObject)) { + maps_place_media_set_supplier(mapsMedia, mapsLinkObject); + is_valid = true; + } + maps_place_link_object_destroy(mapsLinkObject); + } + + if (maps_place_link_object_create(&mapsLinkObject) == MAPS_ERROR_NONE) { + if (ProcessPlaceLinkObject(hereContent.GetVia(), mapsLinkObject)) { + maps_place_media_set_via(mapsMedia, mapsLinkObject); + is_valid = true; + } + maps_place_link_object_destroy(mapsLinkObject); + } + return is_valid; +} + +bool HerePlace::ProcessPlaceLinkObject(LinkObject hereLinkObject, maps_place_link_object_h mapsLinkObject) +{ + int error; + bool is_valid = false; + + if (!hereLinkObject.GetId().empty()) { + error = maps_place_link_object_set_id(mapsLinkObject, + (char*)hereLinkObject.GetId().c_str()); + is_valid |= (error == MAPS_ERROR_NONE); + } + + if (!hereLinkObject.GetTitle().empty()) { + error = maps_place_link_object_set_name(mapsLinkObject, + (char*)hereLinkObject.GetTitle().c_str()); + is_valid |= (error == MAPS_ERROR_NONE); + } + + if (!hereLinkObject.GetHref().empty()) { + error = maps_place_link_object_set_string(mapsLinkObject, + (char*)hereLinkObject.GetHref().c_str()); + is_valid |= (error == MAPS_ERROR_NONE); + } + + if (!hereLinkObject.GetType().empty()) { + error = maps_place_link_object_set_type(mapsLinkObject, + (char*)hereLinkObject.GetType().c_str()); + is_valid |= (error == MAPS_ERROR_NONE); + } + return is_valid; +} + void HerePlace::__flushReplies(int error) { maps_place_h mapsPlace;