comparison Gui/mplayer/gtk/fs.c @ 8980:16fa828e3d4c

10l
author pontscho
date Sat, 18 Jan 2003 01:07:46 +0000
parents dc27303ae528
children 4a42c0604ce1
comparison
equal deleted inserted replaced
8979:eaee773aee9c 8980:16fa828e3d4c
149 gtk_widget_hide( list ); 149 gtk_widget_hide( list );
150 gtk_clist_clear( GTK_CLIST( list ) ); 150 gtk_clist_clear( GTK_CLIST( list ) );
151 str[0][0]=NULL; 151 str[0][0]=NULL;
152 152
153 pixmap=dpixmap; mask=dmask; 153 pixmap=dpixmap; mask=dmask;
154 str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 ); 154 str[0][0]=NULL;
155 strcpy( str[0][1],"." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask ); 155 str[0][1]="."; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask );
156 strcpy( str[0][1],".." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask ); 156 str[0][1]=".."; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask );
157 free( str[0][0] );
158 157
159 glob( "*",0,NULL,&gg ); 158 glob( "*",0,NULL,&gg );
160 // glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg ); 159 // glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
161 for( i=0;(unsigned)i<gg.gl_pathc;i++ ) 160 for( i=0;(unsigned)i<gg.gl_pathc;i++ )
162 { 161 {
163 stat( gg.gl_pathv[i],&fs ); 162 stat( gg.gl_pathv[i],&fs );
164 if( !S_ISDIR( fs.st_mode ) ) continue; 163 if( !S_ISDIR( fs.st_mode ) ) continue;
165 164
166 str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 ); 165 str[0][1]=gg.gl_pathv[i];
167 strcpy( str[0][1],gg.gl_pathv[i] );
168 pixmap=dpixmap; mask=dmask; 166 pixmap=dpixmap; mask=dmask;
169 gtk_clist_append( GTK_CLIST( list ),str[0] ); 167 gtk_clist_append( GTK_CLIST( list ),str[0] );
170 gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask ); 168 gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
171 free( str[0][1] );
172 } 169 }
173 globfree( &gg ); 170 globfree( &gg );
174 171
175 if ( strchr( fsFilter,',' ) ) 172 if ( strchr( fsFilter,',' ) )
176 { 173 {
211 for( i=0;(unsigned)i<gg.gl_pathc;i++ ) 208 for( i=0;(unsigned)i<gg.gl_pathc;i++ )
212 { 209 {
213 stat( gg.gl_pathv[i],&fs ); 210 stat( gg.gl_pathv[i],&fs );
214 if( S_ISDIR( fs.st_mode ) ) continue; 211 if( S_ISDIR( fs.st_mode ) ) continue;
215 212
216 str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 ); 213 str[0][1]=gg.gl_pathv[i];
217 strcpy( str[0][1],gg.gl_pathv[i] );
218 gtk_clist_append( GTK_CLIST( list ),str[0] ); 214 gtk_clist_append( GTK_CLIST( list ),str[0] );
219 gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask ); 215 gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
220 free( str[0][1] );
221 } 216 }
222 globfree( &gg ); 217 globfree( &gg );
223 218
224 gtk_clist_set_column_width( GTK_CLIST( list ),0,17 ); 219 gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
225 gtk_clist_select_row( GTK_CLIST( list ),0,1 ); 220 gtk_clist_select_row( GTK_CLIST( list ),0,1 );