[vlc-devel] commit: Qt4: remove PlaylistEventManager (Jakob Leben )
git version control
git at videolan.org
Sat Nov 7 18:52:47 CET 2009
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Sat Nov 7 18:50:05 2009 +0100| [aca7ce705bca23a36afd44091841cbd70b404e02] | committer: Jakob Leben
Qt4: remove PlaylistEventManager
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aca7ce705bca23a36afd44091841cbd70b404e02
---
modules/gui/qt4/components/playlist/playlist.cpp | 51 ----------------------
modules/gui/qt4/components/playlist/playlist.hpp | 30 -------------
2 files changed, 0 insertions(+), 81 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index d9efb89..b91bbcb 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -148,54 +148,3 @@ void PlaylistWidget::closeEvent( QCloseEvent *event )
event->ignore();
}
}
-
-PlaylistEventManager::PlaylistEventManager( playlist_t *_pl )
- : pl( _pl )
-{
- var_AddCallback( pl, "playlist-item-append", itemAddedCb, this );
- var_AddCallback( pl, "playlist-item-deleted", itemRemovedCb, this );
-}
-
-PlaylistEventManager::~PlaylistEventManager()
-{
- var_DelCallback( pl, "playlist-item-append", itemAddedCb, this );
- var_DelCallback( pl, "playlist-item-deleted", itemRemovedCb, this );
-}
-
-int PlaylistEventManager::itemAddedCb
-( vlc_object_t * obj, const char *var, vlc_value_t old, vlc_value_t cur, void *data )
-{
- PlaylistEventManager *p_this = static_cast<PlaylistEventManager*>(data);
- p_this->trigger( cur, ItemAddedEv );
- return VLC_SUCCESS;
-}
-
-int PlaylistEventManager::itemRemovedCb
-( vlc_object_t * obj, const char *var, vlc_value_t old, vlc_value_t cur, void *data )
-{
- PlaylistEventManager *p_this = static_cast<PlaylistEventManager*>(data);
- p_this->trigger( cur, ItemRemovedEv );
- return VLC_SUCCESS;
-}
-
-void PlaylistEventManager::trigger( vlc_value_t val, int type )
-{
- if( type == ItemAddedEv )
- {
- playlist_add_t *p_add = static_cast<playlist_add_t*>( val.p_address );
- QApplication::postEvent( this, new PLEMEvent( type, p_add->i_item, p_add->i_node ) );
- }
- else
- {
- QApplication::postEvent( this, new PLEMEvent( type, val.i_int, 0 ) );
- }
-}
-
-void PlaylistEventManager::customEvent( QEvent *e )
-{
- PLEMEvent *ev = static_cast<PLEMEvent*>(e);
- if( (int) ev->type() == ItemAddedEv )
- emit itemAdded( ev->item, ev->parent );
- else
- emit itemRemoved( ev->item );
-}
diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp
index 850fea0..13aed92 100644
--- a/modules/gui/qt4/components/playlist/playlist.hpp
+++ b/modules/gui/qt4/components/playlist/playlist.hpp
@@ -81,34 +81,4 @@ enum PLEventType {
ItemRemovedEv
};
-class PLEMEvent : public QEvent
-{
-public:
- PLEMEvent( int t, int i, int p )
- : QEvent( (QEvent::Type)t ), item(i), parent(p) {}
- int item;
- int parent;
-};
-
-class PlaylistEventManager : public QObject
-{
- Q_OBJECT;
-
-public:
- PlaylistEventManager( playlist_t* );
- ~PlaylistEventManager();
-
-signals:
- void itemAdded( int i_item, int i_parent );
- void itemRemoved( int i_id );
-
-private:
- static int itemAddedCb ( vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void * );
- static int itemRemovedCb ( vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void * );
- void trigger( vlc_value_t, int );
- void customEvent( QEvent* );
- playlist_t *pl;
-};
#endif
More information about the vlc-devel
mailing list