updated to use category_set_id vs category_set_name. 45/88145/1
authorgknisely <greg@mapzen.com>
Tue, 13 Sep 2016 14:42:05 +0000 (10:42 -0400)
committergknisely <greg@mapzen.com>
Tue, 13 Sep 2016 14:42:05 +0000 (10:42 -0400)
Change-Id: Ie4d60237cf5d3506fc628ea1fd17b843ce91dd91

src/mapzen_plugin.c

index fb9859c..ef07370 100644 (file)
@@ -1458,7 +1458,7 @@ EXPORT_API int maps_plugin_search_place(const maps_coordinates_h position, int d
 
        MAPS_LOGD("Place Result limit :: %d", place_req->num_res);
 
-       char *categoryName = NULL;
+       char *categoryId = NULL;
        char *searchKeyword = NULL;
 
        maps_place_category_h category = NULL;
@@ -1466,17 +1466,17 @@ EXPORT_API int maps_plugin_search_place(const maps_coordinates_h position, int d
        maps_place_filter_get_keyword(filter, &searchKeyword);
 
        if (category) {
-               maps_place_category_get_name(category, &categoryName);
+               maps_place_category_get_id(category, &categoryId);
                maps_place_category_destroy(category);
        }
 
-       if (categoryName)
-               place_req->categories = g_strdup_printf("%s", categoryName);
+       if (categoryId)
+               place_req->categories = g_strdup_printf("%s", categoryId);
 
        if (searchKeyword)
                place_req->search_string = g_strdup_printf("%s", searchKeyword);
 
-       if (!searchKeyword && !categoryName) {
+       if (!searchKeyword && !categoryId) {
                g_free(calldata_place);
                calldata_place = NULL;
                g_free(place_req);
@@ -1489,9 +1489,9 @@ EXPORT_API int maps_plugin_search_place(const maps_coordinates_h position, int d
                searchKeyword = NULL;
        }
 
-       if (categoryName) {
-               g_free(categoryName);
-               categoryName = NULL;
+       if (categoryId) {
+               g_free(categoryId);
+               categoryId = NULL;
        }
 
        MAPS_LOGD(">>>>>>>> Place search categories :: %s <<<<<<<<<", place_req->categories);
@@ -1548,7 +1548,7 @@ EXPORT_API int maps_plugin_search_place_by_area(const maps_area_h boundary, cons
 
        MAPS_LOGD("Place Result limit :: %d", place_req->num_res);
 
-       char *categoryName = NULL;
+       char *categoryId = NULL;
        char *searchKeyword = NULL;
 
        maps_place_category_h category = NULL;
@@ -1556,17 +1556,17 @@ EXPORT_API int maps_plugin_search_place_by_area(const maps_area_h boundary, cons
        maps_place_filter_get_keyword(filter, &searchKeyword);
 
        if (category) {
-               maps_place_category_get_name(category, &categoryName);
+               maps_place_category_get_id(category, &categoryId);
                maps_place_category_destroy(category);
        }
 
-       if (categoryName)
-               place_req->categories = g_strdup_printf("%s", categoryName);
+       if (categoryId)
+               place_req->categories = g_strdup_printf("%s", categoryId);
 
        if (searchKeyword)
                place_req->search_string = g_strdup_printf("%s", searchKeyword);
 
-       if (!searchKeyword && !categoryName) {
+       if (!searchKeyword && !categoryId) {
                g_free(calldata_place);
                calldata_place = NULL;
                g_free(place_req);
@@ -1579,9 +1579,9 @@ EXPORT_API int maps_plugin_search_place_by_area(const maps_area_h boundary, cons
                searchKeyword = NULL;
        }
 
-       if (categoryName) {
-               g_free(categoryName);
-               categoryName = NULL;
+       if (categoryId) {
+               g_free(categoryId);
+               categoryId = NULL;
        }
 
        MAPS_LOGD(">>>>>>>> Place search categories :: %s <<<<<<<<<", place_req->categories);
@@ -1648,7 +1648,7 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m
 
        MAPS_LOGD("Place Result limit :: %d", place_req->num_res);
 
-       char *categoryName = NULL;
+       char *categoryId = NULL;
        char *searchKeyword = NULL;
 
        maps_place_category_h category = NULL;
@@ -1656,17 +1656,17 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m
        maps_place_filter_get_keyword(filter, &searchKeyword);
 
        if (category) {
-               maps_place_category_get_name(category, &categoryName);
+               maps_place_category_get_id(category, &categoryId);
                maps_place_category_destroy(category);
        }
 
-       if (categoryName)
-               place_req->categories = g_strdup_printf("%s", categoryName);
+       if (categoryId)
+               place_req->categories = g_strdup_printf("%s", categoryId);
 
        if (searchKeyword)
                place_req->search_string = g_strdup_printf("%s", searchKeyword);
 
-       if (!searchKeyword && !categoryName) {
+       if (!searchKeyword && !categoryId) {
                g_free(calldata_place);
                calldata_place = NULL;
                g_free(place_req);
@@ -1679,9 +1679,9 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m
                searchKeyword = NULL;
        }
 
-       if (categoryName) {
-               g_free(categoryName);
-               categoryName = NULL;
+       if (categoryId) {
+               g_free(categoryId);
+               categoryId = NULL;
        }
 
        MAPS_LOGD(">>>>>>>> Place search categories :: %s <<<<<<<<<", place_req->categories);
@@ -1777,23 +1777,23 @@ EXPORT_API int maps_plugin_search_place_by_address(const char *address, const ma
 
        MAPS_LOGD("Place Result limit :: %d", place_req->num_res);
 
-       char *categoryName = NULL;
+       char *categoryId = NULL;
 
        maps_place_category_h category = NULL;
        maps_place_filter_get_category(filter, &category);
 
        if (category) {
-               maps_place_category_get_name(category, &categoryName);
+               maps_place_category_get_id(category, &categoryId);
                maps_place_category_destroy(category);
        }
 
-       if (categoryName)
-               place_req->categories = g_strdup_printf("%s", categoryName);
+       if (categoryId)
+               place_req->categories = g_strdup_printf("%s", categoryId);
 
        if (address)
                place_req->search_string = g_strdup_printf("%s", address);
 
-       if (!address && !categoryName) {
+       if (!address && !categoryId) {
                g_free(calldata_place);
                calldata_place = NULL;
                g_free(place_req);
@@ -1801,9 +1801,9 @@ EXPORT_API int maps_plugin_search_place_by_address(const char *address, const ma
                return MAPS_ERROR_INVALID_PARAMETER;
        }
 
-       if (categoryName) {
-               g_free(categoryName);
-               categoryName = NULL;
+       if (categoryId) {
+               g_free(categoryId);
+               categoryId = NULL;
        }
 
        MAPS_LOGD(">>>>>>>> Place search categories :: %s <<<<<<<<<", place_req->categories);