[vlc-commits] Qt: InputManager: Namespace PLEvent types.
Francois Cartegnie
git at videolan.org
Thu Aug 16 15:30:02 CEST 2012
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Aug 16 15:28:29 2012 +0200| [cafb8e307e09abbba575e84a8656b80499f86de1] | committer: Francois Cartegnie
Qt: InputManager: Namespace PLEvent types.
Pointed out that LeafToParent_Type was misused.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cafb8e307e09abbba575e84a8656b80499f86de1
---
modules/gui/qt4/input_manager.cpp | 18 +++++++++---------
modules/gui/qt4/input_manager.hpp | 17 ++++++++---------
2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index ac0311a..f010cca 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -1027,19 +1027,19 @@ void MainInputManager::customEvent( QEvent *event )
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
switch( type )
{
- case PLItemAppended_Type:
+ case PLEvent::PLItemAppended_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistItemAppended( plEv->i_item, plEv->i_parent );
return;
- case PLItemRemoved_Type:
+ case PLEvent::PLItemRemoved_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistItemRemoved( plEv->i_item );
return;
- case PLEmpty_Type:
+ case PLEvent::PLEmpty_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistNotEmpty( plEv->i_item >= 0 );
return;
- case LeafToParent_Type:
+ case PLEvent::LeafToParent_Type:
plEv = static_cast<PLEvent*>( event );
emit leafBecameParent( plEv->i_item );
return;
@@ -1226,7 +1226,7 @@ static int LeafToParent( vlc_object_t *p_this, const char *psz_var,
VLC_UNUSED( p_this ); VLC_UNUSED( psz_var ); VLC_UNUSED( oldval );
MainInputManager *mim = (MainInputManager*)param;
- PLEvent *event = new PLEvent( LeafToParent_Type, newval.i_int );
+ PLEvent *event = new PLEvent( PLEvent::LeafToParent_Type, newval.i_int );
QApplication::postEvent( mim, event );
return VLC_SUCCESS;
@@ -1249,9 +1249,9 @@ static int PLItemAppended
MainInputManager *mim = static_cast<MainInputManager*>(data);
playlist_add_t *p_add = static_cast<playlist_add_t*>( cur.p_address );
- PLEvent *event = new PLEvent( PLItemAppended_Type, p_add->i_item, p_add->i_node );
+ PLEvent *event = new PLEvent( PLEvent::PLItemAppended_Type, p_add->i_item, p_add->i_node );
QApplication::postEvent( mim, event );
- event = new PLEvent( PLEmpty_Type, p_add->i_item, 0 );
+ event = new PLEvent( PLEvent::PLEmpty_Type, p_add->i_item, 0 );
QApplication::postEvent( mim, event );
return VLC_SUCCESS;
}
@@ -1263,12 +1263,12 @@ static int PLItemRemoved
playlist_t *pl = (playlist_t *) obj;
MainInputManager *mim = static_cast<MainInputManager*>(data);
- PLEvent *event = new PLEvent( PLItemRemoved_Type, cur.i_int, 0 );
+ PLEvent *event = new PLEvent( PLEvent::PLItemRemoved_Type, cur.i_int, 0 );
QApplication::postEvent( mim, event );
// can't use playlist_IsEmpty( ) as it isn't true yet
if ( pl->items.i_size == 1 ) // lock is held
{
- event = new PLEvent( PLEmpty_Type, -1, 0 );
+ event = new PLEvent( PLEvent::PLEmpty_Type, -1, 0 );
QApplication::postEvent( mim, event );
}
return VLC_SUCCESS;
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index b2d63cf..1a6207c 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -60,7 +60,6 @@ enum {
ProgramChanged_Type,
RandomChanged_Type,
LoopOrRepeatChanged_Type,
- LeafToParent_Type,
EPGEvent_Type,
/* SignalChanged_Type, */
@@ -104,17 +103,17 @@ private:
input_item_t *p_item;
};
-enum PLEventTypes
-{
- PLItemAppended_Type = QEvent::User + PLEventType + 1,
- PLItemRemoved_Type,
- PLEmpty_Type
-};
-
class PLEvent : public QEvent
{
public:
- PLEvent( int t, int i, int p = 0 )
+ enum PLEventTypes
+ {
+ PLItemAppended_Type = QEvent::User + PLEventType + 1,
+ PLItemRemoved_Type,
+ LeafToParent_Type,
+ PLEmpty_Type
+ };
+ PLEvent( PLEventTypes t, int i, int p = 0 )
: QEvent( (QEvent::Type)(t) ), i_item(i), i_parent(p) {}
/* Needed for "playlist-item*" and "leaf-to-parent" callbacks
More information about the vlc-commits
mailing list