]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/simple_preferences.cpp
qt4: fix duplicate symbol
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
index 0f0476794746d8ea232cf969a5d4a9c92dbfc8fd..2a93bb0bee0d5c23254c7ad06c302f256429ce47 100644 (file)
@@ -44,6 +44,7 @@
 #include <QSettings>
 #include <QtAlgorithms>
 #include <QDir>
+#include <assert.h>
 #include <math.h>
 
 #define ICON_HEIGHT 48
@@ -207,7 +208,7 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
         return -1;
     else
 #ifdef __APPLE__
-    if (!strcmp("auhal") && module_exists("auhal"))
+    if (!strcmp(aout, "auhal") && module_exists("auhal"))
         return (config_GetFloat(obj, "auhal-volume") * 100.f + .5f)
                  / AOUT_VOLUME_DEFAULT;
     else
@@ -1239,37 +1240,42 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
     return b_temp;
 }
 
-void SPrefsPanel::assoDialog()
-{
 #if !defined(__IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__)
 #define __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
     const GUID IID_IApplicationAssociationRegistrationUI = {0x1f76a169,0xf994,0x40ac, {0x8f,0xc8,0x09,0x59,0xe8,0x87,0x47,0x10}};
-    const GUID CLSID_ApplicationAssociationRegistrationUI = { 0x1968106d,0xf3b5,0x44cf,{0x89,0x0e,0x11,0x6f,0xcb,0x9e,0xce,0xf1}};
-#ifdef __cplusplus
+    extern const GUID CLSID_ApplicationAssociationRegistrationUI;
     interface IApplicationAssociationRegistrationUI : public IUnknown
     {
         virtual HRESULT STDMETHODCALLTYPE LaunchAdvancedAssociationUI(
                 LPCWSTR pszAppRegName) = 0;
     };
-#endif /* __cplusplus */
 #endif /* __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__ */
 
-    IApplicationAssociationRegistrationUI *p_appassoc;
-    CoInitializeEx( NULL, COINIT_MULTITHREADED );
+void SPrefsPanel::assoDialog()
+{
+    HRESULT hr;
 
-    if( S_OK == CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
-                NULL, CLSCTX_INPROC_SERVER,
-                IID_IApplicationAssociationRegistrationUI,
-                (void **)&p_appassoc) )
+    hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
+    if( SUCCEEDED(hr) )
     {
-        if(S_OK == p_appassoc->LaunchAdvancedAssociationUI(L"VLC" ) )
+        void *p;
+
+        hr = CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
+                              NULL, CLSCTX_INPROC_SERVER,
+                              IID_IApplicationAssociationRegistrationUI, &p);
+        if( SUCCEEDED(hr) )
         {
-            CoUninitialize();
-            return;
+            IApplicationAssociationRegistrationUI *p_regui =
+                (IApplicationAssociationRegistrationUI *)p;
+
+            hr = p_regui->LaunchAdvancedAssociationUI(L"VLC" );
+            p_regui->Release();
         }
+        CoUninitialize();
     }
 
-    CoUninitialize();
+    if( SUCCEEDED(hr) )
+        return;
 
     QDialog *d = new QDialog( this );
     d->setWindowTitle( qtr( "File associations" ) );