From e711e9c8b39c64cf1af0400641ff43e0647b8ac9 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 15 Jul 2014 14:25:35 +0100 Subject: [PATCH] Allow to open multiple files at once --- source/app/plaYUVerApp.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index ad5d9d5..f779431 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -211,12 +211,15 @@ Void plaYUVerApp::open() << formatsList << tr( "All Files (*)" ); - QString fileName = QFileDialog::getOpenFileName( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) ); + QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) ); - if( !fileName.isEmpty() ) + for( Int i = 0; i < fileNameList.size(); i++ ) { - m_cLastOpenPath = QFileInfo( fileName ).path(); - loadFile( fileName ); + if( !fileNameList.at( i ).isEmpty() ) + { + m_cLastOpenPath = QFileInfo( fileNameList.at( i ) ).path(); + loadFile( fileNameList.at( i ) ); + } } } @@ -658,7 +661,7 @@ Void plaYUVerApp::lockButtonEvent() if( m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) ) { m_acPlayingSubWindows.clear(); - m_acPlayingSubWindows.append(m_pcCurrentSubWindow); + m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); } else {