1 /*****************************************************************************
2 * playlist_model.cpp : Manage playlist model
3 ****************************************************************************
4 * Copyright (C) 2006-2007 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Ilkka Ollakkka <ileoo (at) videolan dot org>
9 * Jakob Leben <jleben@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
31 #include "dialogs_provider.hpp"
32 #include "components/playlist/playlist_model.hpp"
33 #include "dialogs/mediainfo.hpp"
34 #include "dialogs/playlist.hpp"
35 #include <vlc_intf_strings.h>
37 #include "pixmaps/types/type_unknown.xpm"
43 #include <QApplication>
48 QIcon PLModel::icons[ITEM_TYPE_NUMBER];
50 /*************************************************************************
51 * Playlist model implementation
52 *************************************************************************/
55 This model is called two times, for the selector and the standard panel
57 PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
58 intf_thread_t *_p_intf, /* main Qt p_intf */
59 playlist_item_t * p_root,
60 QObject *parent ) /* Basic Qt parent */
61 : QAbstractItemModel( parent )
64 p_playlist = _p_playlist;
66 i_cached_input_id = -1;
67 i_popup_item = i_popup_parent = -1;
69 rootItem = NULL; /* PLItem rootItem, will be set in rebuild( ) */
71 /* Icons initialization */
72 #define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( x )
73 ADD_ICON( UNKNOWN , type_unknown_xpm );
74 ADD_ICON( FILE, ":/type/file" );
75 ADD_ICON( DIRECTORY, ":/type/directory" );
76 ADD_ICON( DISC, ":/type/disc" );
77 ADD_ICON( CDDA, ":/type/cdda" );
78 ADD_ICON( CARD, ":/type/capture-card" );
79 ADD_ICON( NET, ":/type/net" );
80 ADD_ICON( PLAYLIST, ":/type/playlist" );
81 ADD_ICON( NODE, ":/type/node" );
84 rebuild( p_root, true );
85 CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
86 this, processInputItemUpdate( input_item_t *) );
87 CONNECT( THEMIM, inputChanged( input_thread_t * ),
88 this, processInputItemUpdate( input_thread_t* ) );
89 CONNECT( THEMIM, playlistItemAppended( int, int ),
90 this, processItemAppend( int, int ) );
91 CONNECT( THEMIM, playlistItemRemoved( int ),
92 this, processItemRemoval( int ) );
100 Qt::DropActions PLModel::supportedDropActions() const
102 return Qt::CopyAction; /* Why not Qt::MoveAction */
105 Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
107 Qt::ItemFlags flags = QAbstractItemModel::flags( index );
109 PLItem *item = index.isValid() ? getItem( index ) : rootItem;
114 playlist_item_t *plItem =
115 playlist_ItemGetById( p_playlist, item->i_id );
117 if ( plItem && ( plItem->i_children > -1 ) )
118 flags |= Qt::ItemIsDropEnabled;
123 flags |= Qt::ItemIsDragEnabled;
128 QStringList PLModel::mimeTypes() const
131 types << "vlc/qt-playlist-item";
135 QMimeData *PLModel::mimeData( const QModelIndexList &indexes ) const
137 QMimeData *mimeData = new QMimeData();
138 QByteArray encodedData;
139 QDataStream stream( &encodedData, QIODevice::WriteOnly );
140 QModelIndexList list;
142 foreach( const QModelIndex &index, indexes ) {
143 if( index.isValid() && index.column() == 0 )
149 foreach( const QModelIndex &index, list ) {
150 PLItem *item = getItem( index );
151 stream.writeRawData( (char*) &item, sizeof( PLItem* ) );
153 mimeData->setData( "vlc/qt-playlist-item", encodedData );
158 bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
159 int row, int column, const QModelIndex &parent )
161 if( data->hasFormat( "vlc/qt-playlist-item" ) )
163 if( action == Qt::IgnoreAction )
166 PLItem *parentItem = parent.isValid() ? getItem( parent ) : rootItem;
169 playlist_item_t *p_parent =
170 playlist_ItemGetById( p_playlist, parentItem->i_id );
171 if( !p_parent || p_parent->i_children == -1 )
178 playlist_item_t *p_pl = p_playlist->p_playing;
179 playlist_item_t *p_ml = p_playlist->p_media_library;
183 ( p_pl && p_parent == p_pl ) ||
184 ( p_ml && p_parent == p_ml ) )
189 QByteArray encodedData = data->data( "vlc/qt-playlist-item" );
191 dropAppendCopy( encodedData, parentItem );
193 dropMove( encodedData, parentItem, row );
198 void PLModel::dropAppendCopy( QByteArray& data, PLItem *target )
200 QDataStream stream( &data, QIODevice::ReadOnly );
203 playlist_item_t *p_parent =
204 playlist_ItemGetById( p_playlist, target->i_id );
205 while( !stream.atEnd() )
208 stream.readRawData( (char*)&item, sizeof(PLItem*) );
209 playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item->i_id );
210 if( !p_item ) continue;
211 input_item_t *p_input = p_item->p_input;
212 playlist_AddExt ( p_playlist,
213 p_input->psz_uri, p_input->psz_name,
214 PLAYLIST_APPEND | PLAYLIST_SPREPARSE, PLAYLIST_END,
216 p_input->i_options, p_input->ppsz_options, p_input->optflagc,
217 p_parent == p_playlist->p_playing,
223 void PLModel::dropMove( QByteArray& data, PLItem *target, int row )
225 QDataStream stream( &data, QIODevice::ReadOnly );
226 QList<PLItem*> model_items;
228 int new_pos = row == -1 ? target->children.size() : row;
229 int model_pos = new_pos;
230 while( !stream.atEnd() )
233 stream.readRawData( (char*)&item, sizeof(PLItem*) );
235 /* better not try to move a node into itself: */
236 PLItem *climber = target;
239 if( climber == item ) break;
240 climber = climber->parentItem;
242 if( climber ) continue;
244 if( item->parentItem == target &&
245 target->children.indexOf( item ) < model_pos )
248 ids.append( item->i_id );
249 model_items.append( item );
253 int count = ids.size();
256 playlist_item_t *pp_items[count];
259 for( int i = 0; i < count; i++ )
261 playlist_item_t *p_item = playlist_ItemGetById( p_playlist, ids[i] );
267 pp_items[i] = p_item;
269 playlist_item_t *p_parent =
270 playlist_ItemGetById( p_playlist, target->i_id );
271 playlist_TreeMoveMany( p_playlist, count, pp_items, p_parent,
275 insertChildren( target, model_items, model_pos );
279 /* remove item with its id */
280 void PLModel::removeItem( int i_id )
282 PLItem *item = findById( rootItem, i_id );
286 void PLModel::activateItem( const QModelIndex &index )
288 assert( index.isValid() );
289 PLItem *item = getItem( index );
292 playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item->i_id );
293 activateItem( p_item );
297 /* Must be entered with lock */
298 void PLModel::activateItem( playlist_item_t *p_item )
300 if( !p_item ) return;
301 playlist_item_t *p_parent = p_item;
304 if( p_parent->i_id == rootItem->i_id ) break;
305 p_parent = p_parent->p_parent;
308 playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked,
312 /****************** Base model mandatory implementations *****************/
313 QVariant PLModel::data( const QModelIndex &index, int role ) const
315 if( !index.isValid() ) return QVariant();
316 PLItem *item = getItem( index );
317 if( role == Qt::DisplayRole )
319 int metadata = columnToMeta( index.column() );
320 if( metadata == COLUMN_END ) return QVariant();
323 if( metadata == COLUMN_NUMBER )
324 returninfo = QString::number( index.row() + 1 );
327 char *psz = psz_column_meta( item->p_input, metadata );
328 returninfo = qfu( psz );
331 return QVariant( returninfo );
333 else if( role == Qt::DecorationRole && index.column() == 0 )
335 /* Used to segfault here because i_type wasn't always initialized */
336 return QVariant( PLModel::icons[item->p_input->i_type] );
338 else if( role == Qt::FontRole )
340 if( isCurrent( index ) )
342 QFont f; f.setBold( true ); return QVariant( f );
345 else if( role == IsCurrentRole ) return QVariant( isCurrent( index ) );
349 bool PLModel::isCurrent( const QModelIndex &index ) const
351 input_thread_t *p_input_thread = THEMIM->getInput();
352 if( !p_input_thread ) return false;
353 return getItem( index )->p_input == input_GetItem( p_input_thread );
356 int PLModel::itemId( const QModelIndex &index ) const
358 return getItem( index )->i_id;
361 QVariant PLModel::headerData( int section, Qt::Orientation orientation,
364 if (orientation != Qt::Horizontal || role != Qt::DisplayRole)
367 int meta_col = columnToMeta( section );
369 if( meta_col == COLUMN_END ) return QVariant();
371 return QVariant( qfu( psz_column_title( meta_col ) ) );
374 QModelIndex PLModel::index( int row, int column, const QModelIndex &parent )
377 PLItem *parentItem = parent.isValid() ? getItem( parent ) : rootItem;
379 PLItem *childItem = parentItem->child( row );
381 return createIndex( row, column, childItem );
383 return QModelIndex();
386 QModelIndex PLModel::index( int i_id, int c )
388 return index( findById( rootItem, i_id ), c );
391 /* Return the index of a given item */
392 QModelIndex PLModel::index( PLItem *item, int column ) const
394 if( !item ) return QModelIndex();
395 const PLItem *parent = item->parent();
397 return createIndex( parent->children.lastIndexOf( item ),
399 return QModelIndex();
402 QModelIndex PLModel::currentIndex()
404 input_thread_t *p_input_thread = THEMIM->getInput();
405 if( !p_input_thread ) return QModelIndex();
406 PLItem *item = findByInput( rootItem, input_GetItem( p_input_thread )->i_id );
407 return index( item, 0 );
410 QModelIndex PLModel::parent( const QModelIndex &index ) const
412 if( !index.isValid() ) return QModelIndex();
414 PLItem *childItem = getItem( index );
417 msg_Err( p_playlist, "NULL CHILD" );
418 return QModelIndex();
421 PLItem *parentItem = childItem->parent();
422 if( !parentItem || parentItem == rootItem ) return QModelIndex();
423 if( !parentItem->parentItem )
425 msg_Err( p_playlist, "No parent parent, trying row 0 " );
426 msg_Err( p_playlist, "----- PLEASE REPORT THIS ------" );
427 return createIndex( 0, 0, parentItem );
429 QModelIndex ind = createIndex(parentItem->row(), 0, parentItem);
433 int PLModel::columnCount( const QModelIndex &i) const
435 return columnFromMeta( COLUMN_END );
438 int PLModel::rowCount( const QModelIndex &parent ) const
440 PLItem *parentItem = parent.isValid() ? getItem( parent ) : rootItem;
441 return parentItem->childCount();
444 QStringList PLModel::selectedURIs()
447 for( int i = 0; i < current_selection.size(); i++ )
449 PLItem *item = getItem( current_selection[i] );
453 playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item->i_id );
456 char *psz = input_item_GetURI( p_item->p_input );
459 lst.append( qfu(psz) );
470 /************************* Lookups *****************************/
472 PLItem *PLModel::findById( PLItem *root, int i_id )
474 return findInner( root, i_id, false );
477 PLItem *PLModel::findByInput( PLItem *root, int i_id )
479 PLItem *result = findInner( root, i_id, true );
483 #define CACHE( i, p ) { i_cached_id = i; p_cached_item = p; }
484 #define ICACHE( i, p ) { i_cached_input_id = i; p_cached_item_bi = p; }
486 PLItem * PLModel::findInner( PLItem *root, int i_id, bool b_input )
488 if( !root ) return NULL;
489 if( ( !b_input && i_cached_id == i_id) ||
490 ( b_input && i_cached_input_id ==i_id ) )
492 return b_input ? p_cached_item_bi : p_cached_item;
495 if( !b_input && root->i_id == i_id )
500 else if( b_input && root->p_input->i_id == i_id )
502 ICACHE( i_id, root );
506 QList<PLItem *>::iterator it = root->children.begin();
507 while ( it != root->children.end() )
509 if( !b_input && (*it)->i_id == i_id )
511 CACHE( i_id, (*it) );
512 return p_cached_item;
514 else if( b_input && (*it)->p_input->i_id == i_id )
516 ICACHE( i_id, (*it) );
517 return p_cached_item_bi;
519 if( (*it)->children.size() )
521 PLItem *childFound = findInner( (*it), i_id, b_input );
525 ICACHE( i_id, childFound )
527 CACHE( i_id, childFound )
538 int PLModel::columnToMeta( int _column ) const
543 while( column != _column && meta != COLUMN_END )
552 int PLModel::columnFromMeta( int meta_col ) const
557 while( meta != meta_col && meta != COLUMN_END )
566 bool PLModel::canEdit() const
571 rootItem->p_input == p_playlist->p_playing->p_input ||
573 p_playlist->p_media_library &&
574 rootItem->p_input == p_playlist->p_media_library->p_input
579 /************************* Updates handling *****************************/
581 /**** Events processing ****/
582 void PLModel::processInputItemUpdate( input_thread_t *p_input )
584 if( !p_input ) return;
585 if( p_input && !( p_input->b_dead || !vlc_object_alive( p_input ) ) )
587 PLItem *item = findByInput( rootItem, input_GetItem( p_input )->i_id );
588 if( item ) emit currentChanged( index( item, 0 ) );
590 processInputItemUpdate( input_GetItem( p_input ) );
593 void PLModel::processInputItemUpdate( input_item_t *p_item )
595 if( !p_item || p_item->i_id <= 0 ) return;
596 PLItem *item = findByInput( rootItem, p_item->i_id );
598 updateTreeItem( item );
601 void PLModel::processItemRemoval( int i_id )
603 if( i_id <= 0 ) return;
607 void PLModel::processItemAppend( int i_item, int i_parent )
609 playlist_item_t *p_item = NULL;
610 PLItem *newItem = NULL;
611 input_thread_t *currentInputThread;
614 PLItem *nodeItem = findById( rootItem, i_parent );
615 if( !nodeItem ) return;
617 foreach( PLItem *existing, nodeItem->children )
618 if( existing->i_id == i_item ) return;
621 p_item = playlist_ItemGetById( p_playlist, i_item );
622 if( !p_item || p_item->i_flags & PLAYLIST_DBL_FLAG ) goto end;
624 for( pos = 0; pos < p_item->p_parent->i_children; pos++ )
625 if( p_item->p_parent->pp_children[pos] == p_item ) break;
627 newItem = new PLItem( p_item, nodeItem );
630 beginInsertRows( index( nodeItem, 0 ), pos, pos );
631 nodeItem->insertChild( newItem, pos );
641 void PLModel::rebuild()
643 rebuild( NULL, false );
646 void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
648 playlist_item_t* p_item;
650 /* Invalidate cache */
651 i_cached_id = i_cached_input_id = -1;
653 if( rootItem ) rootItem->removeChildren();
659 rootItem = new PLItem( p_root );
662 /* Recreate from root */
663 updateChildren( rootItem );
666 /* And signal the view */
669 if( p_root ) emit rootChanged();
672 void PLModel::takeItem( PLItem *item )
675 PLItem *parent = item->parentItem;
677 int i_index = parent->children.indexOf( item );
679 beginRemoveRows( index( parent, 0 ), i_index, i_index );
680 parent->takeChildAt( i_index );
684 void PLModel::insertChildren( PLItem *node, QList<PLItem*>& items, int i_pos )
687 int count = items.size();
689 beginInsertRows( index( node, 0 ), i_pos, i_pos + count - 1 );
690 for( int i = 0; i < count; i++ )
692 node->children.insert( i_pos + i, items[i] );
693 items[i]->parentItem = node;
698 void PLModel::removeItem( PLItem *item )
702 if( item->i_id == i_cached_id ) i_cached_id = -1;
703 i_cached_input_id = -1;
705 if( item->parentItem ) {
706 int i = item->parentItem->children.indexOf( item );
707 beginRemoveRows( index( item->parentItem, 0), i, i );
708 item->parentItem->children.removeAt(i);
717 rebuild( p_playlist->p_playing );
721 /* This function must be entered WITH the playlist lock */
722 void PLModel::updateChildren( PLItem *root )
724 playlist_item_t *p_node = playlist_ItemGetById( p_playlist, root->i_id );
725 updateChildren( p_node, root );
728 /* This function must be entered WITH the playlist lock */
729 void PLModel::updateChildren( playlist_item_t *p_node, PLItem *root )
731 for( int i = 0; i < p_node->i_children ; i++ )
733 if( p_node->pp_children[i]->i_flags & PLAYLIST_DBL_FLAG ) continue;
734 PLItem *newItem = new PLItem( p_node->pp_children[i], root );
735 root->appendChild( newItem );
736 if( p_node->pp_children[i]->i_children != -1 )
737 updateChildren( p_node->pp_children[i], newItem );
741 /* Function doesn't need playlist-lock, as we don't touch playlist_item_t stuff here*/
742 void PLModel::updateTreeItem( PLItem *item )
745 emit dataChanged( index( item, 0 ) , index( item, columnCount( QModelIndex() ) ) );
748 /************************* Actions ******************************/
751 * Deletion, here we have to do a ugly slow hack as we retrieve the full
752 * list of indexes to delete at once: when we delete a node and all of
753 * its children, we need to update the list.
754 * Todo: investigate whethere we can use ranges to be sure to delete all items?
756 void PLModel::doDelete( QModelIndexList selected )
758 if( !canEdit() ) return;
760 while( !selected.isEmpty() )
762 QModelIndex index = selected[0];
763 selected.removeAt( 0 );
765 if( index.column() != 0 ) continue;
767 PLItem *item = getItem( index );
768 if( item->children.size() )
769 recurseDelete( item->children, &selected );
772 playlist_DeleteFromInput( p_playlist, item->p_input, pl_Locked );
779 void PLModel::recurseDelete( QList<PLItem*> children, QModelIndexList *fullList )
781 for( int i = children.size() - 1; i >= 0 ; i-- )
783 PLItem *item = children[i];
784 if( item->children.size() )
785 recurseDelete( item->children, fullList );
786 fullList->removeAll( index( item, 0 ) );
790 /******* Volume III: Sorting and searching ********/
791 void PLModel::sort( int column, Qt::SortOrder order )
793 sort( rootItem->i_id, column, order );
796 void PLModel::sort( int i_root_id, int column, Qt::SortOrder order )
798 msg_Dbg( p_intf, "Sorting by column %i, order %i", column, order );
800 int meta = columnToMeta( column );
801 if( meta == COLUMN_END ) return;
803 PLItem *item = findById( rootItem, i_root_id );
805 QModelIndex qIndex = index( item, 0 );
806 int count = item->children.size();
809 beginRemoveRows( qIndex, 0, count - 1 );
810 item->removeChildren();
816 playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
820 playlist_RecursiveNodeSort( p_playlist, p_root,
821 i_column_sorting( meta ),
822 order == Qt::AscendingOrder ?
823 ORDER_NORMAL : ORDER_REVERSE );
827 i_cached_id = i_cached_input_id = -1;
831 beginInsertRows( qIndex, 0, count - 1 );
832 updateChildren( item );
838 void PLModel::search( const QString& search_text )
840 /** \todo Fire the search with a small delay ? */
843 playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
846 const char *psz_name = search_text.toUtf8().data();
847 playlist_LiveSearchUpdate( p_playlist , p_root, psz_name );
853 /*********** Popup *********/
854 void PLModel::popup( const QModelIndex & index, const QPoint &point, const QModelIndexList &list )
856 int i_id = index.isValid() ? itemId( index ) : rootItem->i_id;
859 playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
864 i_popup_item = index.isValid() ? p_item->i_id : -1;
865 i_popup_parent = index.isValid() ?
866 ( p_item->p_parent ? p_item->p_parent->i_id : -1 ) :
868 i_popup_column = index.column();
870 bool tree = var_InheritBool( p_intf, "playlist-tree" );
874 current_selection = list;
877 if( i_popup_item > -1 )
879 menu.addAction( qtr(I_POP_PLAY), this, SLOT( popupPlay() ) );
880 menu.addAction( qtr(I_POP_DEL), this, SLOT( popupDel() ) );
882 menu.addAction( qtr(I_POP_STREAM), this, SLOT( popupStream() ) );
883 menu.addAction( qtr(I_POP_SAVE), this, SLOT( popupSave() ) );
885 menu.addAction( qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
887 QMenu *sort_menu = menu.addMenu( qtr( "Sort by ") +
888 qfu( psz_column_title( columnToMeta( index.column() ) ) ) );
889 sort_menu->addAction( qtr( "Ascending" ),
890 this, SLOT( popupSortAsc() ) );
891 sort_menu->addAction( qtr( "Descending" ),
892 this, SLOT( popupSortDesc() ) );
894 if( tree && canEdit() )
895 menu.addAction( qtr(I_POP_ADD), this, SLOT( popupAddNode() ) );
896 if( i_popup_item > -1 )
899 menu.addAction( qtr( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
901 if( !menu.isEmpty() ) menu.exec( point );
904 void PLModel::popupDel()
906 doDelete( current_selection );
909 void PLModel::popupPlay()
913 playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
915 activateItem( p_item );
920 void PLModel::popupInfo()
923 playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
927 input_item_t* p_input = p_item->p_input;
928 vlc_gc_incref( p_input );
930 MediaInfoDialog *mid = new MediaInfoDialog( p_intf, p_input );
931 vlc_gc_decref( p_input );
932 mid->setParent( PlaylistDialog::getInstance( p_intf ),
939 void PLModel::popupStream()
941 QStringList mrls = selectedURIs();
942 if( !mrls.isEmpty() )
943 THEDP->streamingDialog( NULL, mrls[0], false );
947 void PLModel::popupSave()
949 QStringList mrls = selectedURIs();
950 if( !mrls.isEmpty() )
951 THEDP->streamingDialog( NULL, mrls[0] );
956 #include <QDesktopServices>
957 void PLModel::popupExplore()
960 playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
964 input_item_t *p_input = p_item->p_input;
965 char *psz_meta = input_item_GetURI( p_input );
969 const char *psz_access;
970 const char *psz_demux;
972 input_SplitMRL( &psz_access, &psz_demux, &psz_path, psz_meta );
974 if( EMPTY_STR( psz_access ) ||
975 !strncasecmp( psz_access, "file", 4 ) ||
976 !strncasecmp( psz_access, "dire", 4 ) )
978 QFileInfo info( qfu( psz_meta ) );
979 QDesktopServices::openUrl(
980 QUrl::fromLocalFile( info.absolutePath() ) );
989 #include <QInputDialog>
990 void PLModel::popupAddNode()
993 QString name = QInputDialog::getText( PlaylistDialog::getInstance( p_intf ),
994 qtr( I_POP_ADD ), qtr( "Enter name for new node:" ),
995 QLineEdit::Normal, QString(), &ok);
996 if( !ok || name.isEmpty() ) return;
998 playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
1002 playlist_NodeCreate( p_playlist, qtu( name ), p_item, 0, NULL );
1007 void PLModel::popupSortAsc()
1009 sort( i_popup_parent, i_popup_column, Qt::AscendingOrder );
1012 void PLModel::popupSortDesc()
1014 sort( i_popup_parent, i_popup_column, Qt::DescendingOrder );