]> git.itanic.dy.fi Git - maemo-mapper/commitdiff
Fixed bugs in POI adding/editing.
authorgnuite <gnuite@gmail.com>
Mon, 17 Mar 2008 03:39:18 +0000 (03:39 +0000)
committergnuite <gnuite@gmail.com>
Mon, 17 Mar 2008 03:39:18 +0000 (03:39 +0000)
git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@177 6c538b50-5814-0410-93ad-8bdf4c0149d1

src/poi.c

index 0856482d76198d190edaf22a67071c8ab2d6e9dc..3eba947654dcff291a416254f3d868ae503ec912 100644 (file)
--- 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 */
     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))
 
     /* 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);
 
         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 */
     }
 
     /* 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,
            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(
            SQLITE_OK != sqlite3_bind_int(
                _stmt_update_poi, 5, poi->cat_id) ||
            SQLITE_OK != sqlite3_bind_int(