[vlc-commits] Qt: PLEvent: protect members

Francois Cartegnie git at videolan.org
Fri Aug 17 13:20:10 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 17 13:08:57 2012 +0200| [f6d61f8b8da8b6ad90741add593fcda36d8e84ea] | committer: Francois Cartegnie

Qt: PLEvent: protect members

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f6d61f8b8da8b6ad90741add593fcda36d8e84ea
---

 modules/gui/qt4/input_manager.cpp |    8 ++++----
 modules/gui/qt4/input_manager.hpp |    4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 016e374..01fc0ec 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -1029,19 +1029,19 @@ void MainInputManager::customEvent( QEvent *event )
     {
     case PLEvent::PLItemAppended_Type:
         plEv = static_cast<PLEvent*>( event );
-        emit playlistItemAppended( plEv->i_item, plEv->i_parent );
+        emit playlistItemAppended( plEv->getItemId(), plEv->getParentId() );
         return;
     case PLEvent::PLItemRemoved_Type:
         plEv = static_cast<PLEvent*>( event );
-        emit playlistItemRemoved( plEv->i_item );
+        emit playlistItemRemoved( plEv->getItemId() );
         return;
     case PLEvent::PLEmpty_Type:
         plEv = static_cast<PLEvent*>( event );
-        emit playlistNotEmpty( plEv->i_item >= 0 );
+        emit playlistNotEmpty( plEv->getItemId() >= 0 );
         return;
     case PLEvent::LeafToParent_Type:
         plEv = static_cast<PLEvent*>( event );
-        emit leafBecameParent( plEv->i_item );
+        emit leafBecameParent( plEv->getItemId() );
         return;
     default:
         if( type != ItemChanged_Type ) return;
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 10e9a9e..0067184 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -110,7 +110,9 @@ public:
     };
     PLEvent( PLEventTypes t, int i, int p = 0 )
         : QEvent( (QEvent::Type)(t) ), i_item(i), i_parent(p) {}
-
+    int getItemId() const { return i_item; };
+    int getParentId() const { return i_parent; };
+private:
     /* Needed for "playlist-item*" and "leaf-to-parent" callbacks
      * !! Can be a input_item_t->i_id or a playlist_item_t->i_id */
     int i_item;



More information about the vlc-commits mailing list