From c84c63751b2b392b220392ad7b4a6732968ebd3b Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 30 Nov 2014 21:23:44 +0000 Subject: [PATCH] Fix some problems with recent file list --- app/SubWindowHandle.cpp | 9 +++++---- app/plaYUVerApp.cpp | 14 ++++++++------ app/plaYUVerApp.h | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/SubWindowHandle.cpp b/app/SubWindowHandle.cpp index 374956c..b61a850 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -36,10 +36,11 @@ QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array for( Int i = 0; i < array.size(); i++ ) { d = array.at( i ); - out << d.m_cFilename << d.m_uiWidth - << d.m_uiHeight - << d.m_iPelFormat - << d.m_uiFrameRate; + out << d.m_cFilename + << d.m_uiWidth + << d.m_uiHeight + << d.m_iPelFormat + << d.m_uiFrameRate; } return out; diff --git a/app/plaYUVerApp.cpp b/app/plaYUVerApp.cpp index 8d9dc01..408ec57 100644 --- a/app/plaYUVerApp.cpp +++ b/app/plaYUVerApp.cpp @@ -157,7 +157,7 @@ Void plaYUVerApp::closeEvent( QCloseEvent *event ) } } -Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo ) +Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) { SubWindowHandle *interfaceChild = plaYUVerApp::findSubWindow( mdiArea, fileName ); if( interfaceChild ) @@ -166,18 +166,18 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo ) return; } interfaceChild = new SubWindowHandle( this ); //createSubWindow(); - if( !streamInfo ) + if( !pStreamInfo ) { Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName ); - streamInfo = ( PlaYUVerStreamInfo* )( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL ); + pStreamInfo = ( PlaYUVerStreamInfo* )( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL ); } try { - if( !streamInfo ) + if( !pStreamInfo ) interfaceChild->loadFile( fileName ); else - interfaceChild->loadFile( streamInfo ); + interfaceChild->loadFile( pStreamInfo ); statusBar()->showMessage( tr( "Loading file..." ) ); mdiArea->addSubWindow( interfaceChild ); @@ -194,7 +194,9 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo ) Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName ); if( idx >= 0 ) m_aRecentFileStreamInfo.remove( idx ); - m_aRecentFileStreamInfo.prepend( interfaceChild->getStreamInfo() ); + PlaYUVerStreamInfo streamInfo = interfaceChild->getStreamInfo(); + qDebug() << streamInfo.m_cFilename; + m_aRecentFileStreamInfo.prepend( streamInfo ); while( m_aRecentFileStreamInfo.size() > MAX_RECENT_FILES ) m_aRecentFileStreamInfo.remove( m_aRecentFileStreamInfo.size() - 1 ); updateRecentFileActions(); diff --git a/app/plaYUVerApp.h b/app/plaYUVerApp.h index 9f4cee2..6245831 100644 --- a/app/plaYUVerApp.h +++ b/app/plaYUVerApp.h @@ -153,7 +153,7 @@ private: QTime m_cTimer; UInt m_uiAveragePlayInterval; - Void loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo = NULL ); + Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL ); Void readRecentFileList(); Void writeRecentFileList();