From: Kaj-Michael Lang Date: Mon, 18 Feb 2008 12:05:35 +0000 (+0200) Subject: Use g_debug for any output. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36582fe17e9f93b7743dbfe27bb94b6afcd4660;p=mapper Use g_debug for any output. --- diff --git a/src/map.c b/src/map.c index 996e30e..a276d1a 100644 --- a/src/map.c +++ b/src/map.c @@ -350,7 +350,7 @@ if (se==0) { if (t-tstat.st_mtime>TILE_MAX_AGE) { if (_auto_download && _curr_repo->type != REPOTYPE_NONE && !((_zoom + zoff - (_curr_repo->double_size ? 1 : 0)) % _curr_repo->dl_zoom_steps)) { if (download) { - g_printf("Tile: %s is old, re-downloading\n", buffer); + g_debug("Tile: %s is old, re-downloading\n", buffer); map_initiate_download(tilex >> zoff, tiley >> zoff, _zoom + zoff, -INITIAL_DOWNLOAD_RETRIES); } } @@ -433,7 +433,7 @@ for (new_y = 0; new_y < BUF_HEIGHT_TILES; ++new_y) } #ifdef DEBUG_MAP_TIME g_timer_stop(map_timer); -g_printf("Full redraw: %f sec\n", g_timer_elapsed(map_timer, &tms)); +g_debug("Full redraw: %f sec\n", g_timer_elapsed(map_timer, &tms)); #endif map_render_data(); MACRO_QUEUE_DRAW_AREA(); @@ -1056,7 +1056,7 @@ z=(z+_gps->data.speed+1)/5; if (z>5) z=5.0; else if (z<1) z=1.0; iz=(gint)roundf(z); #ifdef DEBUG -g_printf("Setting autozoom to: %f %d S:%f\n", z, iz, _gps->data.speed); +g_debug("Setting autozoom to: %f %d S:%f\n", z, iz, _gps->data.speed); #endif if (iz>last) iz=last+1; @@ -1160,9 +1160,7 @@ if (_dest.valid) { if (dt>0.05) { dest_reached=FALSE; } -#if 0 - g_printf("%f (Prev:%f)\n", prev_dt, dt); -#endif + g_debug("%f (Prev:%f)\n", prev_dt, dt); } else { dest_reached=FALSE; prev_dt=99999.0; @@ -1186,6 +1184,11 @@ if (_next_way && _next_way->point) { } +/** + * Query the OSM database for where we are. + * + * XXX: This is the wrong place for this function. + */ static void map_update_location(gdouble lat, gdouble lon, gboolean force) { @@ -1221,7 +1224,7 @@ inp=FALSE; /** * Mouse scroller zoom in/out callback */ -static gboolean +static gboolean map_cb_scroll_event(GtkWidget * widget, GdkEventScroll * event) { if (event->direction == GDK_SCROLL_UP) { @@ -1349,7 +1352,7 @@ case 1: unit2latlon(ux, uy, lat, lon); if (map_poi_find_at_latlon(lat, lon, &poi_id)==TRUE) { - g_printf("POI: %d\n", poi_id); + g_debug("POI: %d\n", poi_id); g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_cb_show_poi_info_dialog, GINT_TO_POINTER(poi_id), NULL); } if (map_data_needs_refresh==TRUE) {