Commit 74e842ea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: get Bookmark events from the core and update in Bookmark dialog.

This remove the update() calls from within the bookmark dialog, since the update() is triggered from the core.
This needs more testing.
parent c2af399f
...@@ -80,6 +80,9 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -80,6 +80,9 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
layout->setColumnStretch( 1, 1 ); layout->setColumnStretch( 1, 1 );
layout->addWidget( closeButton, 7, 2 ); layout->addWidget( closeButton, 7, 2 );
CONNECT( THEMIM->getIM(), bookmarksChanged(),
this, update() );
CONNECT( bookmarksList, activated( QModelIndex ), this, CONNECT( bookmarksList, activated( QModelIndex ), this,
activateItem( QModelIndex ) ); activateItem( QModelIndex ) );
CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ), CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ),
...@@ -154,7 +157,6 @@ void BookmarksDialog::add() ...@@ -154,7 +157,6 @@ void BookmarksDialog::add()
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark ); input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
} }
update();
} }
void BookmarksDialog::del() void BookmarksDialog::del()
...@@ -168,8 +170,6 @@ void BookmarksDialog::del() ...@@ -168,8 +170,6 @@ void BookmarksDialog::del()
{ {
input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused ); input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
} }
update();
} }
void BookmarksDialog::clear() void BookmarksDialog::clear()
...@@ -178,8 +178,6 @@ void BookmarksDialog::clear() ...@@ -178,8 +178,6 @@ void BookmarksDialog::clear()
if( !p_input ) return; if( !p_input ) return;
input_Control( p_input, INPUT_CLEAR_BOOKMARKS ); input_Control( p_input, INPUT_CLEAR_BOOKMARKS );
update();
} }
void BookmarksDialog::edit( QTreeWidgetItem *item, int column ) void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
...@@ -239,9 +237,6 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column ) ...@@ -239,9 +237,6 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
VLC_SUCCESS ) VLC_SUCCESS )
goto clear; goto clear;
// Everything goes fine : update
update();
// Clear the bookmark list // Clear the bookmark list
clear: clear:
for( int i = 0; i < i_bookmarks; i++) for( int i = 0; i < i_bookmarks; i++)
......
...@@ -165,7 +165,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -165,7 +165,8 @@ void InputManager::customEvent( QEvent *event )
i_type != NameChanged_Type && i_type != NameChanged_Type &&
i_type != InfoChanged_Type && i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type && i_type != SynchroChanged_Type &&
i_type != CachingEvent_Type ) i_type != CachingEvent_Type &&
i_type != BookmarksChanged_Type )
return; return;
if( i_type == CachingEvent_Type ) if( i_type == CachingEvent_Type )
...@@ -183,7 +184,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -183,7 +184,8 @@ void InputManager::customEvent( QEvent *event )
i_type != MetaChanged_Type && i_type != MetaChanged_Type &&
i_type != NameChanged_Type && i_type != NameChanged_Type &&
i_type != InfoChanged_Type && i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type i_type != SynchroChanged_Type &&
i_type != BookmarksChanged_Type
) )
&& ( i_input_id != ple->i_id ) ) && ( i_input_id != ple->i_id ) )
return; return;
...@@ -248,6 +250,9 @@ void InputManager::customEvent( QEvent *event ) ...@@ -248,6 +250,9 @@ void InputManager::customEvent( QEvent *event )
case CachingEvent_Type: case CachingEvent_Type:
UpdateCaching(); UpdateCaching();
break; break;
case BookmarksChanged_Type:
emit bookmarksChanged();
break;
default: default:
msg_Warn( p_intf, "This shouldn't happen: %i", i_type ); msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
} }
...@@ -837,8 +842,8 @@ static int InputEvent( vlc_object_t *p_this, const char *, ...@@ -837,8 +842,8 @@ static int InputEvent( vlc_object_t *p_this, const char *,
break; break;
case INPUT_EVENT_BOOKMARK: case INPUT_EVENT_BOOKMARK:
/* event = new IMEvent( BookmarkChanged_Type, 0 ); event = new IMEvent( BookmarksChanged_Type, 0 );
break; */ break;
case INPUT_EVENT_PROGRAM: case INPUT_EVENT_PROGRAM:
/* event = new IMEvent( ProgramChanged_Type, 0 ); /* event = new IMEvent( ProgramChanged_Type, 0 );
break; */ break; */
......
...@@ -53,8 +53,8 @@ enum { ...@@ -53,8 +53,8 @@ enum {
InfoChanged_Type, InfoChanged_Type,
SynchroChanged_Type, SynchroChanged_Type,
CachingEvent_Type, CachingEvent_Type,
/* BookmarkChanged_Type, BookmarksChanged_Type,
RecordingEvent_Type, /* RecordingEvent_Type,
ProgramChanged_Type, ProgramChanged_Type,
SignalChanged_Type, */ SignalChanged_Type, */
...@@ -180,6 +180,7 @@ signals: ...@@ -180,6 +180,7 @@ signals:
/// Vout /// Vout
void voutChanged( bool ); void voutChanged( bool );
void synchroChanged(); void synchroChanged();
void bookmarksChanged();
void cachingChanged( float ); void cachingChanged( float );
}; };
......
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