comparison gui/ui/gtk/fileselect.c @ 35348:3aba69339390

Add a file loaded by the GUI to its playlist. The GUI operates on its playlist, so the file may not be missing there. This fixes a blocking when trying to replay a file loaded by the GUI (evLoad/evLoadPlay) instead of having been given as a command line argument, as well as a segmentation fault when loading a file after a playlist has been created. Reported by Hans-Dieter Kosch, hdkosch kabelbw de.
author ib
date Thu, 22 Nov 2012 13:12:15 +0000
parents 1accad685563
children ee265b18d653
comparison
equal deleted inserted replaced
35347:11408d97de7a 35348:3aba69339390
485 static void fs_Ok_released( GtkButton * button, gpointer user_data ) 485 static void fs_Ok_released( GtkButton * button, gpointer user_data )
486 { 486 {
487 GList * item; 487 GList * item;
488 int i = 1, l; 488 int i = 1, l;
489 struct stat fs; 489 struct stat fs;
490 gchar * selected;
490 491
491 stat( fsSelectedFile,&fs ); 492 stat( fsSelectedFile,&fs );
492 if( S_ISDIR(fs.st_mode ) ) 493 if( S_ISDIR(fs.st_mode ) )
493 { 494 {
494 chdir( fsSelectedFile ); 495 chdir( fsSelectedFile );
504 { 505 {
505 case fsVideoSelector: 506 case fsVideoSelector:
506 for (l = 0; fsVideoFilterNames[l][0]; l++) 507 for (l = 0; fsVideoFilterNames[l][0]; l++)
507 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break; 508 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break;
508 uiSetFileName( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE ); 509 uiSetFileName( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE );
510 selected = g_strconcat(fsSelectedDirectory, "/", fsSelectedFile, NULL);
511 if (selected)
512 {
513 import_file_into_gui(selected, 0);
514 g_free(selected);
515 }
509 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0; 516 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
510 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history 517 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history
511 break; 518 break;
512 case fsSubtitleSelector: 519 case fsSubtitleSelector:
513 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile ); 520 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile );