Commit b8ed3905 authored by gbazin's avatar gbazin

* modules/gui/wxwindows/wxwindows.cpp: include setlocale.h after the vlc headers.
* modules/gui/wxwindows/menus.cpp: fixed memory leaks.
* modules/gui/wxwindows/playlist.cpp: fixed deadlock.
parent 1babb275
......@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id: menus.cpp,v 1.32 2004/02/26 00:23:04 gbazin Exp $
* $Id: menus.cpp,v 1.33 2004/02/26 12:04:14 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -531,8 +531,6 @@ void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
/* Get the descriptive name of the variable */
var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
var_Get( p_object, psz_var, &val );
if( i_type & VLC_VAR_HASCHOICE )
{
menu->Append( MenuDummy_Event,
......@@ -548,6 +546,7 @@ void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
switch( i_type & VLC_VAR_TYPE )
{
case VLC_VAR_VOID:
var_Get( p_object, psz_var, &val );
menuitem = new wxMenuItemExt( menu, ++i_item_id,
wxU(text.psz_string ?
text.psz_string : psz_var),
......@@ -557,6 +556,7 @@ void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
break;
case VLC_VAR_BOOL:
var_Get( p_object, psz_var, &val );
val.b_bool = !val.b_bool;
menuitem = new wxMenuItemExt( menu, ++i_item_id,
wxU(text.psz_string ?
......@@ -566,13 +566,8 @@ void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
menu->Append( menuitem );
Check( i_item_id, val.b_bool ? FALSE : TRUE );
break;
default:
if( text.psz_string ) free( text.psz_string );
return;
}
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
}
......@@ -601,15 +596,9 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
return NULL;
}
if( var_Get( p_object, psz_var, &val ) < 0 )
{
return NULL;
}
if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
&val_list, &text_list ) < 0 )
{
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
return NULL;
}
......@@ -632,6 +621,8 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
break;
case VLC_VAR_STRING:
var_Get( p_object, psz_var, &val );
another_val.psz_string =
strdup(val_list.p_list->p_values[i].psz_string);
menuitem =
......@@ -646,13 +637,17 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
menu->Append( menuitem );
if( !(i_type & VLC_VAR_ISCOMMAND) &&
if( !(i_type & VLC_VAR_ISCOMMAND) && val.psz_string &&
!strcmp( val.psz_string,
val_list.p_list->p_values[i].psz_string ) )
menu->Check( i_item_id, TRUE );
if( val.psz_string ) free( val.psz_string );
break;
case VLC_VAR_INTEGER:
var_Get( p_object, psz_var, &val );
menuitem =
new wxMenuItemExt( menu, ++i_item_id,
text_list.p_list->p_values[i].psz_string ?
......@@ -679,7 +674,6 @@ wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
}
/* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
return menu;
......
......@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id: playlist.cpp,v 1.45 2004/02/26 08:24:29 gbazin Exp $
* $Id: playlist.cpp,v 1.46 2004/02/26 12:04:14 gbazin Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......@@ -541,11 +541,11 @@ void Playlist::UpdatePlaylist()
}
/* Update the colour of items */
vlc_mutex_lock( &p_playlist->object_lock );
if( p_intf->p_sys->i_playing != p_playlist->i_index )
int i_playlist_index = p_playlist->i_index;
if( p_intf->p_sys->i_playing != i_playlist_index )
{
wxListItem listitem;
listitem.m_itemId = p_playlist->i_index;
listitem.m_itemId = i_playlist_index;
listitem.SetTextColour( *wxRED );
listview->SetItem( listitem );
......@@ -555,9 +555,8 @@ void Playlist::UpdatePlaylist()
listitem.SetTextColour( *wxBLACK );
listview->SetItem( listitem );
}
p_intf->p_sys->i_playing = p_playlist->i_index;
p_intf->p_sys->i_playing = i_playlist_index;
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
......
......@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id: wxwindows.cpp,v 1.38 2004/01/25 03:29:02 hartman Exp $
* $Id: wxwindows.cpp,v 1.39 2004/02/26 12:04:14 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -29,13 +29,13 @@
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "wxwindows.h"
/* Temporary hack */
......
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