[MPlayer-cvslog] r36057 - trunk/gui/dialog/playlist.c

ib subversion at mplayerhq.hu
Mon Mar 25 01:45:33 CET 2013


Author: ib
Date: Mon Mar 25 01:45:32 2013
New Revision: 36057

Log:
Preselect current playlist directory from last playlist entry.

Currently, it's preselected from the first (i.e. most recent)
history file entry - which appears quite unrelated.

Get the last playlist entry by using new listMgr command
PLAYLIST_ITEM_GET_LAST. Fall back to the history file entry
if there's no playlist entry.

Based on a patch by Hans-Dieter Kosch, hdkosch kabelbw de.

Modified:
   trunk/gui/dialog/playlist.c

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Mon Mar 25 01:44:28 2013	(r36056)
+++ trunk/gui/dialog/playlist.c	Mon Mar 25 01:45:32 2013	(r36057)
@@ -499,6 +499,7 @@ GtkWidget * create_PlayList( void )
   gchar 	* root = "/";
   gchar 	* dummy = "dummy";
   DirNodeType 	* DirNode;
+  plItem        * last;
 
   accel_group=gtk_accel_group_new();
 
@@ -545,7 +546,10 @@ GtkWidget * create_PlayList( void )
   gtk_ctree_expand( GTK_CTREE( CTDirTree ),parent );
   gtk_widget_show( CTDirTree );
 
-  if ( fsHistory[0] ) old_path = strdup( cfg_old_filename_from_utf8( fsHistory[0] ) );
+  last=listMgr( PLAYLIST_ITEM_GET_LAST,0 );
+
+  if ( last && last->path ) old_path = strdup( last->path );
+  else if ( fsHistory[0] ) old_path = strdup( cfg_old_filename_from_utf8( fsHistory[0] ) );
 
   gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0,
     AddLabel( MSGTR_PLAYLIST_DirectoryTree,NULL ) );


More information about the MPlayer-cvslog mailing list