[MPlayer-cvslog] r38273 - trunk/gui/dialog/skinbrowser.c

ib subversion at mplayerhq.hu
Fri Feb 26 16:34:49 EET 2021


Author: ib
Date: Fri Feb 26 16:34:48 2021
New Revision: 38273

Log:
Rename variable prev prevSelected.

This makes its purpose more obvious.

Furthermore, it does not have to be static and should be initialized
only once in ShowSkinBrowser() (and not twice in FillSkinList()).

Modified:
   trunk/gui/dialog/skinbrowser.c

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Fri Feb 26 16:30:29 2021	(r38272)
+++ trunk/gui/dialog/skinbrowser.c	Fri Feb 26 16:34:48 2021	(r38273)
@@ -40,7 +40,7 @@ char      * sbSelectedSkin=NULL;
 char      * sbSkinDirInHome=NULL;
 char      * sbSkinDirInData=NULL;
 
-static char * prev=NULL;
+char *prevSelected;
 
 GtkWidget * SkinBrowser = NULL;
 
@@ -71,9 +71,9 @@ static void on_SkinList_select_row( GtkC
  (void) user_data;
 
  gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
- if ( strcmp( prev,sbSelectedSkin ) )
+ if ( strcmp( prevSelected,sbSelectedSkin ) )
   {
-   prev=sbSelectedSkin;
+   prevSelected=sbSelectedSkin;
    uiChangeSkin( sbSelectedSkin );
    gtkRaise( SkinBrowser );
   }
@@ -154,6 +154,8 @@ void ShowSkinBrowser( void )
 
  gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group );
  gtk_widget_grab_focus( scrolledwindow1 );
+
+ prevSelected = skinName;
  gtk_widget_show(SkinBrowser);
 }
 
@@ -165,8 +167,6 @@ int FillSkinList( gchar * mdir )
  glob_t          gg;
  struct stat     fs;
 
- prev=skinName;
-
  glob( mdir,GLOB_NOSORT,NULL,&gg );
  for( i=0;i<gg.gl_pathc;i++ )
   {


More information about the MPlayer-cvslog mailing list