diff --git a/src/file.c b/src/file.c index cfda3e47..ad1c45a1 100644 --- a/src/file.c +++ b/src/file.c @@ -46,7 +46,7 @@ void add_definitions_directory(const gchar *directory) #endif gchar **dir_split_up; - dir_split_up = g_strsplit_set (directory, "\\/", -1); + dir_split_up = g_strsplit_set (directory, G_DIR_SEPARATOR_S, -1); if (strcmp(dir_split_up[g_strv_length(dir_split_up)-1],"definitions")==0) { root_definitions_directories = g_list_prepend (root_definitions_directories, diff --git a/src/misc_callbacks.c b/src/misc_callbacks.c index d073c3fe..a302d85a 100644 --- a/src/misc_callbacks.c +++ b/src/misc_callbacks.c @@ -367,9 +367,12 @@ on_combo_country_changed (GtkComboBox *combobox, gchar *buf = NULL; gtk_combo_box_get_active_iter(combobox, &iter); - gtk_tree_model_get(gtk_combo_box_get_model(combobox), &iter, 1, &buf, -1); - - misc_callback_show_team_list(GTK_WIDGET(combobox), buf); + if (!gtk_tree_model_iter_has_child (gtk_combo_box_get_model(combobox), + &iter)) + { + gtk_tree_model_get(gtk_combo_box_get_model(combobox), &iter, 1, &buf, -1); + misc_callback_show_team_list(GTK_WIDGET(combobox), buf); + } g_free(buf); } diff --git a/src/treeview.c b/src/treeview.c index 55195063..406de170 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -2657,13 +2657,14 @@ treeview_create_country_list(const GPtrArray *country_list) // We then try to build a tree using "/ or \" as a separator // The list is already sorted, so we don't need to verify current_country = g_strdup((gchar*)g_ptr_array_index(country_list, i)); - if (g_str_has_prefix(current_country,"/")||g_str_has_prefix(current_country,"\\")) + if (g_str_has_prefix(current_country,G_DIR_SEPARATOR_S)) { - // Strip leading "\\" + // Strip leading directory delimiter sprintf(current_country, "%.*s", strlen(current_country) - 1, ¤t_country[1]); } - dir_split_up = g_strsplit_set (current_country, "\\/", -1); - for (j=0; j