[vlc-commits] Qt: disc open: support different values for disclabel/discpath

Jean-Baptiste Kempf git at videolan.org
Tue Apr 19 07:38:28 CEST 2011


vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Mar 16 22:16:40 2011 +0100| [be47fc44ae31f0123f0906b20137af99c30b2f7d] | committer: Jean-Baptiste Kempf

Qt: disc open: support different values for disclabel/discpath

(cherry picked from commit 77360d6596ada918183311bd3292618cd799dc7f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=be47fc44ae31f0123f0906b20137af99c30b2f7d
---

 modules/gui/qt4/components/open_panels.cpp |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index a19b11f..e76c59f 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -304,7 +304,9 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
         while( *drive )
         {
             if( GetDriveTypeA(drive) == DRIVE_CDROM )
+            {
                 ui.deviceCombo->addItem( drive );
+            }
 
             /* go to next drive */
             while( *(drive++) );
@@ -414,17 +416,23 @@ void DiscOpenPanel::updateButtons()
 /* Update the current MRL */
 void DiscOpenPanel::updateMRL()
 {
-    QString mrl = "";
+    QString mrl;
+    QString discPath;
     QStringList fileList;
 
+    if( ui.deviceCombo->itemData( ui.deviceCombo->currentIndex() ) != QVariant::Invalid )
+        discPath = ui.deviceCombo->itemData( ui.deviceCombo->currentIndex() ).toString();
+    else
+        discPath = ui.deviceCombo->currentText();
+
     /* CDDAX and VCDX not implemented. TODO ? No. */
     /* DVD */
     if( ui.dvdRadioButton->isChecked() ) {
         if( !ui.dvdsimple->isChecked() )
-            mrl = "dvd://";
+            mrl = "dvd://" + discPath;
         else
-            mrl = "dvdsimple://";
-        mrl += ui.deviceCombo->currentText();
+            mrl = "dvdsimple://" + discPath;
+
         if( !ui.dvdsimple->isChecked() )
             emit methodChanged( "dvdnav-caching" );
         else
@@ -439,7 +447,7 @@ void DiscOpenPanel::updateMRL()
 
     /* VCD */
     } else if ( ui.vcdRadioButton->isChecked() ) {
-        mrl = "vcd://" + ui.deviceCombo->currentText();
+        mrl = "vcd://" + discPath;
         emit methodChanged( "vcd-caching" );
 
         if( ui.titleSpin->value() > 0 ) {
@@ -448,7 +456,7 @@ void DiscOpenPanel::updateMRL()
 
     /* CDDA */
     } else {
-        mrl = "cdda://" + ui.deviceCombo->currentText();
+        mrl = "cdda://" + discPath;
         emit methodChanged( "cdda-caching" );
     }
 



More information about the vlc-commits mailing list