Commit e825ac86 authored by Jean-Philippe Andre's avatar Jean-Philippe Andre Committed by Jean-Baptiste Kempf

Qt menus: prefer THEMIM->getInput()

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 68b2161a
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "main_interface.hpp" #include "main_interface.hpp"
#include "menus.hpp" #include "menus.hpp"
#include <vlc_intf_strings.h> #include <vlc_intf_strings.h>
#include "input_manager.hpp"
/* The dialogs */ /* The dialogs */
#include "dialogs/playlist.hpp" #include "dialogs/playlist.hpp"
...@@ -532,19 +533,15 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg ) ...@@ -532,19 +533,15 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
void DialogsProvider::loadSubtitlesFile() void DialogsProvider::loadSubtitlesFile()
{ {
playlist_t *p_playlist = pl_Yield( p_intf ); input_thread_t *p_input = THEMIM->getInput();
if( !p_playlist || !p_playlist->p_input ) if( !p_input )
{
msg_Err( p_intf, "cannot get input" );
return; return;
}
QString qsFile = QFileDialog::getOpenFileName( QString qsFile = QFileDialog::getOpenFileName(
NULL, NULL,
qtr( "Choose subtitles file" ), qtr( "Choose subtitles file" ),
"", "",
qtr( "Subtitles files (*.cdg *.idx *.srt *.sub *.utf);;" qtr( "Subtitles files (*.cdg *.idx *.srt *.sub *.utf);;"
"All files (*)" ) ); "All files (*)" ) );
if( !input_AddSubtitles( p_playlist->p_input, qtu( qsFile ), true ) ) if( !input_AddSubtitles( p_input, qtu( qsFile ), true ) )
msg_Warn( p_intf, "unable to load subtitles file..." ); msg_Warn( p_intf, "unable to load subtitles file..." );
pl_Release( p_playlist );
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment