diff options
author | Joseph Herlant <aerostitch@users.noreply.github.com> | 2018-04-26 10:12:26 -0700 |
---|---|---|
committer | jkoan <jkoan@users.noreply.github.com> | 2018-04-26 19:12:26 +0200 |
commit | 221f783ea1caaaab2f5ceadc6b0fb3e720aac3df (patch) | |
tree | 1ecf89faa1dfa550477669b05ef5c36e9864f68a /navit/gui | |
parent | 011bb15468b4cb626e9facecba924b04bd494d7f (diff) | |
download | navit-221f783ea1caaaab2f5ceadc6b0fb3e720aac3df.tar.gz |
Fix:debug:Change line separators for dbg to work also on win* platform (#546)
* Fix:debug:Change line separators for dbg to work also on win* platform
* Fix:debug:Break multiline dbg statements to use the new model
* Fix:debug:Move the EOL into debug_vprintf
Diffstat (limited to 'navit/gui')
25 files changed, 205 insertions, 205 deletions
diff --git a/navit/gui/gtk/datawindow.c b/navit/gui/gtk/datawindow.c index dd71ce999..777a205e8 100644 --- a/navit/gui/gtk/datawindow.c +++ b/navit/gui/gtk/datawindow.c @@ -48,7 +48,7 @@ select_row(GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, stru GtkTreeModel *model; int i; - dbg(lvl_debug,"win=%p\n", win); + dbg(lvl_debug,"win=%p", win); model=gtk_tree_view_get_model(tree); gtk_tree_model_get_iter(model, &iter, path); diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c index 18fc58b75..a530cc559 100644 --- a/navit/gui/gtk/destination.c +++ b/navit/gui/gtk/destination.c @@ -164,7 +164,7 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn char *str; int column; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column); if(!path) return; @@ -184,11 +184,11 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn column=4; break; default: - dbg(lvl_debug,"Unknown mode\n"); + dbg(lvl_debug,"Unknown mode"); return; } gtk_tree_model_get(search->liststore2, &iter, column, &str, -1); - dbg(lvl_debug,"str=%s\n", str); + dbg(lvl_debug,"str=%s", str); search->partial=0; gtk_entry_set_text(GTK_ENTRY(entry_widget), str); } @@ -222,13 +222,13 @@ static void changed(GtkWidget *widget, struct search_param *search) printf("changed %s partial %d\n", search->attr.u.str, search->partial); if (widget == search->entry_country) { gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 3, GTK_SORT_ASCENDING); - dbg(lvl_debug,"country\n"); + dbg(lvl_debug,"country"); search->attr.type=attr_country_all; set_columns(search, 0); } if (widget == search->entry_postal) { gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 1, GTK_SORT_ASCENDING); - dbg(lvl_debug,"postal\n"); + dbg(lvl_debug,"postal"); search->attr.type=attr_town_postal; if (strlen(search->attr.u.str) < 2) return; @@ -236,14 +236,14 @@ static void changed(GtkWidget *widget, struct search_param *search) } if (widget == search->entry_city) { gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 2, GTK_SORT_ASCENDING); - dbg(lvl_debug,"town\n"); + dbg(lvl_debug,"town"); search->attr.type=attr_town_name; if (strlen(search->attr.u.str) < 3) return; set_columns(search, 1); } if (widget == search->entry_street) { - dbg(lvl_debug,"street\n"); + dbg(lvl_debug,"street"); search->attr.type=attr_street_name; // Searching for a street by just its first letter generates too many hits to be useful, // plus it causes the GUI to become unresponsive because the search is single-threaded. @@ -575,7 +575,7 @@ int destination_address(struct navit *nav) gtk_entry_set_text(GTK_ENTRY(search->entry_country), country_name.u.str); country_search_destroy(cs); } else { - dbg(lvl_error,"warning: no default country found\n"); + dbg(lvl_error,"warning: no default country found"); } search->partial=1; return 0; diff --git a/navit/gui/gtk/gui_gtk_action.c b/navit/gui/gtk/gui_gtk_action.c index de5128756..469d04ec8 100644 --- a/navit/gui/gtk/gui_gtk_action.c +++ b/navit/gui/gtk/gui_gtk_action.c @@ -110,7 +110,7 @@ cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy) attr.type=attr_cursor; attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_cursor\n"); + dbg(lvl_error, "Failed to set attr_cursor"); } } @@ -122,7 +122,7 @@ tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy) attr.type=attr_tracking; attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_tracking\n"); + dbg(lvl_error, "Failed to set attr_tracking"); } } @@ -143,7 +143,7 @@ follow_vehicle_action(GtkWidget *w, struct gui_priv *gui, void *dummy) attr.type=attr_follow_cursor; attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_follow_gps\n"); + dbg(lvl_error, "Failed to set attr_follow_gps"); } } @@ -155,7 +155,7 @@ orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy) attr.type=attr_orientation; attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)) ? 0:-1; if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_orientation\n"); + dbg(lvl_error, "Failed to set attr_orientation"); } } diff --git a/navit/gui/gtk/gui_gtk_poi.c b/navit/gui/gtk/gui_gtk_poi.c index a3578243b..ba2a00e98 100644 --- a/navit/gui/gtk/gui_gtk_poi.c +++ b/navit/gui/gtk/gui_gtk_poi.c @@ -55,7 +55,7 @@ geticon(const char *name){ GError *error=NULL; icon=gdk_pixbuf_new_from_file(graphics_icon_path(name),&error); if (error) { - dbg(lvl_error, "failed to load icon '%s': %s\n", name, error->message); + dbg(lvl_error, "failed to load icon '%s': %s", name, error->message); } return icon; } @@ -228,7 +228,7 @@ button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search) dest.y=lon; dest.pro=1; navit_set_destination(search->nav, &dest, buffer, 1); - dbg(lvl_debug,_("Set destination to %ld, %ld \n"),lat,lon); + dbg(lvl_debug,_("Set destination to %ld, %ld "),lat,lon); } /* Show the POI's position in the map. */ @@ -251,7 +251,7 @@ button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search) dest.y=lon; dest.pro=1; navit_set_center(search->nav, &dest,1); - dbg(lvl_debug,_("Set map to %ld, %ld \n"),lat,lon); + dbg(lvl_debug,_("Set map to %ld, %ld "),lat,lon); } /** Set POI as the first "visit before". */ @@ -268,7 +268,7 @@ button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search) if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return; gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1); gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1); - dbg(lvl_debug,_("Set next visit to %ld, %ld \n"),lat,lon); + dbg(lvl_debug,_("Set next visit to %ld, %ld "),lat,lon); struct pcoord dest; dest.x=lat; diff --git a/navit/gui/gtk/gui_gtk_window.c b/navit/gui/gtk/gui_gtk_window.c index 1741a54a0..c50aa2dcc 100644 --- a/navit/gui/gtk/gui_gtk_window.c +++ b/navit/gui/gtk/gui_gtk_window.c @@ -85,7 +85,7 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this) struct point p; if (event->type != GDK_KEY_PRESS) return FALSE; - dbg(lvl_debug,"keypress 0x%x\n", event->keyval); + dbg(lvl_debug,"keypress 0x%x", event->keyval); transform_get_size(navit_get_trans(this->nav), &w, &h); switch (event->keyval) { case GDK_KP_Enter: @@ -313,19 +313,19 @@ gui_gtk_toggle_init(struct gui_priv *this) toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction")); gtk_toggle_action_set_active(toggle_action, attr.u.num); } else { - dbg(lvl_warning, "Unable to locate CursorAction\n"); + dbg(lvl_warning, "Unable to locate CursorAction"); } if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) { toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction")); gtk_toggle_action_set_active(toggle_action, attr.u.num != -1); } else { - dbg(lvl_error, "Unable to locate OrientationAction\n"); + dbg(lvl_error, "Unable to locate OrientationAction"); } if (navit_get_attr(this->nav, attr_tracking, &attr, NULL)) { toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction")); gtk_toggle_action_set_active(toggle_action, attr.u.num); } else { - dbg(lvl_error, "Unable to locate TrackingAction\n"); + dbg(lvl_error, "Unable to locate TrackingAction"); } } @@ -478,7 +478,7 @@ gui_gtk_vehicles_update(struct gui_priv *this) char *name; GList *curr; struct gui_menu_info *meninfo; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); curr = g_list_first(this->vehicle_menuitems); diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index a571a827c..d634470f0 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -134,10 +134,10 @@ image_new_scaled(struct gui_priv *this, const char *name, int w, int h) char *full_path=NULL; full_path=graphics_icon_path(name); ret=graphics_image_new_scaled(this->gra, full_path, w, h); - dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s\n", name, w, h, ret ? "OK" : "NOT FOUND"); + dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s", name, w, h, ret ? "OK" : "NOT FOUND"); g_free(full_path); if (!ret) { - dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)\n", name, w, h); + dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)", name, w, h); full_path=graphics_icon_path("unknown"); ret=graphics_image_new_scaled(this->gra, full_path, w, h); g_free(full_path); @@ -508,7 +508,7 @@ gui_internal_apply_config(struct gui_priv *this) { struct gui_config_settings * current_config=0; - dbg(lvl_debug,"w=%d h=%d\n", this->root.w, this->root.h); + dbg(lvl_debug,"w=%d h=%d", this->root.w, this->root.h); /* * Select default values from profile based on the screen. */ @@ -593,7 +593,7 @@ static void gui_internal_cmd_set_destination(struct gui_priv *this, struct widget *wm, void *data) { char *name=data; - dbg(lvl_info,"c=%d:0x%x,0x%x\n", wm->c.pro, wm->c.x, wm->c.y); + dbg(lvl_info,"c=%d:0x%x,0x%x", wm->c.pro, wm->c.x, wm->c.y); navit_set_destination(this->nav, &wm->c, name, 1); if (this->flags & 512) { struct attr follow; @@ -848,13 +848,13 @@ gui_internal_cmd_view_attributes(struct gui_priv *this, struct widget *wm, void char *text; int count=0; - dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo); + dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo); wb=gui_internal_menu(this, "Attributes"); w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); gui_internal_widget_append(wb, w); mr=map_rect_new(wm->item.map, NULL); item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo); - dbg(lvl_info,"item=%p\n", item); + dbg(lvl_info,"item=%p", item); if (item) { text=g_strdup_printf("%s:%s", _("Item type"), item_to_name(item->type)); gui_internal_widget_append(w, @@ -896,10 +896,10 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void char *cmd=NULL; if (!wm->name) { - dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo); + dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo); mr=map_rect_new(wm->item.map, NULL); item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo); - dbg(lvl_info,"item=%p\n", item); + dbg(lvl_info,"item=%p", item); if (item) { while(item_attr_get(item, attr_url_local, &attr)) { if (! cmd) @@ -914,7 +914,7 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void #ifdef HAVE_SYSTEM system(cmd); #else - dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.\n",cmd); + dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.",cmd); #endif g_free(cmd); } @@ -1004,7 +1004,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void * if(!w) { map_rect_destroy(mr); - dbg(lvl_warning,"Can't find the results table - only map clean up is done.\n"); + dbg(lvl_warning,"Can't find the results table - only map clean up is done."); return; } @@ -1016,7 +1016,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void * struct item* it; if(wi->name==NULL) continue; - dbg(lvl_info,"%s\n",wi->name); + dbg(lvl_info,"%s",wi->name); it=map_rect_create_item(mr,type_found_item); if(it) { struct coord c; @@ -1132,7 +1132,7 @@ gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct pc=*pc_in; c.x=pc.x; c.y=pc.y; - dbg(lvl_info,"x=0x%x y=0x%x\n", c.x, c.y); + dbg(lvl_info,"x=0x%x y=0x%x", c.x, c.y); transform_to_geo(pc.pro, &c, &g); } else if (g_in) { struct attr attr; @@ -1576,7 +1576,7 @@ gui_internal_cmd_bookmarks(struct gui_priv *this, struct widget *wm, void *data) while ((item=bookmarks_get_item(mattr.u.bookmarks))) { if (!item_attr_get(item, attr_label, &attr)) continue; label_full=map_convert_string_tmp(item->map,attr.u.str); - dbg(lvl_info,"full_labled: %s\n",label_full); + dbg(lvl_info,"full_labled: %s",label_full); // hassub == 1 if the item type is a sub-folder if (item->type == type_bookmark_folder) { @@ -1658,7 +1658,7 @@ gui_internal_keypress_do(struct gui_priv *this, char *key) } return; } else if (*key == NAVIT_KEY_BACKSPACE) { - dbg(lvl_debug,"backspace\n"); + dbg(lvl_debug,"backspace"); if (wi->text && wi->text[0]) { len=g_utf8_prev_char(wi->text+strlen(wi->text))-wi->text; wi->text[len]='\0'; @@ -1666,11 +1666,11 @@ gui_internal_keypress_do(struct gui_priv *this, char *key) } } else { if (wi->state & STATE_CLEAR) { - dbg(lvl_info,"wi->state=0x%x\n", wi->state); + dbg(lvl_info,"wi->state=0x%x", wi->state); g_free(wi->text); wi->text=NULL; wi->state &= ~STATE_CLEAR; - dbg(lvl_info,"wi->state=0x%x\n", wi->state); + dbg(lvl_info,"wi->state=0x%x", wi->state); } text=g_strdup_printf("%s%s", wi->text ? wi->text : "", key); @@ -1760,7 +1760,7 @@ gui_internal_set(char *remove, char *add) int len=strlen(line); if (len > 0 && line[len-1] == '\n') line[len-1]='\0'; - dbg(lvl_debug,"line=%s\n",line); + dbg(lvl_debug,"line=%s",line); if (!gui_internal_match(remove, line)) fprintf(fo,"%s\n",line); } @@ -1819,12 +1819,12 @@ gui_internal_cmd_map_download_do(struct gui_priv *this, struct widget *wm, void sel.range.max=type_last; mr=map_rect_new(map, &sel); while ((item=map_rect_get_item(mr))) { - dbg(lvl_info,"item\n"); + dbg(lvl_info,"item"); } map_rect_destroy(mr); } - dbg(lvl_info,"bbox=%s\n",wm->prefix); + dbg(lvl_info,"bbox=%s",wm->prefix); gui_internal_menu_render(this); } @@ -1838,7 +1838,7 @@ gui_internal_cmd_map_download(struct gui_priv *this, struct widget *wm, void *da char *search,buffer[256]; int found,sp_match=0; - dbg(lvl_debug,"wm=%p prefix=%s\n",wm,wm->prefix); + dbg(lvl_debug,"wm=%p prefix=%s",wm,wm->prefix); search=wm->prefix; if (search) { @@ -2048,14 +2048,14 @@ gui_internal_cmd_set_active_profile(struct gui_priv *this, struct vehicle_get_attr(v, attr_name, &vehicle_name_attr, NULL); vehicle_name = vehicle_name_attr.u.str; - dbg(lvl_debug, "Changing vehicle %s to profile %s\n", vehicle_name, + dbg(lvl_debug, "Changing vehicle %s to profile %s", vehicle_name, profilename); // Change the profile name profilename_attr.type = attr_profilename; profilename_attr.u.str = profilename; if(!vehicle_set_attr(v, &profilename_attr)) { - dbg(lvl_error, "Unable to set the vehicle's profile name\n"); + dbg(lvl_error, "Unable to set the vehicle's profile name"); } navit_set_vehicleprofile_name(this->nav,profilename); @@ -2115,7 +2115,7 @@ gui_internal_add_vehicle_profile(struct gui_priv *this, struct widget active_profile = profile_attr.u.str; active = active_profile != NULL && !strcmp(name, active_profile); - dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i\n", name, + dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i", name, active_profile, active); // Build a translatable label. @@ -2262,7 +2262,7 @@ gui_internal_set_click_coord(struct gui_priv *this, struct point *p) if (p) { trans=navit_get_trans(this->nav); transform_reverse(trans, p, &c); - dbg(lvl_debug,"x=0x%x y=0x%x\n", c.x, c.y); + dbg(lvl_debug,"x=0x%x y=0x%x", c.x, c.y); this->clickp.pro=transform_get_projection(trans); this->clickp.x=c.x; this->clickp.y=c.y; @@ -2303,7 +2303,7 @@ gui_internal_enter_setup(struct gui_priv *this) void gui_internal_cmd_menu(struct gui_priv *this, int ignore, char *href) { - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); gui_internal_enter(this, ignore); gui_internal_enter_setup(this); // draw menu @@ -2423,7 +2423,7 @@ gui_internal_set_attr(struct gui_priv *this, struct attr *attr) this->on_map_click=g_strdup(attr->u.str); return 1; default: - dbg(lvl_error,"Unknown attribute: %s\n",attr_to_name(attr->type)); + dbg(lvl_error,"Unknown attribute: %s",attr_to_name(attr->type)); return 1; } } @@ -2491,7 +2491,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x) sscanf(degree, "%lf", x); if(strchr(degree, plus) || strchr(degree, minus)) { - dbg(lvl_debug,"degree %c/%c found\n",plus,minus); + dbg(lvl_debug,"degree %c/%c found",plus,minus); } else {/* DEGREES_MINUTES */ if(!minute) return 0; @@ -2499,7 +2499,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x) sscanf(minute, "%lf", &tmp); *x+=tmp/60; if(strchr(minute, plus) || strchr(minute, minus)) { - dbg(lvl_debug,"minute %c/%c found\n",plus,minus); + dbg(lvl_debug,"minute %c/%c found",plus,minus); } else { /* DEGREES_MINUTES_SECONDS */ second=strtok(NULL,""); if(!second) @@ -2523,7 +2523,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget) char *lat, *lng; char *widgettext; double latitude, longitude; - dbg(lvl_debug,"text entered:%s\n", widget->text); + dbg(lvl_debug,"text entered:%s", widget->text); /* possible entry can be identical to coord_format output but only space between lat and lng is allowed */ widgettext=g_ascii_strup(widget->text,-1); @@ -2556,7 +2556,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget) void gui_internal_cmd_enter_coord_clicked(struct gui_priv *this, struct widget *widget, void *data) { - dbg(lvl_debug,"entered\n"); + dbg(lvl_debug,"entered"); gui_internal_cmd_enter_coord_do(this, widget->data); } @@ -2570,18 +2570,18 @@ static void gui_internal_button(void *data, int pressed, int button, struct poin struct gui_priv *this=data; struct graphics *gra=this->gra; - dbg(lvl_debug,"enter %d %d\n", pressed, button); + dbg(lvl_debug,"enter %d %d", pressed, button); // if still on the map (not in the menu, yet): - dbg(lvl_debug,"children=%p ignore_button=%d\n",this->root.children,this->ignore_button); + dbg(lvl_debug,"children=%p ignore_button=%d",this->root.children,this->ignore_button); if (!this->root.children || this->ignore_button) { this->ignore_button=0; // check whether the position of the mouse changed during press/release OR if it is the scrollwheel if (!navit_handle_button(this->nav, pressed, button, p, NULL)) { - dbg(lvl_debug,"navit has handled button\n"); + dbg(lvl_debug,"navit has handled button"); return; } - dbg(lvl_debug,"menu_on_map_click=%d\n",this->menu_on_map_click); + dbg(lvl_debug,"menu_on_map_click=%d",this->menu_on_map_click); if (button != 1) return; if (this->on_map_click || this->menu_on_map_click) { @@ -2688,7 +2688,7 @@ static void gui_internal_resize(void *data, int w, int h) */ if (!changed && this->gra && graphics_get_data(this->gra, "padding")) changed = 1; - dbg(lvl_debug,"w=%d h=%d children=%p\n", w, h, this->root.children); + dbg(lvl_debug,"w=%d h=%d children=%p", w, h, this->root.children); navit_handle_resize(this->nav, w, h); if (this->root.children) { if (changed) { @@ -2805,7 +2805,7 @@ gui_internal_keynav_find_closest(struct widget *wi, struct point *p, int dx, int if (dist1 < 0) dist1=-dist1; } - dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d\n", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2); + dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2); if (dist1 >= 0) { if (dist2 < 0) dist1-=dist2; @@ -2855,7 +2855,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro gui_internal_keynav_find_closest(menu, &p, 0, 0, &distance, &result); if (result) { gui_internal_keynav_point(result, dx, dy, &p); - dbg(lvl_debug,"result origin=%p p=%d,%d\n", result, p.x, p.y); + dbg(lvl_debug,"result origin=%p p=%d,%d", result, p.x, p.y); current_highlight = result; } } @@ -2867,7 +2867,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro gui_internal_keynav_find_prev(menu, current_highlight, &result); else gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result); - dbg(lvl_debug,"result=%p\n", result); + dbg(lvl_debug,"result=%p", result); if (! result) { if (dx < 0) { p.x=this->root.w; @@ -2884,7 +2884,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro result=NULL; distance=INT_MAX; gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result); - dbg(lvl_debug,"wraparound result=%p\n", result); + dbg(lvl_debug,"wraparound result=%p", result); } gui_internal_highlight_do(this, result); if (result) @@ -2992,7 +2992,7 @@ static int gui_internal_set_graphics(struct gui_priv *this, struct graphics *gra win=graphics_get_data(gra, "window"); if (! win) { - dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n"); + dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics"); return 1; } navit_ignore_graphics_events(this->nav, 1); @@ -3156,10 +3156,10 @@ line_intersection(struct coord* a1, struct coord *a2, struct coord * b1, struct if (a > n || b > n) return FALSE; if (n == 0) { - dbg(lvl_info,"a=%d b=%d n=%d\n", a, b, n); - dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d\n", a1->x, a1->y, adx, ady); - dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d\n", b1->x, b1->y, bdx, bdy); - dbg(lvl_info,"No intersection found, lines assumed parallel ?\n"); + dbg(lvl_info,"a=%d b=%d n=%d", a, b, n); + dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d", a1->x, a1->y, adx, ady); + dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d", b1->x, b1->y, bdx, bdy); + dbg(lvl_info,"No intersection found, lines assumed parallel ?"); return FALSE; } res->x = a1->x + a * adx / n; diff --git a/navit/gui/internal/gui_internal_bookmark.c b/navit/gui/internal/gui_internal_bookmark.c index eed0de123..7ae4df68e 100644 --- a/navit/gui/internal/gui_internal_bookmark.c +++ b/navit/gui/internal/gui_internal_bookmark.c @@ -21,7 +21,7 @@ gui_internal_cmd_add_bookmark_do(struct gui_priv *this, struct widget *widget) { GList *l; struct attr attr; - dbg(lvl_debug,"text='%s'\n", widget->text); + dbg(lvl_debug,"text='%s'", widget->text); if (widget->text && strlen(widget->text)){ navit_get_attr(this->nav, attr_bookmarks, &attr, NULL); bookmarks_add_bookmark(attr.u.bookmarks, &widget->c, widget->text); @@ -37,7 +37,7 @@ gui_internal_cmd_add_bookmark_folder_do(struct gui_priv *this, struct widget *wi { GList *l; struct attr attr; - dbg(lvl_debug,"text='%s'\n", widget->text); + dbg(lvl_debug,"text='%s'", widget->text); if (widget->text && strlen(widget->text)){ navit_get_attr(this->nav, attr_bookmarks, &attr, NULL); bookmarks_add_bookmark(attr.u.bookmarks, NULL, widget->text); @@ -66,7 +66,7 @@ gui_internal_cmd_rename_bookmark_clicked(struct gui_priv *this, struct widget *w struct widget *w=(struct widget*)widget->data; GList *l; struct attr attr; - dbg(lvl_debug,"text='%s'\n", w->text); + dbg(lvl_debug,"text='%s'", w->text); if (w->text && strlen(w->text)){ navit_get_attr(this->nav, attr_bookmarks, &attr, NULL); bookmarks_rename_bookmark(attr.u.bookmarks, w->name, w->text); diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c index 1eb1163cb..19f0550dc 100644 --- a/navit/gui/internal/gui_internal_command.c +++ b/navit/gui/internal/gui_internal_command.c @@ -161,11 +161,11 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in, { struct attr escaped; if (!in || !in[0]) { - dbg(lvl_error,"first parameter missing or wrong type\n"); + dbg(lvl_error,"first parameter missing or wrong type"); return; } if (!out) { - dbg(lvl_error,"output missing\n"); + dbg(lvl_error,"output missing"); return; } if (ATTR_IS_STRING(in[0]->type)) { @@ -175,10 +175,10 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in, escaped.type=attr_type_string_begin; escaped.u.str=g_strdup_printf("%ld",in[0]->u.num); } else { - dbg(lvl_error,"first parameter wrong type\n"); + dbg(lvl_error,"first parameter wrong type"); return; } - dbg(lvl_debug,"in %s result %s\n",in[0]->u.str,escaped.u.str); + dbg(lvl_debug,"in %s result %s",in[0]->u.str,escaped.u.str); *out=attr_generic_add_attr(*out, attr_dup(&escaped)); g_free(escaped.u.str); } @@ -515,14 +515,14 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st while ((map=mapset_next(msh, 1))) { struct attr data_attr; if (map_get_attr(map, attr_data, &data_attr, NULL)){ - dbg(lvl_debug,"map name = %s\n",data_attr.u.str); + dbg(lvl_debug,"map name = %s",data_attr.u.str); if (strstr(data_attr.u.str,".heightlines.bin")){ - dbg(lvl_info,"reading heightlines from map %s\n",data_attr.u.str); + dbg(lvl_info,"reading heightlines from map %s",data_attr.u.str); mr=map_rect_new(map, &sel); heightmap_installed = TRUE; } else { - dbg(lvl_debug,"ignoring map %s\n",data_attr.u.str); + dbg(lvl_debug,"ignoring map %s",data_attr.u.str); } } if (mr) { @@ -580,7 +580,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st diagram_point->next=diagram_points; diagram_points=diagram_point; diagram_points_count ++; - dbg(lvl_debug,"%d %d\n", diagram_point->c.x, diagram_point->c.y); + dbg(lvl_debug,"%d %d", diagram_point->c.x, diagram_point->c.y); max_ele=MAX(max_ele, diagram_point->c.y); min_ele=MIN(min_ele, diagram_point->c.y); distance=diagram_point->c.x; @@ -629,12 +629,12 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st coord_rect_extend(&dbbox, &diagram_point->c); diagram_point=diagram_point->next; } - dbg(lvl_debug,"%d %d %d %d\n", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y); + dbg(lvl_debug,"%d %d %d %d", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y); if (dbbox.rl.x > dbbox.lu.x && dbbox.lu.x*100/(dbbox.rl.x-dbbox.lu.x) <= 25) dbbox.lu.x=0; if (dbbox.lu.y > dbbox.rl.y && dbbox.rl.y*100/(dbbox.lu.y-dbbox.rl.y) <= 25) dbbox.rl.y=0; - dbg(lvl_debug,"%d,%d %dx%d\n", box->p.x, box->p.y, box->w, box->h); + dbg(lvl_debug,"%d,%d %dx%d", box->p.x, box->p.y, box->w, box->h); x=dbbox.lu.x; first=1; if (diagram_points_count > 1 && dbbox.rl.x != dbbox.lu.x && dbbox.lu.y != dbbox.rl.y){ @@ -650,7 +650,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st break; p[1].x=(min->c.x-dbbox.lu.x)*(box->w-10)/(dbbox.rl.x-dbbox.lu.x)+box->p.x+5; p[1].y=(box->h)-5-(min->c.y-dbbox.rl.y)*(box->h-10)/(dbbox.lu.y-dbbox.rl.y)+box->p.y; - dbg(lvl_debug,"%d,%d=%d,%d\n",min->c.x, min->c.y, p[1].x,p[1].y); + dbg(lvl_debug,"%d,%d=%d,%d",min->c.x, min->c.y, p[1].x,p[1].y); graphics_draw_circle(this->gra, this->foreground, &p[1], 2); if (first) first=0; @@ -726,7 +726,7 @@ gui_internal_cmd2_pois(struct gui_priv *this, char *function, struct attr **in, struct attr pro; struct coord c; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); if (!in || !in[0]) return; if (!ATTR_IS_COORD_GEO(in[0]->type)) @@ -843,7 +843,7 @@ gui_internal_cmd2_network_info(struct gui_priv *this, char *function, struct att gui_internal_menu_render(this); graphics_draw_mode(this->gra, draw_mode_end); #else - dbg(lvl_error, "Cannot show network info: ifaddr.h not found\n"); + dbg(lvl_error, "Cannot show network info: ifaddr.h not found"); #endif } @@ -1019,7 +1019,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr ** const char *name=_("Position"); int flags=-1; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); if (!in || !in[0]) return; if (!ATTR_IS_COORD_GEO(in[0]->type)) @@ -1029,7 +1029,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr ** if (in[2] && ATTR_IS_INT(in[2]->type)) flags=in[2]->u.num; } - dbg(lvl_debug,"flags=0x%x\n",flags); + dbg(lvl_debug,"flags=0x%x",flags); gui_internal_cmd_position_do(this, NULL, in[0]->u.coord_geo, NULL, name, flags); } @@ -1052,14 +1052,14 @@ gui_internal_cmd2_set(struct gui_priv *this, char *function, struct attr **in, s { char *pattern,*command=NULL; if (!in || !in[0] || !ATTR_IS_STRING(in[0]->type)) { - dbg(lvl_error,"first parameter missing or wrong type\n"); + dbg(lvl_error,"first parameter missing or wrong type"); return; } pattern=in[0]->u.str; - dbg(lvl_debug,"pattern %s\n",pattern); + dbg(lvl_debug,"pattern %s",pattern); if (in[1]) { command=gui_internal_cmd_match_expand(pattern, in+1); - dbg(lvl_debug,"expand %s\n",command); + dbg(lvl_debug,"expand %s",command); gui_internal_set(pattern, command); command_evaluate(&this->self, command); g_free(command); @@ -1103,7 +1103,7 @@ static void gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid) { char *str=NULL; - dbg(lvl_debug,"enter %s %p %p %p\n",function,in,out,valid); + dbg(lvl_debug,"enter %s %p %p %p",function,in,out,valid); if (!in) return; while (*in) { @@ -1113,7 +1113,7 @@ gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in, if (str) { str=g_strdup_printf("<html>%s</html>\n",str); #if 0 - dbg(lvl_debug,"%s\n",str); + dbg(lvl_debug,"%s",str); #endif gui_internal_html_parse_text(this, str); } @@ -1136,11 +1136,11 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set) char format[4],*end=strchr(c+2,'}'),*replacement=NULL,*new_str; int is_arg; if (!end) { - dbg(lvl_error,"Missing closing brace in format string %s\n",c); + dbg(lvl_error,"Missing closing brace in format string %s",c); goto error; } if (end-c > sizeof(format)) { - dbg(lvl_error,"Invalid format string %s\n",c); + dbg(lvl_error,"Invalid format string %s",c); goto error; } strncpy(format, c+2, end-c-2); @@ -1167,7 +1167,7 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set) } } if (!replacement) { - dbg(lvl_error,"Unsupported format string %s\n",format); + dbg(lvl_error,"Unsupported format string %s",format); goto error; } new_str=g_strconcat(str, replacement, end+1, NULL); @@ -1210,7 +1210,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s str=gui_internal_append_attr(str, escape_mode_string|escape_mode_html, " class=", *in, ""); in++; } else { - dbg(lvl_error,"argument error: class argument not string\n"); + dbg(lvl_error,"argument error: class argument not string"); goto error; } if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) { @@ -1219,7 +1219,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s } in++; } else { - dbg(lvl_error,"argument error: image argument not string\n"); + dbg(lvl_error,"argument error: image argument not string"); goto error; } if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) { @@ -1230,7 +1230,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s } in++; } else { - dbg(lvl_error,"argument error: text argument not string\n"); + dbg(lvl_error,"argument error: text argument not string"); goto error; } gui_internal_onclick(&in,&onclick,NULL); @@ -1256,16 +1256,16 @@ static void gui_internal_cmd_debug(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid) { char *str; - dbg(lvl_debug,"begin\n"); + dbg(lvl_debug,"begin"); if (in) { while (*in) { str=attr_to_text(*in, NULL, 0); - dbg(lvl_debug,"%s:%s\n",attr_to_name((*in)->type),str); + dbg(lvl_debug,"%s:%s",attr_to_name((*in)->type),str); in++; g_free(str); } } - dbg(lvl_debug,"done\n"); + dbg(lvl_debug,"done"); } static void diff --git a/navit/gui/internal/gui_internal_gesture.c b/navit/gui/internal/gui_internal_gesture.c index d01a80f1d..3ab0ec46b 100644 --- a/navit/gui/internal/gui_internal_gesture.c +++ b/navit/gui/internal/gui_internal_gesture.c @@ -61,7 +61,7 @@ gui_internal_gesture_ring_add(struct gui_priv *this, struct point *p) } this->gesture_ring[this->gesture_ring_last].p=*p; this->gesture_ring[this->gesture_ring_last].msec=msec; - dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d\n",msec,p->x,p->y); + dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d",msec,p->x,p->y); }; int @@ -89,7 +89,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po *p0=g->p; } msec=g->msec; - dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y); + dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y); for(i=1;(g=gui_internal_gesture_ring_get(this,i))!=NULL;i++) { if( msec-g->msec > 1000 ) break; @@ -99,7 +99,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po if(p0) { *p0=g->p; } - dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y); + dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y); } return dt; } @@ -114,7 +114,7 @@ gui_internal_gesture_do(struct gui_priv *this) if( abs(dx) > this->icon_s*3 && abs(dy) < this->icon_s ) { struct widget *wt; - dbg(lvl_debug,"horizontal dx=%d dy=%d\n",dx,dy); + dbg(lvl_debug,"horizontal dx=%d dy=%d",dx,dy); /* Prevent swiping if widget was scrolled beforehand */ if(this->pressed==2) @@ -133,11 +133,11 @@ gui_internal_gesture_do(struct gui_priv *this) gui_internal_table_button_prev(this,NULL,wt); return 1; } else if( abs(dy) > this->icon_s*3 && abs(dx) < this->icon_s ) { - dbg(lvl_debug,"vertical dx=%d dy=%d\n",dx,dy); + dbg(lvl_debug,"vertical dx=%d dy=%d",dx,dy); } else if (dt>300 && abs(dx) <this->icon_s && abs(dy) <this->icon_s ) { - dbg(lvl_debug,"longtap dx=%d dy=%d\n",dx,dy); + dbg(lvl_debug,"longtap dx=%d dy=%d",dx,dy); } else { - dbg(lvl_debug,"none dx=%d dy=%d\n",dx,dy); + dbg(lvl_debug,"none dx=%d dy=%d",dx,dy); } return 0; diff --git a/navit/gui/internal/gui_internal_html.c b/navit/gui/internal/gui_internal_html.c index 9b42fbdec..7035920a0 100644 --- a/navit/gui/internal/gui_internal_html.c +++ b/navit/gui/internal/gui_internal_html.c @@ -96,7 +96,7 @@ gui_internal_html_submit(struct gui_priv *this, struct widget *w, void *data) struct widget *menu; GList *l; - dbg(lvl_debug,"enter form %p %s\n",w->form,w->form->onsubmit); + dbg(lvl_debug,"enter form %p %s",w->form,w->form->onsubmit); l=g_list_last(this->root.children); menu=l->data; graphics_draw_mode(this->gra, draw_mode_begin); @@ -113,7 +113,7 @@ gui_internal_html_load_href(struct gui_priv *this, char *href, int replace) if (replace) gui_internal_prune_menu_count(this, 1, 0); if (href && href[0] == '#') { - dbg(lvl_debug,"href=%s\n",href); + dbg(lvl_debug,"href=%s",href); g_free(this->href); this->href=g_strdup(href); gui_internal_html_menu(this, this->html_text, href+1); @@ -376,22 +376,22 @@ gui_internal_refresh_callback_called(struct gui_priv *this, struct menu_data *me static void gui_internal_set_refresh_callback(struct gui_priv *this, char *cond) { - dbg(lvl_info,"cond=%s\n",cond); + dbg(lvl_info,"cond=%s",cond); if (cond) { enum attr_type type; struct object_func *func; struct menu_data *menu_data=gui_internal_menu_data(this); - dbg(lvl_info,"navit=%p\n",this->nav); + dbg(lvl_info,"navit=%p",this->nav); type=command_evaluate_to_attr(&this->self, cond, NULL, &menu_data->refresh_callback_obj); if (type == attr_none) { - dbg(lvl_error,"can't get type of '%s'\n",cond); + dbg(lvl_error,"can't get type of '%s'",cond); return; } func=object_func_lookup(menu_data->refresh_callback_obj.type); if (!func) - dbg(lvl_error,"'%s' has no functions\n",cond); + dbg(lvl_error,"'%s' has no functions",cond); if (func && !func->add_attr) - dbg(lvl_error,"'%s' has no add_attr function\n",cond); + dbg(lvl_error,"'%s' has no add_attr function",cond); if (!func || !func->add_attr) return; menu_data->refresh_callback.type=attr_callback; @@ -461,7 +461,7 @@ gui_internal_html_text(xml_context *dummy, const char *text, gsize len, void *da } break; case html_tag_script: - dbg(lvl_debug,"execute %s\n",text_stripped); + dbg(lvl_debug,"execute %s",text_stripped); gui_internal_evaluate(this,text_stripped); break; default: diff --git a/navit/gui/internal/gui_internal_keyboard.c b/navit/gui/internal/gui_internal_keyboard.c index 7ef1c3d36..93480eb87 100644 --- a/navit/gui/internal/gui_internal_keyboard.c +++ b/navit/gui/internal/gui_internal_keyboard.c @@ -488,7 +488,7 @@ static void gui_internal_keyboard_hide_native(struct gui_priv *this_, struct wid g_free(kbd->lang); g_free(kbd->gui_priv); } else - dbg(lvl_warning, "no graphics_keyboard found, cleanup failed\n"); + dbg(lvl_warning, "no graphics_keyboard found, cleanup failed"); g_free(w); } @@ -531,7 +531,7 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct switch(res) { case -1: - dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard\n"); + dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard"); /* no break */ case 0: g_free(kbd); @@ -552,9 +552,9 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct ret->wmin = w->wmin; } else ret->w = kbd->w; - dbg(lvl_error, "ret->w=%d, ret->h=%d\n", ret->w, ret->h); + dbg(lvl_error, "ret->w=%d, ret->h=%d", ret->w, ret->h); ret->data = (void *) kbd; gui_internal_widget_append(w, ret); - dbg(lvl_error, "return\n"); + dbg(lvl_error, "return"); return ret; } diff --git a/navit/gui/internal/gui_internal_menu.c b/navit/gui/internal/gui_internal_menu.c index 33def9983..67da9c939 100644 --- a/navit/gui/internal/gui_internal_menu.c +++ b/navit/gui/internal/gui_internal_menu.c @@ -115,7 +115,7 @@ gui_internal_menu(struct gui_priv *this, const char *label) if (this->gra) { padding = graphics_get_data(this->gra, "padding"); } else - dbg(lvl_warning, "cannot get padding: this->gra is NULL\n"); + dbg(lvl_warning, "cannot get padding: this->gra is NULL"); gui_internal_search_idle_end(this); topbox=gui_internal_box_new_with_label(this, 0, label); @@ -149,7 +149,7 @@ gui_internal_menu(struct gui_priv *this, const char *label) struct widget *wlb,*wb,*wm=w; wm->flags=gravity_center|orientation_vertical|flags_expand|flags_fill; w=gui_internal_box_new(this, gravity_center|orientation_horizontal|flags_expand|flags_fill); - dbg(lvl_info,"topbox->menu_data=%p\n", topbox->menu_data); + dbg(lvl_info,"topbox->menu_data=%p", topbox->menu_data); gui_internal_widget_append(wm, w); wb=gui_internal_box_new(this, gravity_right_center|orientation_horizontal|flags_fill); wb->bl=6; @@ -309,7 +309,7 @@ gui_internal_top_bar(struct gui_priv *this) use_sep=1; else use_sep=0; - dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d\n", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width); + dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width); if (wcn->w + width_used + w->spx + (use_sep ? sep_len : 0) + (g_list_previous(l) ? dots_len : 0) > width) { incomplete=1; gui_internal_widget_destroy(this, wcn); diff --git a/navit/gui/internal/gui_internal_poi.c b/navit/gui/internal/gui_internal_poi.c index cb31ecc95..0b904c1d2 100644 --- a/navit/gui/internal/gui_internal_poi.c +++ b/navit/gui/internal/gui_internal_poi.c @@ -125,7 +125,7 @@ gui_internal_poi_icon(struct gui_priv *this, struct item *item) icon=g_strdup(el->u.icon.src); } char *dot=g_strrstr(icon,"."); - dbg(lvl_debug,"%s %s\n", item_to_name(item->type),icon); + dbg(lvl_debug,"%s %s", item_to_name(item->type),icon); if(dot) *dot=0; img=image_new_xs(this,icon); @@ -601,7 +601,7 @@ dbg(lvl_debug,"POIs..."); items= g_new0( struct item_data, maxitem); - dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d\n", + dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d", param->sel, param->selnb, param->pagenb, param->dist, param->filterstr, param->AddressFilterType); wb=gui_internal_menu(this, isel ? isel->name : _("POIs")); @@ -619,7 +619,7 @@ dbg(lvl_debug,"POIs..."); while ((m=mapset_next(h, 1))) { selm=map_selection_dup_pro(sel, pro, map_projection(m)); mr=map_rect_new(m, selm); - dbg(lvl_debug,"mr=%p\n", mr); + dbg(lvl_debug,"mr=%p", mr); if (mr) { while ((item=map_rect_get_item(mr))) { if (gui_internal_cmd_pois_item_selected(param, item) && @@ -690,10 +690,10 @@ dbg(lvl_debug,"POIs..."); struct item_data *data = fh_extractmin(fh); if (data == NULL) { - dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i\n", maxitem, it, dist); + dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i", maxitem, it, dist); break; } - dbg(lvl_debug, "dist1: %i, dist2: %i\n", data->dist, (-key)>>10); + dbg(lvl_debug, "dist1: %i, dist2: %i", data->dist, (-key)>>10); if(i==(it-pagesize*pagenb) && data->dist>prevdist) prevdist=data->dist; wi=gui_internal_cmd_pois_item(this, ¢er, &data->item, &data->c, route.u.route, data->dist, data->label); @@ -772,13 +772,13 @@ dbg(lvl_debug,"POIs..."); while(firstrow>=0) { int currow=g_list_index(wtable->children, td->bottom_row->data) - firstrow; if(currow<0) { - dbg(lvl_debug,"Can't find bottom row in children list. Stop paging.\n"); + dbg(lvl_debug,"Can't find bottom row in children list. Stop paging."); break; } if(currow>=param->count) break; if(!(td->scroll_buttons.next_button->state & STATE_SENSITIVE)) { - dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.\n",param->count); + dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.",param->count); break; } gui_internal_table_button_next(this, td->scroll_buttons.next_button, NULL); diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c index ceeeb7438..54fd55a57 100644 --- a/navit/gui/internal/gui_internal_search.c +++ b/navit/gui/internal/gui_internal_search.c @@ -87,7 +87,7 @@ gui_internal_search_cmp(gconstpointer _a, gconstpointer _b) sa=removecase(a->text); sb=removecase(b->text); r=strcmp(sa,sb); - dbg(lvl_debug,"%s %s %d\n",sa,sb,r); + dbg(lvl_debug,"%s %s %d",sa,sb,r); g_free(sa); g_free(sb); return r; @@ -210,7 +210,7 @@ gui_internal_find_next_possible_key(char *search_text, char *wm_name, char *poss possible_keys[len]=trunk_name[next_char_pos]; possible_keys[len+1]='\0'; } - dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s \n", search_text, item_name, possible_keys); + dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s ", search_text, item_name, possible_keys); } } } @@ -290,7 +290,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_ if(!exp) continue; if(!strcmp(exp,folded_query)) { - dbg(lvl_debug,"exact match for the whole string %s\n", exp); + dbg(lvl_debug,"exact match for the whole string %s", exp); match_quality=full_string_match; g_free(exp); break; @@ -298,7 +298,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_ if((p=strstr(exp,folded_query))!=NULL) { p+=strlen(folded_query); if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) { - dbg(lvl_debug,"exact matching word found inside string %s\n",exp); + dbg(lvl_debug,"exact matching word found inside string %s",exp); match_quality=word_match; } } @@ -385,7 +385,7 @@ gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *se widget_name=g_strdup(result_main_label); } if(!item_name) { - dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.\n", wm_name); + dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.", wm_name); return; } @@ -444,13 +444,13 @@ gui_internal_search_changed(struct gui_priv *this, struct widget *wm, void *data param=(void *)5; if (! strcmp(wm->name,"House number")) param=(void *)6; - dbg(lvl_debug,"%s now '%s'\n", wm->name, wm->text); + dbg(lvl_debug,"%s now '%s'", wm->name, wm->text); gui_internal_search_idle_end(this); if (wm->text && g_utf8_strlen(wm->text, -1) > 0) { struct attr search_attr; - dbg(lvl_debug,"process\n"); + dbg(lvl_debug,"process"); if (! strcmp(wm->name,"Country")) search_attr.type=attr_country_all; if (! strcmp(wm->name,"Town")) @@ -488,7 +488,7 @@ gui_internal_search_list_set_default_country(struct gui_priv *this) item=country_search_get_item(cs); if (item && item_attr_get(item, attr_country_name, &country_name)) { search_attr.type=attr_country_all; - dbg(lvl_debug,"country %s\n", country_name.u.str); + dbg(lvl_debug,"country %s", country_name.u.str); search_attr.u.str=country_name.u.str; search_list_search(this->sl, &search_attr, 0); while((res=search_list_get_result(this->sl))); @@ -501,9 +501,9 @@ gui_internal_search_list_set_default_country(struct gui_priv *this) } country_search_destroy(cs); } else { - dbg(lvl_error,"warning: no default country found\n"); + dbg(lvl_error,"warning: no default country found"); if (this->country_iso2) { - dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2); + dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2); search_attr.type=attr_country_iso2; search_attr.u.str=this->country_iso2; search_list_search(this->sl, &search_attr, 0); @@ -604,7 +604,7 @@ gui_internal_search(struct gui_priv *this, const char *what, const char *type, i void gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget *widget, void *data) { - dbg(lvl_info,"id %d\n", widget->selection_id); + dbg(lvl_info,"id %d", widget->selection_id); search_list_select(this->sl, attr_street_name, 0, 0); search_list_select(this->sl, attr_street_name, widget->selection_id, 1); gui_internal_search(this,_("House number"),"House number",0); @@ -613,7 +613,7 @@ gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget void gui_internal_search_street_in_town(struct gui_priv *this, struct widget *widget, void *data) { - dbg(lvl_info,"id %d\n", widget->selection_id); + dbg(lvl_info,"id %d", widget->selection_id); search_list_select(this->sl, attr_town_or_district_name, 0, 0); search_list_select(this->sl, attr_town_or_district_name, widget->selection_id, 1); gui_internal_search(this,_("Street"),"Street",0); @@ -623,7 +623,7 @@ void gui_internal_search_town_in_country(struct gui_priv *this, struct widget *widget) { struct search_list_common *slc; - dbg(lvl_info,"id %d\n", widget->selection_id); + dbg(lvl_info,"id %d", widget->selection_id); search_list_select(this->sl, attr_country_all, 0, 0); slc=search_list_select(this->sl, attr_country_all, widget->selection_id, 1); if (slc) { diff --git a/navit/gui/internal/gui_internal_widget.c b/navit/gui/internal/gui_internal_widget.c index 3e1993025..98b690578 100644 --- a/navit/gui/internal/gui_internal_widget.c +++ b/navit/gui/internal/gui_internal_widget.c @@ -260,7 +260,7 @@ gui_internal_highlight_do(struct gui_priv *this, struct widget *found) this->highlighted_menu=g_list_last(this->root.children)->data; this->highlighted->state |= STATE_HIGHLIGHTED; gui_internal_widget_render(this, this->highlighted); - dbg(lvl_debug,"%d,%d %dx%d\n", found->p.x, found->p.y, found->w, found->h); + dbg(lvl_debug,"%d,%d %dx%d", found->p.x, found->p.y, found->w, found->h); } graphics_draw_mode(this->gra, draw_mode_end); } @@ -603,7 +603,7 @@ static void gui_internal_box_pack(struct gui_priv *this, struct widget *w) w->scroll_buttons->button_box->p.x=w->p.x; w->scroll_buttons->button_box->p.y=w->p.y+w->h-w->scroll_buttons->button_box->h; gui_internal_widget_pack(this, w->scroll_buttons->button_box); - dbg(lvl_debug,"needs buttons %d vs %d\n",y,w->h); + dbg(lvl_debug,"needs buttons %d vs %d",y,w->h); gui_internal_box_pack(this, w); return; } diff --git a/navit/gui/qml/bookmarksProxy.h b/navit/gui/qml/bookmarksProxy.h index 03cbcbc88..de48898a0 100644 --- a/navit/gui/qml/bookmarksProxy.h +++ b/navit/gui/qml/bookmarksProxy.h @@ -72,7 +72,7 @@ public slots: entries.appendChild(entry); } - dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData()); + dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData()); return retDoc.toString(); } QString AddFolder(QString description) { @@ -144,7 +144,7 @@ public slots: if (!item_attr_get(item, attr_label, &attr)) continue; label=QString::fromLocal8Bit(attr.u.str); - dbg(lvl_debug,"Bookmark is %s\n",bookmark.toStdString().c_str()); + dbg(lvl_debug,"Bookmark is %s",bookmark.toStdString().c_str()); if (label.compare(bookmark)) continue; item_coord_get(item, &c, 1); if (this->object->currentPoint!=NULL) { diff --git a/navit/gui/qml/gui_qml.cpp b/navit/gui/qml/gui_qml.cpp index 3efc719dd..456c5d0be 100644 --- a/navit/gui/qml/gui_qml.cpp +++ b/navit/gui/qml/gui_qml.cpp @@ -161,11 +161,11 @@ static void gui_qml_button(void *data, int pressed, int button, struct point *p) // check whether the position of the mouse changed during press/release OR if it is the scrollwheel if (!navit_handle_button(this_->nav, pressed, button, p, NULL)) { - dbg(lvl_debug,"navit has handled button\n"); + dbg(lvl_debug,"navit has handled button"); return; } - dbg(lvl_debug,"enter %d %d\n", pressed, button); + dbg(lvl_debug,"enter %d %d", pressed, button); if (this_->signal_on_map_click) { gui_qml_dbus_signal(this_, p); return; @@ -278,7 +278,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra) if (xid.length()>0) { _mainWindow->embedInto(xid.toULong(&ok,0)); }else{ - dbg(lvl_error, "\nFATAL: Environment variable NAVIT_XID not set.\n" + dbg(lvl_error, "FATAL: Environment variable NAVIT_XID not set." " Please set NAVIT_XID to the window ID of the window to embed into.\n"); exit(1); } @@ -322,7 +322,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra) QString mainQml = QString(this_->source)+"/"+this_->skin+"/main.qml"; if (!QFile(mainQml).exists()){ - dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.\n", mainQml.toAscii().constData()); + dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.", mainQml.toAscii().constData()); exit(1); } this_->guiWidget->setSource(QUrl::fromLocalFile(mainQml)); @@ -380,7 +380,7 @@ gui_qml_set_attr(struct gui_priv *this_, struct attr *attr) this_->radius=attr->u.num; return 1; default: - dbg(lvl_error,"unknown attr: %s\n",attr_to_name(attr->type)); + dbg(lvl_error,"unknown attr: %s",attr_to_name(attr->type)); return 1; } } diff --git a/navit/gui/qml/ngqpoint.h b/navit/gui/qml/ngqpoint.h index 05142e5bf..b1e6312ff 100644 --- a/navit/gui/qml/ngqpoint.h +++ b/navit/gui/qml/ngqpoint.h @@ -248,7 +248,7 @@ public slots: } map_selection_destroy(sel); mapset_close(h); - dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData()); + dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData()); return retDoc.toString(); } protected: diff --git a/navit/gui/qml/proxy.h b/navit/gui/qml/proxy.h index 3243dc8cb..72a696f00 100644 --- a/navit/gui/qml/proxy.h +++ b/navit/gui/qml/proxy.h @@ -55,7 +55,7 @@ public slots: struct attr attr_value; double *helper; - dbg(lvl_debug,"Setting %s to %s\n",attr_name.toStdString().c_str(),attr_string.toStdString().c_str()); + dbg(lvl_debug,"Setting %s to %s",attr_name.toStdString().c_str(),attr_string.toStdString().c_str()); getAttrFunc(attr_from_name(attr_name.toStdString().c_str()), &attr_value, NULL); if (ATTR_IS_INT(attr_value.type)) { diff --git a/navit/gui/qml/routeProxy.h b/navit/gui/qml/routeProxy.h index a2fb4c793..f4c5f9911 100644 --- a/navit/gui/qml/routeProxy.h +++ b/navit/gui/qml/routeProxy.h @@ -30,7 +30,7 @@ public slots: QList<struct attr> destinations=this->_routeDestinations(); for (QList<struct attr>::const_iterator iter=destinations.begin();iter!=destinations.end();iter++) { NGQPoint helperPoint(this->object,iter->u.pcoord,MapPoint); - dbg(lvl_debug,"Added destination %s\n",helperPoint.coordString().toLocal8Bit().constData()); + dbg(lvl_debug,"Added destination %s",helperPoint.coordString().toLocal8Bit().constData()); } //dbg(lvl_debug,QString::number(_itemId).toStdString().c_str()); diff --git a/navit/gui/qml/searchProxy.h b/navit/gui/qml/searchProxy.h index 579ac3dac..16f79a2a3 100644 --- a/navit/gui/qml/searchProxy.h +++ b/navit/gui/qml/searchProxy.h @@ -33,7 +33,7 @@ public: item=country_search_get_item(cs); if (item && item_attr_get(item, attr_country_name, &country_name)) { search_attr.type=attr_country_all; - dbg(lvl_debug,"country %s\n", country_name.u.str); + dbg(lvl_debug,"country %s", country_name.u.str); this->country_name=QString::fromLocal8Bit(country_name.u.str); search_attr.u.str=country_name.u.str; search_list_search(this->sl, &search_attr, 0); @@ -44,9 +44,9 @@ public: } country_search_destroy(cs); } else { - dbg(lvl_error,"warning: no default country found\n"); + dbg(lvl_error,"warning: no default country found"); if (!this->country_iso2.isEmpty()) { - dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2.toStdString().c_str()); + dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2.toStdString().c_str()); search_attr.type=attr_country_iso2; search_attr.u.str=(char*)this->country_iso2.toStdString().c_str(); search_list_search(this->sl, &search_attr, 0); diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp index 395fff425..efbec8cda 100644 --- a/navit/gui/qt5_qml/backend.cpp +++ b/navit/gui/qt5_qml/backend.cpp @@ -43,15 +43,15 @@ void Backend::showMenu(struct point *p) struct coord co; transform_reverse(navit_get_trans(nav), p, &co); - dbg(lvl_debug, "Point 0x%x 0x%x\n", co.x, co.y); - dbg(lvl_debug, "Screen coord : %d %d\n", p->x, p->y); + dbg(lvl_debug, "Point 0x%x 0x%x", co.x, co.y); + dbg(lvl_debug, "Screen coord : %d %d", p->x, p->y); transform_to_geo(transform_get_projection(navit_get_trans(nav)), &co, &(this->g)); - dbg(lvl_debug, "%f %f\n", this->g.lat, this->g.lng); - dbg(lvl_debug, "%p %p\n", nav, &c); + dbg(lvl_debug, "%f %f", this->g.lat, this->g.lng); + dbg(lvl_debug, "%p %p", nav, &c); this->c.pro = transform_get_projection(navit_get_trans(nav)); this->c.x = co.x; this->c.y = co.y; - dbg(lvl_debug, "c : %x %x\n", this->c.x, this->c.y); + dbg(lvl_debug, "c : %x %x", this->c.x, this->c.y); // As a test, set the Demo vehicle position to wherever we just clicked navit_set_position(this->nav, &c); @@ -115,7 +115,7 @@ void Backend::get_vehicles() vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL); navit_attr_iter_destroy(iter); _vehicles.append(new VehicleObject(g_strdup(vattr.u.str), active_vehicle.u.vehicle, attr.u.vehicle)); - dbg(lvl_debug, "done\n"); + dbg(lvl_debug, "done"); emit vehiclesChanged(); return; } @@ -126,7 +126,7 @@ void Backend::get_vehicles() iter=navit_attr_iter_new(); while(navit_get_attr(this->nav, attr_vehicle, &attr, iter)) { vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL); - dbg(lvl_debug, "adding vehicle %s\n", vattr.u.str); + dbg(lvl_debug, "adding vehicle %s", vattr.u.str); _vehicles.append( new VehicleObject( g_strdup(vattr.u.str), @@ -194,11 +194,11 @@ void Backend::get_bookmarks() bookmarks_item_rewind(mattr.u.bookmarks); while ((item=bookmarks_get_item(mattr.u.bookmarks))) { if (!item_attr_get(item, attr_label, &attr)) continue; - dbg(lvl_debug,"full_label: %s\n", attr.u.str); + dbg(lvl_debug,"full_label: %s", attr.u.str); if (item_coord_get(item, &c, 1)) { pc.x = c.x; pc.y = c.y; - dbg(lvl_debug, "coords : %i x %i\n", pc.x, pc.y); + dbg(lvl_debug, "coords : %i x %i", pc.x, pc.y); _bookmarks.append(new BookmarkObject(attr.u.str, pc)); } } @@ -227,13 +227,13 @@ void Backend::get_pois() center.x = this->c.x; center.y = this->c.y; - dbg(lvl_debug, "center is at %x, %x\n", center.x, center.y); + dbg(lvl_debug, "center is at %x, %x", center.x, center.y); h = mapset_open(navit_get_mapset(this->nav)); while ((m = mapset_next(h, 1))) { selm = map_selection_dup_pro(sel, pro, map_projection(m)); mr = map_rect_new(m, selm); - dbg(lvl_debug, "mr=%p\n", mr); + dbg(lvl_debug, "mr=%p", mr); if (mr) { while ((item = map_rect_get_item(mr))) { if ( filter_pois(item) && @@ -319,8 +319,8 @@ QQmlListProperty<QObject> Backend::getSearchResults(){ * @returns the active POI */ PoiObject * Backend::activePoi() { - dbg(lvl_debug, "name : %s\n", m_activePoi->name().toUtf8().data()); - dbg(lvl_debug, "type : %s\n", m_activePoi->type().toLatin1().data()); + dbg(lvl_debug, "name : %s", m_activePoi->name().toUtf8().data()); + dbg(lvl_debug, "type : %s", m_activePoi->type().toLatin1().data()); return m_activePoi; } @@ -340,12 +340,12 @@ BookmarkObject * Backend::currentBookmark() { */ VehicleObject * Backend::currentVehicle() { struct attr attr; - dbg(lvl_debug, "name : %s\n", m_currentVehicle->name().toUtf8().data()); + dbg(lvl_debug, "name : %s", m_currentVehicle->name().toUtf8().data()); if (m_currentVehicle->vehicle()) { if (vehicle_get_attr(m_currentVehicle->vehicle(), attr_position_nmea, &attr, NULL)) - dbg(lvl_debug, "NMEA : %s\n", attr.u.str); + dbg(lvl_debug, "NMEA : %s", attr.u.str); } else { - dbg(lvl_debug, "m_currentVehicle->v is null\n"); + dbg(lvl_debug, "m_currentVehicle->v is null"); } return m_currentVehicle; @@ -354,7 +354,7 @@ VehicleObject * Backend::currentVehicle() { void Backend::block_draw(){ navit_block(this->nav, 1); - dbg(lvl_debug, "Draw operations blocked per UI request\n"); + dbg(lvl_debug, "Draw operations blocked per UI request"); } /** @@ -425,7 +425,7 @@ QString Backend::get_icon_path(){ void Backend::setActivePoiAsDestination(){ struct pcoord c; c = m_activePoi->coords(); - dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x\n", + dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x", m_activePoi->name().toUtf8().data(), c.pro, c.x, c.y); navit_set_destination(this->nav, &c, m_activePoi->name().toUtf8().data(), 1); @@ -439,9 +439,9 @@ void Backend::setActivePoiAsDestination(){ */ void Backend::searchValidateResult(int index){ SearchObject * r = (SearchObject *)_search_results.at(index); - dbg(lvl_debug, "Saving %s [%i] as search result\n", r->name().toUtf8().data(), index); + dbg(lvl_debug, "Saving %s [%i] as search result", r->name().toUtf8().data(), index); if (r->getCoords()){ - dbg(lvl_debug, "Item is at %x x %x\n", r->getCoords()->x, r->getCoords()->y); + dbg(lvl_debug, "Item is at %x x %x", r->getCoords()->x, r->getCoords()->y); } if (_search_context == attr_country_all) { _current_country = g_strdup(r->name().toUtf8().data()); @@ -453,7 +453,7 @@ void Backend::searchValidateResult(int index){ } else if (_search_context == attr_street_name) { _current_street = g_strdup(r->name().toUtf8().data()); } else { - dbg(lvl_error, "Unknown search context for '%s'\n", r->name().toUtf8().data()); + dbg(lvl_error, "Unknown search context for '%s'", r->name().toUtf8().data()); } // navit_set_center(this->nav, r->getCoords(), 1); emit displayMenu("destination_address.qml"); @@ -504,12 +504,12 @@ void Backend::updateSearch(QString text){ if (search == NULL){ search=&search_param; - dbg(lvl_debug, "search = %p\n", search); + dbg(lvl_debug, "search = %p", search); search->nav=this->nav; search->ms=navit_get_mapset(this->nav); search->sl=search_list_new(search->ms); search->partial = 1; - dbg(lvl_debug,"attempting to use country '%s'\n", _country_iso2); + dbg(lvl_debug,"attempting to use country '%s'", _country_iso2); search_attr.type=attr_country_iso2; search_attr.u.str=_country_iso2; search_list_search(search->sl, &search_attr, 0); @@ -529,7 +529,7 @@ void Backend::updateSearch(QString text){ // while((res=search_list_get_result(search->sl))); search->attr.u.str = text.toUtf8().data(); - dbg(lvl_error, "searching for %s partial %d\n", search->attr.u.str, search->partial); + dbg(lvl_error, "searching for %s partial %d", search->attr.u.str, search->partial); search->attr.type = _search_context; search_list_search(search->sl, &search->attr, search->partial); @@ -571,18 +571,18 @@ void Backend::setSearchContext(QString text){ } else if (text == "street") { _search_context = attr_street_name; } else { - dbg(lvl_error, "Unhandled search context '%s'\n", text.toUtf8().data()); + dbg(lvl_error, "Unhandled search context '%s'", text.toUtf8().data()); } } QString Backend::currentCountry() { - dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country); + dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country); return QString(_current_country); } QString Backend::currentCountryIso2() { - dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country); + dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country); return QString(_country_iso2); } @@ -590,7 +590,7 @@ QString Backend::currentTown() { if (_current_town == NULL) { _current_town = "Enter City"; } - dbg(lvl_debug, "Current town : %s\n", _current_town); + dbg(lvl_debug, "Current town : %s", _current_town); return QString(_current_town); } @@ -598,6 +598,6 @@ QString Backend::currentStreet() { if (_current_street == NULL) { _current_street = "Enter Street"; } - dbg(lvl_debug, "Current street : %s\n", _current_street); + dbg(lvl_debug, "Current street : %s", _current_street); return QString(_current_street); } diff --git a/navit/gui/qt5_qml/gui_qt5_qml.cpp b/navit/gui/qt5_qml/gui_qt5_qml.cpp index 1b4062d33..bd9b8a306 100644 --- a/navit/gui/qt5_qml/gui_qt5_qml.cpp +++ b/navit/gui/qt5_qml/gui_qt5_qml.cpp @@ -102,14 +102,14 @@ gui_qt5_qml_button(void* data, int pressed, int button, struct point* p) /* check if navit wants to handle this */ if (!navit_handle_button(gui_priv->nav, pressed, button, p, NULL)) { - dbg(lvl_debug, "navit has handled button\n"); + dbg(lvl_debug, "navit has handled button"); return; } - dbg(lvl_debug, "enter %d %d\n", pressed, button); + dbg(lvl_debug, "enter %d %d", pressed, button); /* check if user requested menu */ if (button == 1 && gui_priv->menu_on_map_click) { - dbg(lvl_debug, "navit wants us to enter menu\n"); + dbg(lvl_debug, "navit wants us to enter menu"); /*TODO: want to emit a signal somewhere? */ gui_priv->backend->showMenu(p); } @@ -119,7 +119,7 @@ static void gui_qt5_qml_motion(void* data, struct point* p) { struct gui_priv* gui_priv = (struct gui_priv*)data; - dbg(lvl_debug, "enter (%d, %d)\n", p->x, p->y); + dbg(lvl_debug, "enter (%d, %d)", p->x, p->y); /* forward this to navit */ navit_handle_motion(gui_priv->nav, p); } @@ -128,7 +128,7 @@ static void gui_qt5_qml_resize(void* data, int w, int h) { struct gui_priv* gui_priv = (struct gui_priv*)data; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); /* forward this to navit */ navit_handle_resize(gui_priv->nav, w, h); } @@ -142,7 +142,7 @@ gui_qml_keypress(void* data, char* key) transform_get_size(navit_get_trans(this_->nav), &w, &h); switch (*key) { case NAVIT_KEY_UP: - dbg(lvl_debug, "got KEY_UP\n"); + dbg(lvl_debug, "got KEY_UP"); p.x = w / 2; p.y = 0; navit_set_center_screen(this_->nav, &p, 1); @@ -163,7 +163,7 @@ gui_qml_keypress(void* data, char* key) navit_set_center_screen(this_->nav, &p, 1); break; case NAVIT_KEY_ZOOM_IN: - dbg(lvl_debug, "got ZOOM_IN\n"); + dbg(lvl_debug, "got ZOOM_IN"); navit_zoom_in(this_->nav, 2, NULL); break; case NAVIT_KEY_ZOOM_OUT: @@ -183,7 +183,7 @@ static int gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra) { struct transformation* trans; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); /* get navit transition */ trans = navit_get_trans(gui_priv->nav); @@ -212,14 +212,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra) /* get main navit window */ gui_priv->win = (struct window*)graphics_get_data(gra, "window"); if (!gui_priv->win) { - dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n"); + dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics"); return 1; } /* expect to have qt5 graphics. So get the qml engine prepared by graphics */ gui_priv->engine = (QQmlApplicationEngine*)graphics_get_data(gra, "engine"); if (gui_priv->engine == NULL) { - dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics\n"); + dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics"); return 1; } @@ -233,13 +233,13 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra) /* find the loader component */ gui_priv->loader = gui_priv->engine->rootObjects().value(0)->findChild<QObject*>("navit_loader"); if (gui_priv->loader != NULL) { - dbg(lvl_debug, "navit_loader found\n"); + dbg(lvl_debug, "navit_loader found"); /* load our root window into the loader component */ gui_priv->loader->setProperty("source", "qrc:///skins/modern/main.qml"); } transform_get_size(trans, &gui_priv->w, &gui_priv->h); - dbg(lvl_debug, "navit provided geometry: (%d, %d)\n", gui_priv->w, gui_priv->h); + dbg(lvl_debug, "navit provided geometry: (%d, %d)", gui_priv->w, gui_priv->h); /* Was resize callback already issued? */ // if (navit_get_ready(gui_priv->nav) & 2) @@ -254,14 +254,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra) static int gui_qt5_qml_get_attr(struct gui_priv* gui_priv, enum attr_type type, struct attr* attr) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); return 1; } static int gui_qt5_qml_set_attr(struct gui_priv* gui_priv, struct attr* attr) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); return 1; } @@ -284,7 +284,7 @@ gui_qt5_qml_new(struct navit* nav, struct gui_methods* meth, struct attr** attrs struct gui_priv* gui_priv; struct attr* attr; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); /* tell navit our methods */ *meth = gui_qt5_qml_methods; diff --git a/navit/gui/win32/gui_win32.c b/navit/gui/win32/gui_win32.c index 8a8cb37b9..7c964dbb9 100644 --- a/navit/gui/win32/gui_win32.c +++ b/navit/gui/win32/gui_win32.c @@ -185,7 +185,7 @@ static void window_layout( HWND hwnd ) rcClient.top += iToolHeight; - dbg(lvl_debug, "resize gui to: %d %d %d %d \n", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom ); + dbg(lvl_debug, "resize gui to: %d %d %d %d ", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom ); hChild = GetDlgItem(hwnd, ID_CHILD_GFX); @@ -285,7 +285,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l attr.type=attr_cursor; // TODO attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_cursor\n"); + dbg(lvl_error, "Failed to set attr_cursor"); } return 0; } @@ -298,7 +298,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l // attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); attr.u.num = 0; // TODO if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_orientation\n"); + dbg(lvl_error, "Failed to set attr_orientation"); } return 0; } diff --git a/navit/gui/win32/win32_gui_destination.c b/navit/gui/win32/win32_gui_destination.c index 115b9058b..e4a08072f 100644 --- a/navit/gui/win32/win32_gui_destination.c +++ b/navit/gui/win32/win32_gui_destination.c @@ -212,7 +212,7 @@ static void notify_textchange(struct datawindow_priv *datawindow, int param1, in (void)ListView_InsertItem(datawindow->hwndList, &lvI); ListView_SetItemText(datawindow->hwndList, listIndex, 1, tcharBuffer); g_free(tcharBuffer); - dbg(lvl_debug,"%s\n", res->country->name); + dbg(lvl_debug,"%s", res->country->name); listIndex++; } } @@ -307,7 +307,7 @@ BOOL register_destination_window() if (!RegisterClass(&wc)) { - dbg(lvl_error, "Window Registration Failed!\n"); + dbg(lvl_error, "Window Registration Failed!"); return FALSE; } return TRUE; @@ -339,7 +339,7 @@ HANDLE create_destination_window( struct navit *nav ) if (this_->hwnd == NULL) { - dbg(lvl_error, "Window Creation Failed!\n"); + dbg(lvl_error, "Window Creation Failed!"); return 0; } |