]> git.street.me.uk Git - andy/viking.git/blobdiff - src/datasource_google.c
Diasable buttons on Track Properties Dialog when not needed.
[andy/viking.git] / src / datasource_google.c
index 54c25b3dbc0a75a9d06743d718642c31cc152370..0bb8137dc820abfb960d8fccb285429640db7092 100644 (file)
@@ -69,9 +69,9 @@ static void datasource_google_add_setup_widgets ( GtkWidget *dialog, VikViewport
   to_label = gtk_label_new ("To:");
   widgets->to_entry = gtk_entry_new();
   if (last_from_str)
-    gtk_entry_set_text(widgets->from_entry, last_from_str);
+    gtk_entry_set_text(GTK_ENTRY(widgets->from_entry), last_from_str);
   if (last_to_str)
-    gtk_entry_set_text(widgets->to_entry, last_to_str);
+    gtk_entry_set_text(GTK_ENTRY(widgets->to_entry), last_to_str);
   gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), from_label, FALSE, FALSE, 5 );
   gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), widgets->from_entry, FALSE, FALSE, 5 );
   gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), to_label, FALSE, FALSE, 5 );
@@ -89,10 +89,8 @@ static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widg
   *cmd = g_strdup_printf( GOOGLE_DIRECTIONS_STRING, from_quoted, to_quoted );
   *input_type = g_strdup("google");
 
-  if (last_from_str)
-    free(last_from_str);
-  if (last_to_str)
-    free(last_to_str);
+  g_free(last_from_str);
+  g_free(last_to_str);
 
   last_from_str = g_strdup(gtk_entry_get_text ( GTK_ENTRY(widgets->from_entry) ) );
   last_to_str = g_strdup(gtk_entry_get_text ( GTK_ENTRY(widgets->to_entry) ) );