span = s;
}
for (i=0; i<strlen(span); i++) {
- gchar c = span[i];
- if (c == '<') {
+ gchar ch = span[i];
+ if (ch == '<') {
tag++;
}
if (tag>0) {
span[i] = ' ';
}
- if (c == '>') {
+ if (ch == '>') {
if (tag>0) tag--;
}
}
while ( gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT )
{
- GList *names = NULL;
+ GList *names_selected = NULL;
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
- gtk_tree_selection_selected_foreach(selection, get_selected_foreach_func, &names);
- if (names)
+ gtk_tree_selection_selected_foreach(selection, get_selected_foreach_func, &names_selected);
+ if (names_selected)
{
gtk_widget_destroy ( dialog );
- return (names);
+ return names_selected;
}
a_dialog_error_msg(parent, _("Nothing was selected"));
}
/**
* Login to use for OSM uploading.
*/
-static gchar *user = NULL;
+static gchar *osm_user = NULL;
/**
* Password to use for OSM uploading.
*/
-static gchar *password = NULL;
+static gchar *osm_password = NULL;
/**
* Mutex to protect auth. token
return default_user;
}
-void osm_set_login(const gchar *user_, const gchar *password_)
+void osm_set_login(const gchar *user, const gchar *password)
{
/* Allocate mutex */
if (login_mutex == NULL)
login_mutex = g_mutex_new();
}
g_mutex_lock(login_mutex);
- g_free(user); user = NULL;
- g_free(password); password = NULL;
- user = g_strdup(user_);
- password = g_strdup(password_);
+ g_free(osm_user); osm_user = NULL;
+ g_free(osm_password); osm_password = NULL;
+ osm_user = g_strdup(user);
+ osm_password = g_strdup(password);
g_mutex_unlock(login_mutex);
}
{
gchar *user_pass = NULL;
g_mutex_lock(login_mutex);
- user_pass = g_strdup_printf("%s:%s", user, password);
+ user_pass = g_strdup_printf("%s:%s", osm_user, osm_password);
g_mutex_unlock(login_mutex);
return user_pass;
}
file = NULL;
/* finally, upload it */
- gint ans = osm_traces_upload_file(user, password, filename,
+ gint ans = osm_traces_upload_file(osm_user, osm_password, filename,
oti->name, oti->description, oti->tags, oti->vistype);
//
const gchar *pref_user = a_preferences_get(VIKING_OSM_TRACES_PARAMS_NAMESPACE "username")->s;
const gchar *pref_password = a_preferences_get(VIKING_OSM_TRACES_PARAMS_NAMESPACE "password")->s;
- if (user != NULL && user[0] != '\0')
- gtk_entry_set_text(GTK_ENTRY(user_entry), user);
+ if (osm_user != NULL && osm_user[0] != '\0')
+ gtk_entry_set_text(GTK_ENTRY(user_entry), osm_user);
else if (pref_user != NULL && pref_user[0] != '\0')
gtk_entry_set_text(GTK_ENTRY(user_entry), pref_user);
else if (default_user != NULL)
gtk_entry_set_text(GTK_ENTRY(user_entry), default_user);
- if (password != NULL && password[0] != '\0')
- gtk_entry_set_text(GTK_ENTRY(password_entry), password);
+ if (osm_password != NULL && osm_password[0] != '\0')
+ gtk_entry_set_text(GTK_ENTRY(password_entry), osm_password);
else if (pref_password != NULL)
gtk_entry_set_text(GTK_ENTRY(password_entry), pref_password);
/* This is a password -> invisible */
void osm_traces_init();
void osm_traces_upload_viktrwlayer ( VikTrwLayer *vtl, VikTrack *trk );
-void osm_set_login (const gchar *user_, const gchar *password_);
+void osm_set_login (const gchar *user, const gchar *password);
gchar *osm_get_login();
void osm_login_widgets (GtkWidget *user_entry, GtkWidget *password_entry);
return FALSE;
}
-static void preferences_run_setparam ( gpointer notused, guint16 i, VikLayerParamData data, VikLayerParam *params )
+static void preferences_run_setparam ( gpointer notused, guint16 i, VikLayerParamData data, VikLayerParam *vlparams )
{
- if ( params[i].type == VIK_LAYER_PARAM_STRING_LIST )
+ if ( vlparams[i].type == VIK_LAYER_PARAM_STRING_LIST )
g_critical ( "Param strings not implemented in preferences"); //fake it
- g_hash_table_insert ( values, (gchar *)(params[i].name), vik_layer_typed_param_data_copy_from_data(params[i].type, data) );
+ g_hash_table_insert ( values, (gchar *)(vlparams[i].name), vik_layer_typed_param_data_copy_from_data(vlparams[i].type, data) );
}
/* Allow preferences to be manipulated externally */
-void a_preferences_run_setparam ( VikLayerParamData data, VikLayerParam *params )
+void a_preferences_run_setparam ( VikLayerParamData data, VikLayerParam *vlparams )
{
- preferences_run_setparam (NULL, 0, data, params);
+ preferences_run_setparam (NULL, 0, data, vlparams);
}
static VikLayerParamData preferences_run_getparam ( gpointer notused, guint16 i, gboolean notused2 )
VikLayerParamData *a_preferences_get(const gchar *key);
/* Allow preferences to be manipulated externally */
-void a_preferences_run_setparam ( VikLayerParamData data, VikLayerParam *params );
+void a_preferences_run_setparam ( VikLayerParamData data, VikLayerParam *vlparams );
gboolean a_preferences_save_to_file();
gint tilesize_y_ceil = ceil ( tilesize_y );
gint8 xinc = (ulm.x == xmin) ? 1 : -1;
gint8 yinc = (ulm.y == ymin) ? 1 : -1;
- gdouble xx, yy; gint xx_tmp, yy_tmp;
+ gint xx_tmp, yy_tmp;
gint base_yy, xend, yend;
xend = (xinc == 1) ? (xmax+1) : (xmin-1);
g_message("%s: this feature works only in Mercator mode", __FUNCTION__);
if (fillins) {
- GList *iter = fillins;
- while (iter) {
- cur_coord = (VikCoord *)(iter->data);
+ GList *fiter = fillins;
+ while (fiter) {
+ cur_coord = (VikCoord *)(fiter->data);
vik_coord_set_area(cur_coord, &wh, &tl, &br);
rect = g_malloc(sizeof(Rect));
rect->tl = tl;
rect->br = br;
rect->center = *cur_coord;
rects_to_download = g_list_prepend(rects_to_download, rect);
- iter = iter->next;
+ fiter = fiter->next;
}
}
max_speed = widgets->max_speed * 110 / 100;
// This is just an indicator - no actual values can be inferred by user
- gint i;
for ( i = 0; i < widgets->profile_width; i++ ) {
int y_speed = widgets->profile_height - (widgets->profile_height * widgets->speeds[i])/max_speed;
gdk_draw_rectangle(GDK_DRAWABLE(pix), dist_speed_gc, TRUE, i+MARGIN-2, y_speed-2, 4, 4);
max_speed = widgets->max_speed * 110 / 100;
// This is just an indicator - no actual values can be inferred by user
- gint i;
for ( i = 0; i < widgets->profile_width; i++ ) {
int y_speed = widgets->profile_height - (widgets->profile_height * widgets->speeds[i])/max_speed;
gdk_draw_rectangle(GDK_DRAWABLE(pix), elev_speed_gc, TRUE, i+MARGIN-2, y_speed-2, 4, 4);
if ( !fn )
return;
- gint active = gtk_combo_box_get_active ( GTK_COMBO_BOX(zoom_combo) );
- gdouble zoom = pow (2, active-2 );
+ gint active_z = gtk_combo_box_get_active ( GTK_COMBO_BOX(zoom_combo) );
+ gdouble zoom = pow (2, active_z-2 );
if ( one_image_only )
save_image_file ( vw, fn,