/[zanavi_public1]/navit/navit/map/binfile/binfile.c
ZANavi

Diff of /navit/navit/map/binfile/binfile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 27 Revision 30
2083 break; 2083 break;
2084 case attr_town_name: 2084 case attr_town_name:
2085 case attr_town_or_district_name: 2085 case attr_town_or_district_name:
2086 map_rec = map_rect_new_binfile(map, NULL); 2086 map_rec = map_rect_new_binfile(map, NULL);
2087 if (!map_rec) 2087 if (!map_rec)
2088 {
2088 break; 2089 break;
2090 }
2089 map_rec->country_id = item->id_lo; 2091 map_rec->country_id = item->id_lo;
2090 msp->mr = map_rec; 2092 msp->mr = map_rec;
2091 willsearch = 1; 2093 willsearch = 1;
2092 break; 2094 break;
2093 case attr_town_postal: 2095 case attr_town_postal:
2103 { 2105 {
2104 struct coord c; 2106 struct coord c;
2105 2107
2106 if (binmap_search_by_index(map, town, &msp->mr)) 2108 if (binmap_search_by_index(map, town, &msp->mr))
2107 { 2109 {
2108 dbg(0, "search:mode=1\n"); 2110 //dbg(0, "search:mode=1\n");
2109 msp->mode = 1; 2111 msp->mode = 1;
2110 } 2112 }
2111 else 2113 else
2112 { 2114 {
2113 if (item_coord_get(town, &c, 1)) 2115 if (item_coord_get(town, &c, 1))
2114 { 2116 {
2115 if ((msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms))) 2117 if ((msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms)))
2116 { 2118 {
2117 dbg(0, "search:mode=2\n"); 2119 //dbg(0, "search:mode=2\n");
2118 msp->mode = 2; 2120 msp->mode = 2;
2119 } 2121 }
2120 else 2122 else
2121 { 2123 {
2122 msp->mr = binmap_search_street_by_estimate(map, town, &c, &msp->ms); 2124 msp->mr = binmap_search_street_by_estimate(map, town, &c, &msp->ms);
2123 dbg(0, "search:mode=3\n"); 2125 //dbg(0, "search:mode=3\n");
2124 msp->mode = 3; 2126 msp->mode = 3;
2125 } 2127 }
2126 } 2128 }
2127 } 2129 }
2128 map_rect_destroy_binfile(map_rec); 2130 map_rect_destroy_binfile(map_rec);
2864 { 2866 {
2865 while ((item = map_rect_get_item_binfile(mr)) == &busy_item) 2867 while ((item = map_rect_get_item_binfile(mr)) == &busy_item)
2866 { 2868 {
2867 ; 2869 ;
2868 } 2870 }
2871
2869 if (item && item->type == type_map_information) 2872 if (item && item->type == type_map_information)
2870 { 2873 {
2871 if (binfile_attr_get(item->priv_data, attr_version, &attr)) 2874 if (binfile_attr_get(item->priv_data, attr_version, &attr))
2872 { 2875 {
2873 m->map_version = attr.u.num; 2876 m->map_version = attr.u.num;
2878 m->map_release = g_strdup(attr.u.str); 2881 m->map_release = g_strdup(attr.u.str);
2879 dbg(0, "map_release=%s\n", m->map_release); 2882 dbg(0, "map_release=%s\n", m->map_release);
2880 } 2883 }
2881 if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr)) 2884 if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr))
2882 { 2885 {
2883 dbg(0, "url config %s map %s\n", m->url, attr.u.str); 2886 //dbg(0, "url config %s map %s\n", m->url, attr.u.str);
2884 if (strcmp(m->url, attr.u.str)) 2887 if (strcmp(m->url, attr.u.str))
2885 { 2888 {
2886 m->update_available = 1; 2889 m->update_available = 1;
2887 } 2890 }
2888 g_free(m->url); 2891 g_free(m->url);
2889 m->url = g_strdup(attr.u.str); 2892 m->url = g_strdup(attr.u.str);
2890 } 2893 }
2891 } 2894 }
2895
2892 map_rect_destroy_binfile(mr); 2896 map_rect_destroy_binfile(mr);
2897
2893 if (m->map_version >= 16) 2898 if (m->map_version >= 16)
2894 { 2899 {
2895 dbg(0, "Warning: This map is incompatible with your versionof ZANavi. Please update ZANavi.\n"); 2900 dbg(0, "Warning: This map is incompatible with your versionof ZANavi. Please update ZANavi.\n");
2896 return 0; 2901 return 0;
2897 } 2902 }

Legend:
Removed from v.27  
changed lines
  Added in v.30

   
Visit the ZANavi Wiki