From 7c7499714f43b52041d7cdd1d87d39a8a6b67a6d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 9 Oct 2014 11:05:09 +0100 Subject: [PATCH] Fix loading file from the recent file list when drag and drop --- source/app/plaYUVerApp.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 4526caa..9eca4c6 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -167,6 +167,12 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo ) } interfaceChild = new SubWindowHandle( this ); //createSubWindow(); Bool retChild = false; + if( !streamInfo ) + { + Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName ); + streamInfo = idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL; + } + if( !streamInfo ) retChild = interfaceChild->loadFile( fileName ); else @@ -239,11 +245,7 @@ Void plaYUVerApp::open() if( !fileNameList.at( i ).isEmpty() ) { m_cLastOpenPath = QFileInfo( fileNameList.at( i ) ).path(); - Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileNameList.at( i ) ); - if( idx >= 0 ) - loadFile( fileNameList.at( i ), (PlaYUVerStreamInfo*) &m_aRecentFileStreamInfo.at( idx ) ); - else - loadFile( fileNameList.at( i ) ); + loadFile( fileNameList.at( i ) ); } } }