1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
void liste_fichiers(GtkWidget *widget, Tags *tag)
{
/// Variables
const gchar *nom=NULL;
const gchar *nom2=NULL;
/// Listage du dossier
tag->Chemin=Selection_repertoire();
tag->repertoire = g_dir_open(tag->Chemin,0,NULL);
gtk_list_store_clear(tag->liste);
if(tag->repertoire!=NULL)
{
while (nom = g_dir_read_name(tag->repertoire))
{
nom=g_locale_to_utf8(nom,-1,NULL,NULL,NULL);
printf("\n%s",nom);
nom2 = g_malloc (strlen (nom) + 1);
if (nom2 != NULL)
{
GtkTreeIter iteration;
strcpy ((gchar*)nom2, (gchar*)nom);
if(strstr(nom2,".mp3")!=NULL)
{
gtk_list_store_append(tag->liste,&iteration);
gtk_list_store_set(tag->liste,&iteration,TEXT_COLUMN,nom,-1);
}
}
}
g_dir_close(tag->repertoire);
gtk_widget_show_all(tag->vue);
} |
Partager