Commit dcce0350 authored by Geoffroy Couprie's avatar Geoffroy Couprie

Win32: get rid of calls to GetVersion (CoCreateInstance will fail anyway if...

Win32: get rid of calls to GetVersion (CoCreateInstance will fail anyway if the feature is not present)
parent c84c86d4
...@@ -239,10 +239,7 @@ void VideoWidget::release( void ) ...@@ -239,10 +239,7 @@ void VideoWidget::release( void )
#ifdef WIN32 #ifdef WIN32
/* Come back to default thumbnail for Windows 7 taskbar */ /* Come back to default thumbnail for Windows 7 taskbar */
LPTASKBARLIST3 p_taskbl; LPTASKBARLIST3 p_taskbl;
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
{
CoInitialize( 0 ); CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList, if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
...@@ -260,7 +257,7 @@ void VideoWidget::release( void ) ...@@ -260,7 +257,7 @@ void VideoWidget::release( void )
p_taskbl->vt->Release(p_taskbl); p_taskbl->vt->Release(p_taskbl);
} }
CoUninitialize(); CoUninitialize();
}
#endif #endif
delete reparentable; delete reparentable;
......
...@@ -859,11 +859,6 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current, ...@@ -859,11 +859,6 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
void SPrefsPanel::assoDialog() void SPrefsPanel::assoDialog()
{ {
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
//Vista specific file associations
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
{
LPAPPASSOCREGUI p_appassoc; LPAPPASSOCREGUI p_appassoc;
CoInitialize( 0 ); CoInitialize( 0 );
...@@ -880,7 +875,7 @@ void SPrefsPanel::assoDialog() ...@@ -880,7 +875,7 @@ void SPrefsPanel::assoDialog()
} }
CoUninitialize(); CoUninitialize();
}
QDialog *d = new QDialog( this ); QDialog *d = new QDialog( this );
QGridLayout *assoLayout = new QGridLayout( d ); QGridLayout *assoLayout = new QGridLayout( d );
......
...@@ -519,10 +519,16 @@ void MainInterface::createTaskBarButtons() ...@@ -519,10 +519,16 @@ void MainInterface::createTaskBarButtons()
FIXME:We need pretty buttons in 16x16 px that are handled correctly by masks in Qt FIXME:We need pretty buttons in 16x16 px that are handled correctly by masks in Qt
FIXME:the play button's picture doesn't changed to pause when clicked FIXME:the play button's picture doesn't changed to pause when clicked
*/ */
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); CoInitialize( 0 );
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3,
(void **)&p_taskbl) )
{ {
p_taskbl->vt->HrInit(p_taskbl);
if(himl = ImageList_Create( 15, //cx if(himl = ImageList_Create( 15, //cx
18, //cy 18, //cy
ILC_COLOR,//flags ILC_COLOR,//flags
...@@ -549,15 +555,6 @@ void MainInterface::createTaskBarButtons() ...@@ -549,15 +555,6 @@ void MainInterface::createTaskBarButtons()
msg_Err( p_intf, "ImageList_Add failed" ); msg_Err( p_intf, "ImageList_Add failed" );
} }
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3,
(void **)&p_taskbl) )
{
p_taskbl->vt->HrInit(p_taskbl);
// Define an array of two buttons. These buttons provide images through an // Define an array of two buttons. These buttons provide images through an
// image list and also provide tooltips. // image list and also provide tooltips.
DWORD dwMask = THB_BITMAP | THB_FLAGS; DWORD dwMask = THB_BITMAP | THB_FLAGS;
...@@ -589,12 +586,12 @@ void MainInterface::createTaskBarButtons() ...@@ -589,12 +586,12 @@ void MainInterface::createTaskBarButtons()
} }
CONNECT( THEMIM->getIM(), statusChanged( int ), this, changeThumbbarButtons( int ) ); CONNECT( THEMIM->getIM(), statusChanged( int ), this, changeThumbbarButtons( int ) );
} }
}
else else
{ {
himl = NULL; himl = NULL;
p_taskbl = NULL; p_taskbl = NULL;
} }
} }
bool MainInterface::winEvent ( MSG * msg, long * result ) bool MainInterface::winEvent ( MSG * msg, long * result )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment