[vlc-devel] commit: Comments. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sun Jul 27 20:27:16 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jul 27 11:24:57 2008 -0700| [08062ae3e0b040022b3e64f357628ad98f1ab572]
Comments.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08062ae3e0b040022b3e64f357628ad98f1ab572
---
modules/gui/qt4/dialogs_provider.cpp | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 621accc..22c81fe 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -246,9 +246,11 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
{
if( p_arg == NULL )
{
- msg_Dbg( p_intf, "openFileGenericDialog() called with NULL arg" );
+ msg_Warn( p_intf, "openFileGenericDialog() called with NULL arg" );
return;
}
+
+ /* Replace the extensions to a Qt format */
int i = 0;
QString extensions = qfu( p_arg->psz_extensions );
while ( ( i = extensions.indexOf( "|", i ) ) != -1 )
@@ -260,29 +262,38 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
}
extensions.replace(QString(";*"), QString(" *"));
extensions.append( ")" );
+
+ /* Save */
if( p_arg->b_save )
{
- QString file = QFileDialog::getSaveFileName( NULL, p_arg->psz_title, qfu( p_intf->p_sys->psz_filepath ), extensions );
+ QString file = QFileDialog::getSaveFileName( NULL, p_arg->psz_title,
+ qfu( p_intf->p_sys->psz_filepath ), extensions );
if( !file.isEmpty() )
{
p_arg->i_results = 1;
- p_arg->psz_results = ( char ** )malloc( p_arg->i_results * sizeof( char * ) );
+ p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
p_arg->psz_results[0] = strdup( qtu( file ) );
}
else
p_arg->i_results = 0;
}
- else
+ else /* non-save mode */
{
- QStringList files = QFileDialog::getOpenFileNames( NULL, p_arg->psz_title, qfu( p_intf->p_sys->psz_filepath ), extensions );
+ QStringList files = QFileDialog::getOpenFileNames( NULL,
+ p_arg->psz_title, qfu( p_intf->p_sys->psz_filepath ),
+ extensions );
p_arg->i_results = files.count();
- p_arg->psz_results = ( char ** )malloc( p_arg->i_results * sizeof( char * ) );
+ p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
i = 0;
foreach( QString file, files )
p_arg->psz_results[i++] = strdup( qtu( file ) );
}
+
+ /* Callback */
if( p_arg->pf_callback )
p_arg->pf_callback( p_arg );
+
+ /* Clean afterwards */
if( p_arg->psz_results )
{
for( i = 0; i < p_arg->i_results; i++ )
@@ -293,6 +304,7 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
free( p_arg->psz_extensions );
free( p_arg );
}
+
void DialogsProvider::openFileDialog()
{
openDialog( OPEN_FILE_TAB );
More information about the vlc-devel
mailing list