# HG changeset patch # User ib # Date 1362925502 0 # Node ID 25af0fce844fd6bf81b0742effe28c623e8c05ee # Parent 1994a2fd15f4da8cff3085d407d1ca60fcab33e2 Keep GUI history entries in order. Currently, if an entry is to be added to the GUI history and this entry is already existing, it is swapped with the top entry. This breaks history sequence and is confusing. Move this entry to the top while leaving the other ones in their order. Patch by Hans-Dieter Kosch, hdkosch kabelbw de. diff -r 1994a2fd15f4 -r 25af0fce844f gui/dialog/fileselect.c --- a/gui/dialog/fileselect.c Sun Mar 10 12:46:45 2013 +0000 +++ b/gui/dialog/fileselect.c Sun Mar 10 14:25:02 2013 +0000 @@ -386,18 +386,24 @@ static void fs_PersistantHistory( char * subject ) { unsigned int i; + char * entry; if ( fsType != fsVideoSelector ) return; for ( i=0;i < FF_ARRAY_ELEMS(fsHistory);i++ ) if ( fsHistory[i] && !strcmp( fsHistory[i],subject ) ) { - char * tmp = fsHistory[i]; fsHistory[i]=fsHistory[0]; fsHistory[0]=tmp; - return; + entry=fsHistory[i]; + break; } - nfree( fsHistory[FF_ARRAY_ELEMS(fsHistory) - 1] ); - for ( i=FF_ARRAY_ELEMS(fsHistory) - 1;i;i-- ) fsHistory[i]=fsHistory[i - 1]; - fsHistory[0]=gstrdup( subject ); + if ( i >= FF_ARRAY_ELEMS(fsHistory) ) + { + i=FF_ARRAY_ELEMS(fsHistory)-1; + nfree( fsHistory[i] ); + entry=gstrdup( subject ); + } + for ( ;i;i-- ) fsHistory[i]=fsHistory[i - 1]; + fsHistory[0]=entry; } /* ----------------------------------------------- */