[MPlayer-cvslog] r38561 - in trunk/gui/dialog: skinbrowser.c skinbrowser.h
ib
subversion at mplayerhq.hu
Fri Jun 14 13:19:14 EEST 2024
Author: ib
Date: Fri Jun 14 13:19:14 2024
New Revision: 38561
Log:
Move FillSkinList() to a different location and make it static.
Modified:
trunk/gui/dialog/skinbrowser.c
trunk/gui/dialog/skinbrowser.h
Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c Fri Jun 14 13:18:14 2024 (r38560)
+++ trunk/gui/dialog/skinbrowser.c Fri Jun 14 13:19:14 2024 (r38561)
@@ -45,6 +45,34 @@ static char *prevSelected;
GtkWidget * SkinBrowser = NULL;
+static void FillSkinList (gchar *mdir)
+{
+ gchar * str[1];
+ gchar * tmp;
+ size_t i;
+ glob_t gg;
+ struct stat fs;
+
+ glob( mdir,GLOB_NOSORT,NULL,&gg );
+ for( i=0;i<gg.gl_pathc;i++ )
+ {
+ if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
+ if ( ( lstat( gg.gl_pathv[i],&fs ) == 0 ) )
+ {
+ tmp=strrchr( gg.gl_pathv[i],'/' );
+ if (tmp) tmp++;
+ else tmp = gg.gl_pathv[i];
+ // only directories or a link named "default"
+ if ( S_ISDIR( fs.st_mode ) || ( ( fs.st_mode & S_IFMT ) == S_IFLNK && strcmp( tmp,"default" ) == 0 ) )
+ {
+ str[0]=tmp;
+ if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+ }
+ }
+ }
+ globfree( &gg );
+}
+
static void prButton( GtkButton * button,gpointer user_data )
{
(void) button;
@@ -170,31 +198,3 @@ void ShowSkinBrowser( void )
gtk_clist_sort(GTK_CLIST(SkinList));
}
}
-
-void FillSkinList (gchar *mdir)
-{
- gchar * str[1];
- gchar * tmp;
- size_t i;
- glob_t gg;
- struct stat fs;
-
- glob( mdir,GLOB_NOSORT,NULL,&gg );
- for( i=0;i<gg.gl_pathc;i++ )
- {
- if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
- if ( ( lstat( gg.gl_pathv[i],&fs ) == 0 ) )
- {
- tmp=strrchr( gg.gl_pathv[i],'/' );
- if (tmp) tmp++;
- else tmp = gg.gl_pathv[i];
- // only directories or a link named "default"
- if ( S_ISDIR( fs.st_mode ) || ( ( fs.st_mode & S_IFMT ) == S_IFLNK && strcmp( tmp,"default" ) == 0 ) )
- {
- str[0]=tmp;
- if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
- }
- }
- }
- globfree( &gg );
-}
Modified: trunk/gui/dialog/skinbrowser.h
==============================================================================
--- trunk/gui/dialog/skinbrowser.h Fri Jun 14 13:18:14 2024 (r38560)
+++ trunk/gui/dialog/skinbrowser.h Fri Jun 14 13:19:14 2024 (r38561)
@@ -23,7 +23,6 @@
extern GtkWidget * SkinBrowser;
-void FillSkinList(gchar *dir);
void ShowSkinBrowser( void );
#endif /* MPLAYER_GUI_SKINBROWSER_H */
More information about the MPlayer-cvslog
mailing list