]> git.sesse.net Git - vlc/commitdiff
Qt4 - Disc probing under Windows in open. Patch By Hannes Domani
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 17 Sep 2007 17:29:30 +0000 (17:29 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 17 Sep 2007 17:29:30 +0000 (17:29 +0000)
modules/gui/qt4/components/open.cpp

index f91ff544706038fdd9e08f54deea4650783eb1a9..76a959b14d671c824745473926392b62f24d6add 100644 (file)
@@ -250,7 +250,24 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 {
     ui.setupUi( this );
 
-    /*Win 32 Probe  as in WX ? */
+#if WIN32 /* Disc drives probing for Windows */
+    char szDrives[512];
+    szDrives[0] = '\0';
+    if( GetLogicalDriveStringsA( sizeof( szDrives ) - 1, szDrives ) )
+    {
+        char *drive = szDrives;
+        UINT oldMode = SetErrorMode( SEM_FAILCRITICALERRORS );
+        while( *drive )
+        {
+            if( GetDriveTypeA(drive) == DRIVE_CDROM )
+                ui.deviceCombo->addItem( drive );
+
+            /* go to next drive */
+            while( *(drive++) );
+        }
+        SetErrorMode(oldMode);
+    }
+#endif /* Disc Probing under Windows */
 
     /* CONNECTs */
     BUTTONACT( ui.dvdRadioButton, updateButtons());