changeset 35963:db72a3183d41

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.
author ib
date Mon, 25 Mar 2013 00:45:32 +0000
parents df731f25759e
children 3ebf8c880e07
files gui/dialog/playlist.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/playlist.c	Mon Mar 25 00:44:28 2013 +0000
+++ b/gui/dialog/playlist.c	Mon Mar 25 00:45:32 2013 +0000
@@ -499,6 +499,7 @@
   gchar 	* root = "/";
   gchar 	* dummy = "dummy";
   DirNodeType 	* DirNode;
+  plItem        * last;
 
   accel_group=gtk_accel_group_new();
 
@@ -545,7 +546,10 @@
   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 ) );