]> err.no Git - mapper/commitdiff
Cleanups
authorKaj-Michael Lang <milang@angel.tal.org>
Fri, 27 Jul 2007 09:06:08 +0000 (12:06 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Fri, 27 Jul 2007 09:06:08 +0000 (12:06 +0300)
src/osm.h
src/poi-gui.c
src/route.c

index f661f001e581f45ba87d2b5f5c9b7aa2fbab4996..3d53c2be2ae5a747f1dfb1743abdec3d7a2918a4 100644 (file)
--- a/src/osm.h
+++ b/src/osm.h
@@ -160,6 +160,7 @@ struct _osm_waypoint {
        waypoint_type_t type;
 };
 
+/* Location: way/street we are on, city/town/village/hamlet and suburb */
 typedef struct _osm_location osm_location;
 struct _osm_location {
        osm_way *street;
index 31c4ba6496c819c87169c82e86a46d420884bffd..62e392665249b46d88e9f9eabf4c703960c80c5b 100644 (file)
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <fcntl.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <curl/multi.h>
-#include <gconf/gconf-client.h>
-#include <libxml/parser.h>
 
 #include <libintl.h>
 #include <locale.h>
index 6b7e5d1478b857198a1b4c851de9b7feed1f2ab3..2dac69913497b1152011c99af0a9d6b5580b39f5 100644 (file)
@@ -145,8 +145,7 @@ void cancel_autoroute(gboolean temporary)
                if (_autoroute_data.curl_easy) {
                        if (_curl_multi)
                                curl_multi_remove_handle(_curl_multi,
-                                                        _autoroute_data.
-                                                        curl_easy);
+                                                        _autoroute_data.curl_easy);
                        curl_easy_cleanup(_autoroute_data.curl_easy);
                        _autoroute_data.curl_easy = NULL;
                }
@@ -409,13 +408,11 @@ gboolean route_download(gchar * to)
                /* Attempt to download the route from the server. */
                MACRO_CURL_EASY_INIT(curl_easy);
                curl_easy_setopt(curl_easy, CURLOPT_URL, buffer);
-               curl_easy_setopt(curl_easy, CURLOPT_WRITEFUNCTION,
-                                route_dl_cb_read);
+               curl_easy_setopt(curl_easy, CURLOPT_WRITEFUNCTION, route_dl_cb_read);
                curl_easy_setopt(curl_easy, CURLOPT_WRITEDATA, &rdl_data);
                if (CURLE_OK != curl_easy_perform(curl_easy)) {
                        popup_error(dialog,
-                                   _
-                                   ("Failed to connect to GPX Directions server"));
+                                   _("Failed to connect to GPX Directions server"));
                        curl_easy_cleanup(curl_easy);
                        g_free(rdl_data.bytes);
                        /* Let them try again */
@@ -426,8 +423,7 @@ gboolean route_download(gchar * to)
                if (strncmp(rdl_data.bytes, "<?xml", strlen("<?xml"))) {
                        /* Not an XML document - must be bad locations. */
                        popup_error(dialog,
-                                   _
-                                   ("Could not generate directions. Make sure your "
+                                   _("Could not generate directions. Make sure your "
                                     "source and destination are valid."));
                        g_free(rdl_data.bytes);
                        /* Let them try again. */
@@ -450,29 +446,21 @@ gboolean route_download(gchar * to)
                        if (gtk_toggle_button_get_active
                            (GTK_TOGGLE_BUTTON(oti.chk_auto))) {
                                /* Kick off a timeout to start the first update. */
-                               _autoroute_data.dest =
-                                   gnome_vfs_escape_string(to);
+                               _autoroute_data.dest = gnome_vfs_escape_string(to);
                                _autoroute_data.enabled = TRUE;
                        }
 
                        /* Save Origin in Route Locations list if not from GPS. */
-                       if (!gtk_toggle_button_get_active
-                           (GTK_TOGGLE_BUTTON(oti.rad_use_gps))
-                           && !g_slist_find_custom(_loc_list, from,
-                                                   (GCompareFunc) strcmp)) {
-                               _loc_list =
-                                   g_slist_prepend(_loc_list, g_strdup(from));
+                       if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(oti.rad_use_gps))
+                           && !g_slist_find_custom(_loc_list, from, (GCompareFunc) strcmp)) {
+                               _loc_list = g_slist_prepend(_loc_list, g_strdup(from));
                                gtk_list_store_insert_with_values(_loc_model,
-                                                                 &iter,
-                                                                 INT_MAX, 0,
-                                                                 from, -1);
+                                                                 &iter, INT_MAX, 0, from, -1);
                        }
 
                        /* Save Destination in Route Locations list. */
-                       if (!g_slist_find_custom(_loc_list, to,
-                                                (GCompareFunc) strcmp)) {
-                               _loc_list =
-                                   g_slist_prepend(_loc_list, g_strdup(to));
+                       if (!g_slist_find_custom(_loc_list, to, (GCompareFunc) strcmp)) {
+                               _loc_list = g_slist_prepend(_loc_list, g_strdup(to));
                                gtk_list_store_insert_with_values(_loc_model,
                                                                  &iter,
                                                                  INT_MAX, 0,