1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

PDA Interface:

- Fixed a p_playlist refcount problem
- Clearing VLC playlist and Playlist widget.
This commit is contained in:
Jean-Paul Saman 2003-11-25 20:41:35 +00:00
parent 66a7953074
commit 92bbd4ea05
2 changed files with 39 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.10 2003/11/21 09:23:49 jpsaman Exp $
* $Id: pda.c,v 1.11 2003/11/25 20:41:35 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org>
@ -436,6 +436,7 @@ static int Manage( intf_thread_t *p_intf )
PlaylistRebuildListStore(p_liststore, p_playlist);
msg_Dbg(p_intf, "Manage: Updating GtkTreeView Playlist" );
gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
vlc_object_release( p_playlist );
}
}

View File

@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.16 2003/11/25 20:01:08 jpsaman Exp $
* $Id: pda_callbacks.c,v 1.17 2003/11/25 20:41:35 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
@ -124,19 +124,20 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name)
#if 0
if (p_intf->p_sys->b_autoplayfile)
{
playlist_Add( p_playlist, (char*)name, 0, 0,
playlist_Add( p_playlist, (const char*)name, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END);
}
else
{
playlist_Add( p_playlist, (char*)name, 0, 0,
playlist_Add( p_playlist, (const char*)name, 0, 0,
PLAYLIST_APPEND, PLAYLIST_END );
}
#endif
vlc_object_release( p_playlist );
msg_Dbg( p_intf, "done");
}
}
vlc_object_release( p_playlist );
}
void PlaylistRebuildListStore( GtkListStore * p_list, playlist_t * p_playlist )
@ -767,8 +768,39 @@ onClearPlaylist (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
GtkTreeView *p_tvplaylist;
int item;
msg_Dbg(p_intf, "Clear playlist" );
msg_Dbg(p_intf, "Clear VLC playlist" );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
for(item = p_playlist->i_size - 1 ; item >= 0 ; item-- )
{
playlist_Delete( p_playlist, item);
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
// Remove all entries from the Playlist widget.
msg_Dbg(p_intf, "Clear playlist widget" );
p_tvplaylist = (GtkTreeView*) lookup_widget( GTK_WIDGET(button), "tvPlaylist");
if (p_tvplaylist)
{
GtkTreeModel *p_play_model;
p_play_model = gtk_tree_view_get_model(p_tvplaylist);
if (p_play_model)
{
gtk_list_store_clear(GTK_LIST_STORE(p_play_model));
}
}
}