[vlc-devel] commit: Qt4: remove i_input_id from PLItem (Ilkka Ollakka )
git version control
git at videolan.org
Fri Aug 14 18:16:59 CEST 2009
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Fri Aug 14 13:56:58 2009 +0300| [1950858c4d973b2cbaeaa8e4b43d761ef4e30ec8] | committer: Ilkka Ollakka
Qt4: remove i_input_id from PLItem
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1950858c4d973b2cbaeaa8e4b43d761ef4e30ec8
---
.../gui/qt4/components/playlist/playlist_item.cpp | 3 +--
.../gui/qt4/components/playlist/playlist_item.hpp | 1 -
.../gui/qt4/components/playlist/playlist_model.cpp | 19 ++++++++++---------
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_item.cpp b/modules/gui/qt4/components/playlist/playlist_item.cpp
index f0c1414..694fcaf 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.cpp
@@ -52,7 +52,6 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent, PLModel *m,
{
parentItem = parent; /* Can be NULL, but only for the rootItem */
i_id = _playlist_item->i_id; /* Playlist item specific id */
- i_input_id = _playlist_item->p_input->i_id; /* Identifier of the input */
model = m; /* PLModel (QAbsmodel) */
i_type = -1; /* Item type - Avoid segfault */
b_current = false; /* Is the item the current Item or not */
@@ -142,7 +141,7 @@ int PLItem::row() const
/* update the PL Item, get the good names and so on */
void PLItem::update( playlist_item_t *p_item, bool iscurrent )
{
- assert( p_item->p_input->i_id == i_input_id );
+ assert( p_item->p_input == p_input);
/* Useful for the model */
i_type = p_item->p_input->i_type;
diff --git a/modules/gui/qt4/components/playlist/playlist_item.hpp b/modules/gui/qt4/components/playlist/playlist_item.hpp
index 74d83fb..48fd164 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.hpp
@@ -66,7 +66,6 @@ protected:
bool b_current;
int i_type;
int i_id;
- int i_input_id;
int i_showflags;
bool b_is_node;
input_item_t *p_input;
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 4a0ecd4..b2afe6b 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -121,21 +121,21 @@ Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
static_cast<PLItem*>( index.internalPointer() ) :
rootItem;
- int pl_input_id = p_playlist->p_local_category->p_input->i_id;
- int ml_input_id = p_playlist->p_ml_category->p_input->i_id;
+ input_item_t *pl_input = p_playlist->p_local_category->p_input;
+ input_item_t *ml_input = p_playlist->p_ml_category->p_input;
if( rootItem->i_id == p_playlist->p_root_onelevel->i_id
|| rootItem->i_id == p_playlist->p_root_category->i_id )
{
- if( item->i_input_id == pl_input_id
- || item->i_input_id == ml_input_id )
+ if( item->p_input == pl_input
+ || item->p_input == ml_input)
flags |= Qt::ItemIsDropEnabled;
}
else
{
if ( item->b_is_node &&
- ( rootItem->i_input_id == pl_input_id ||
- rootItem->i_input_id == ml_input_id ) )
+ ( rootItem->p_input == pl_input ||
+ rootItem->p_input == ml_input ) )
flags |= Qt::ItemIsDropEnabled;
flags |= Qt::ItemIsDragEnabled;
}
@@ -561,7 +561,8 @@ PLItem *PLModel::FindById( PLItem *root, int i_id )
PLItem *PLModel::FindByInput( PLItem *root, int i_id )
{
- return FindInner( root, i_id, true );
+ PLItem *result = FindInner( root, i_id, true );
+ return result;
}
#define CACHE( i, p ) { i_cached_id = i; p_cached_item = p; }
@@ -580,7 +581,7 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input )
CACHE( i_id, root );
return root;
}
- else if( b_input && root->i_input_id == i_id )
+ else if( b_input && root->p_input->i_id == i_id )
{
ICACHE( i_id, root );
return root;
@@ -594,7 +595,7 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input )
CACHE( i_id, (*it) );
return p_cached_item;
}
- else if( b_input && (*it)->i_input_id == i_id )
+ else if( b_input && (*it)->p_input->i_id == i_id )
{
ICACHE( i_id, (*it) );
return p_cached_item_bi;
More information about the vlc-devel
mailing list