[vlc-devel] commit: Qt: get Bookmark events from the core and update in Bookmark dialog . (Jean-Baptiste Kempf )
git version control
git at videolan.org
Fri Jan 2 16:03:04 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jan 2 15:45:27 2009 +0100| [74e842ea7a6f6d4d4e0c5ddf4ed8550edc59369f] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=74e842ea7a6f6d4d4e0c5ddf4ed8550edc59369f
---
modules/gui/qt4/dialogs/bookmarks.cpp | 11 +++--------
modules/gui/qt4/input_manager.cpp | 13 +++++++++----
modules/gui/qt4/input_manager.hpp | 5 +++--
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt4/dialogs/bookmarks.cpp b/modules/gui/qt4/dialogs/bookmarks.cpp
index e834233..0638523 100644
--- a/modules/gui/qt4/dialogs/bookmarks.cpp
+++ b/modules/gui/qt4/dialogs/bookmarks.cpp
@@ -80,6 +80,9 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
layout->setColumnStretch( 1, 1 );
layout->addWidget( closeButton, 7, 2 );
+ CONNECT( THEMIM->getIM(), bookmarksChanged(),
+ this, update() );
+
CONNECT( bookmarksList, activated( QModelIndex ), this,
activateItem( QModelIndex ) );
CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ),
@@ -154,7 +157,6 @@ void BookmarksDialog::add()
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
}
- update();
}
void BookmarksDialog::del()
@@ -168,8 +170,6 @@ void BookmarksDialog::del()
{
input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
}
-
- update();
}
void BookmarksDialog::clear()
@@ -178,8 +178,6 @@ void BookmarksDialog::clear()
if( !p_input ) return;
input_Control( p_input, INPUT_CLEAR_BOOKMARKS );
-
- update();
}
void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
@@ -239,9 +237,6 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
VLC_SUCCESS )
goto clear;
- // Everything goes fine : update
- update();
-
// Clear the bookmark list
clear:
for( int i = 0; i < i_bookmarks; i++)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index e41895d..48c9804 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -165,7 +165,8 @@ void InputManager::customEvent( QEvent *event )
i_type != NameChanged_Type &&
i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type &&
- i_type != CachingEvent_Type )
+ i_type != CachingEvent_Type &&
+ i_type != BookmarksChanged_Type )
return;
if( i_type == CachingEvent_Type )
@@ -183,7 +184,8 @@ void InputManager::customEvent( QEvent *event )
i_type != MetaChanged_Type &&
i_type != NameChanged_Type &&
i_type != InfoChanged_Type &&
- i_type != SynchroChanged_Type
+ i_type != SynchroChanged_Type &&
+ i_type != BookmarksChanged_Type
)
&& ( i_input_id != ple->i_id ) )
return;
@@ -248,6 +250,9 @@ void InputManager::customEvent( QEvent *event )
case CachingEvent_Type:
UpdateCaching();
break;
+ case BookmarksChanged_Type:
+ emit bookmarksChanged();
+ break;
default:
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 *,
break;
case INPUT_EVENT_BOOKMARK:
- /* event = new IMEvent( BookmarkChanged_Type, 0 );
- break; */
+ event = new IMEvent( BookmarksChanged_Type, 0 );
+ break;
case INPUT_EVENT_PROGRAM:
/* event = new IMEvent( ProgramChanged_Type, 0 );
break; */
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 35c1de9..f3356ee 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -53,8 +53,8 @@ enum {
InfoChanged_Type,
SynchroChanged_Type,
CachingEvent_Type,
-/* BookmarkChanged_Type,
- RecordingEvent_Type,
+ BookmarksChanged_Type,
+/* RecordingEvent_Type,
ProgramChanged_Type,
SignalChanged_Type, */
@@ -180,6 +180,7 @@ signals:
/// Vout
void voutChanged( bool );
void synchroChanged();
+ void bookmarksChanged();
void cachingChanged( float );
};
More information about the vlc-devel
mailing list