~ubuntu-branches/ubuntu/natty/vlc/natty

« back to all changes in this revision

Viewing changes to modules/gui/qt4/dialogs_provider.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-07-23 10:41:59 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20100723104159-pudrtu70a1svhiyl
Tags: 1.1.1-1+exp1ubuntu1
* Merge from Debian experimental, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * dialogs_provider.cpp : Dialog Provider
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2006-2009 the VideoLAN team
5
 
 * $Id: 13dbbfa86a924d4c4f736f2700162957174b6372 $
 
5
 * $Id: 797b9edad339a69a50d46b30701427774d2010d8 $
6
6
 *
7
7
 * Authors: Clément Stenac <zorglub@videolan.org>
8
8
 *          Jean-Baptiste Kempf <jb@videolan.org>
497
497
{
498
498
    QString dir = QFileDialog::getExistingDirectory( NULL, qtr( I_OP_DIR_WINTITLE ), p_intf->p_sys->filepath );
499
499
 
500
 
    if (!dir.isEmpty() )
501
 
    {
502
 
        QString mrl = (dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
503
 
                       "dvd://" : "directory://")
504
 
                    + toNativeSeparators( dir );
505
 
        input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
506
 
 
507
 
        /* FIXME: playlist_AddInput() can fail */
508
 
        playlist_AddInput( THEPL, p_input,
509
 
                       go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
 
500
    if( dir.isEmpty() )
 
501
        return;
 
502
 
 
503
    char *uri = make_URI( qtu( dir ) );
 
504
    if( unlikely(uri == NULL) )
 
505
        return;
 
506
 
 
507
    RecentsMRL::getInstance( p_intf )->addRecent( qfu(uri) );
 
508
 
 
509
    input_item_t *p_input = input_item_New( THEPL, uri, NULL );
 
510
    free( uri );
 
511
    if( unlikely( p_input == NULL ) )
 
512
        return;
 
513
 
 
514
    /* FIXME: playlist_AddInput() can fail */
 
515
    playlist_AddInput( THEPL, p_input,
 
516
                      go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
510
517
                       PLAYLIST_END, pl, pl_Unlocked );
511
 
        RecentsMRL::getInstance( p_intf )->addRecent( mrl );
512
 
        if( !go )
513
 
            input_Read( THEPL, p_input );
514
 
        vlc_gc_decref( p_input );
515
 
    }
 
518
    if( !go )
 
519
        input_Read( THEPL, p_input );
 
520
    vlc_gc_decref( p_input );
516
521
}
517
522
 
518
523
void DialogsProvider::PLOpenDir()