[vlc-devel] [PATCH] Fix a bug in the OpenFile dialog

Jean-Baptiste Kempf jb at videolan.org
Wed Dec 5 19:50:42 CET 2007


Applied.
On Tue, Dec 04, 2007, Rémi Duraffort wrote :
> When adding a file to the playlist by clicking on "Read" in the OpenFile
> dialog, the first time it's ok but the next click you add 2 times and then
> more times the same file.
> This patch fix this problem.
> 
> -- 
> ivoire | Rémi Duraffort

> Index: open.cpp
> ===================================================================
> --- open.cpp	(révision 23447)
> +++ open.cpp	(copie de travail)
> @@ -126,7 +126,7 @@
>      BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
>  
>      /* Buttons action */
> -    BUTTONACT( playButton, play());
> +    BUTTONACT( playButton, selectSlots());
>      BUTTONACT( cancelButton, cancel());
>  
>      /* At creation time, modify the default buttons */
> @@ -148,22 +148,18 @@
>  {
>      switch ( i_action_flag )
>      {
> -        case OPEN_AND_STREAM:
> -            playButton->setText( qtr("&Stream") );
> -            BUTTONACT( playButton, stream() );
> -            break;
> -        case OPEN_AND_SAVE:
> -            playButton->setText( qtr("&Convert / Save") );
> -            BUTTONACT( playButton, transcode() );
> -            break;
> -        case OPEN_AND_ENQUEUE:
> -            playButton->setText( qtr("&Enqueue") );
> -            BUTTONACT( playButton, enqueue() );
> -            break;
> -        case OPEN_AND_PLAY:
> -        default:
> -            playButton->setText( qtr("&Play") );
> -            BUTTONACT( playButton, play() );
> +    case OPEN_AND_STREAM:
> +        playButton->setText( qtr("&Stream") );
> +        break;
> +    case OPEN_AND_SAVE:
> +        playButton->setText( qtr("&Convert / Save") );
> +        break;
> +    case OPEN_AND_ENQUEUE:
> +        playButton->setText( qtr("&Enqueue") );
> +        break;
> +    case OPEN_AND_PLAY:
> +    default:
> +        playButton->setText( qtr("&Play") );
>     }
>  }
>  
> @@ -231,6 +227,25 @@
>  }
>  
>  /* Play button */
> +void OpenDialog::selectSlots()
> +{
> +    switch ( i_action_flag )
> +    {
> +    case OPEN_AND_STREAM:
> +        stream();
> +        break;
> +    case OPEN_AND_SAVE:
> +        transcode();
> +        break;
> +    case OPEN_AND_ENQUEUE:
> +        enqueue();
> +        break;
> +    case OPEN_AND_PLAY:
> +    default:
> +        play();
> +    }
> +}
> +
>  void OpenDialog::play()
>  {
>      finish( false );
> Index: open.hpp
> ===================================================================
> --- open.hpp	(révision 23447)
> +++ open.hpp	(copie de travail)
> @@ -61,6 +61,7 @@
>      QString mainMRL;
>  
>  public slots:
> +    void selectSlots();
>      void play();
>      void stream( bool b_transode_only = false );
>      void enqueue();

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/



More information about the vlc-devel mailing list