From c82b18800481edd95aa3725023a347ef70f3eaaf Mon Sep 17 00:00:00 2001 From: gnuite Date: Mon, 17 Mar 2008 03:39:18 +0000 Subject: [PATCH] Fixed bugs in POI adding/editing. git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@177 6c538b50-5814-0410-93ad-8bdf4c0149d1 --- src/poi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/poi.c b/src/poi.c index 0856482..3eba947 100644 --- a/src/poi.c +++ b/src/poi.c @@ -1228,10 +1228,15 @@ poi_add_dialog(GtkWidget *parent, gint unitx, gint unity) unit2latlon(unitx, unity, poi.lat, poi.lon); /* Lat/Lon */ - snprintf(buffer, sizeof(buffer), "%.06f", poi.lat); - gtk_entry_set_text(GTK_ENTRY(txt_lat), buffer); - snprintf(buffer, sizeof(buffer), "%.06f", poi.lon); - gtk_entry_set_text(GTK_ENTRY(txt_lon), buffer); + { + gchar tmp1[LL_FMT_LEN], tmp2[LL_FMT_LEN]; + + lat_format(poi.lat, tmp1); + lon_format(poi.lon, tmp2); + + gtk_entry_set_text(GTK_ENTRY(txt_lat), tmp1); + gtk_entry_set_text(GTK_ENTRY(txt_lon), tmp2); + } /* Label */ if(SQLITE_ROW == sqlite3_step(_stmt_nextlabel_poi)) @@ -1481,8 +1486,8 @@ poi_view_dialog(GtkWidget *parent, PoiInfo *poi) lat_format(poi->lat, tmp1); lon_format(poi->lon, tmp2); - gtk_entry_set_text(GTK_ENTRY(txt_lat), tmp2); - gtk_entry_set_text(GTK_ENTRY(txt_lon), tmp1); + gtk_entry_set_text(GTK_ENTRY(txt_lat), tmp1); + gtk_entry_set_text(GTK_ENTRY(txt_lon), tmp2); } /* label */ @@ -1565,7 +1570,7 @@ poi_view_dialog(GtkWidget *parent, PoiInfo *poi) SQLITE_OK != sqlite3_bind_text(_stmt_update_poi, 3, poi->label, -1, SQLITE_STATIC) || SQLITE_OK != sqlite3_bind_text(_stmt_update_poi, 4, poi->desc, - -1, g_free) || + -1, SQLITE_STATIC) || SQLITE_OK != sqlite3_bind_int( _stmt_update_poi, 5, poi->cat_id) || SQLITE_OK != sqlite3_bind_int( -- 2.44.0