
Public Types | |
| enum | { IsCurrentRole = Qt::UserRole, IsLeafNodeRole } |
Public Slots | |
| void | activateItem (const QModelIndex &index) |
| void | activateItem (playlist_item_t *p_item) |
Signals | |
| void | currentChanged (const QModelIndex &) |
| void | rootChanged () |
Public Member Functions | |
| PLModel (playlist_t *, intf_thread_t *, playlist_item_t *, QObject *parent=0) | |
| ~PLModel () | |
| QVariant | data (const QModelIndex &index, int role) const |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| QModelIndex | index (int r, int c, const QModelIndex &parent) const |
| QModelIndex | parent (const QModelIndex &index) const |
| Qt::DropActions | supportedDropActions () const |
| QMimeData * | mimeData (const QModelIndexList &indexes) const |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &target) |
| QStringList | mimeTypes () const |
| QStringList | selectedURIs () |
| QModelIndex | index (PLItem *, int c) const |
| QModelIndex | index (int i_id, int c) |
| QModelIndex | currentIndex () |
| bool | isCurrent (const QModelIndex &index) const |
| int | itemId (const QModelIndex &index) const |
| bool | popup (const QModelIndex &index, const QPoint &point, const QModelIndexList &list) |
| void | doDelete (QModelIndexList selected) |
| Deletion, here we have to do a ugly slow hack as we retrieve the full list of indexes to delete at once: when we delete a node and all of its children, we need to update the list. | |
| void | search (const QString &search_text, const QModelIndex &root, bool b_recursive) |
| void | sort (int column, Qt::SortOrder order) |
| void | sort (int i_root_id, int column, Qt::SortOrder order) |
| void | rebuild () |
| void | rebuild (playlist_item_t *) |
| PLItem * | getItem (QModelIndex index) const |
Static Public Member Functions | |
| static int | columnFromMeta (int meta_column) |
| static int | columnToMeta (int column) |
Friends | |
| class | PLItem |
| class | PLSelector |
| PLModel::PLModel | ( | playlist_t * | _p_playlist, | |
| intf_thread_t * | _p_intf, | |||
| playlist_item_t * | p_root, | |||
| QObject * | parent = 0 | |||
| ) |
| PLModel::~PLModel | ( | ) |
| QVariant PLModel::data | ( | const QModelIndex & | index, | |
| int | role | |||
| ) | const |
| QVariant PLModel::headerData | ( | int | section, | |
| Qt::Orientation | orientation, | |||
| int | role = Qt::DisplayRole | |||
| ) | const |
References COLUMN_END, columnToMeta(), psz_column_title(), and qfu.
| int PLModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
References PLItem::childCount(), and getItem().
| int PLModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
References COLUMN_END, and columnFromMeta().
| Qt::ItemFlags PLModel::flags | ( | const QModelIndex & | index | ) | const |
References getItem(), playlist_item_t::i_children, PLItem::i_id, PL_LOCK, PL_UNLOCK, and playlist_ItemGetById().
| QModelIndex PLModel::index | ( | int | r, | |
| int | c, | |||
| const QModelIndex & | parent | |||
| ) | const |
References PLItem::child(), and getItem().
Referenced by StandardPLPanel::browseInto(), currentIndex(), doDelete(), index(), mimeData(), and sort().
| QModelIndex PLModel::parent | ( | const QModelIndex & | index | ) | const |
References getItem(), msg_Err, PLItem::parent(), PLItem::parentItem, and PLItem::row().
Referenced by index().
| Qt::DropActions PLModel::supportedDropActions | ( | ) | const |
| QMimeData * PLModel::mimeData | ( | const QModelIndexList & | indexes | ) | const |
References PlMimeData::appendItem(), getItem(), index(), list, modelIndexLessThen(), and PLItem::parent().
| bool PLModel::dropMimeData | ( | const QMimeData * | data, | |
| Qt::DropAction | action, | |||
| int | row, | |||
| int | column, | |||
| const QModelIndex & | target | |||
| ) |
References getItem().
| QStringList PLModel::mimeTypes | ( | ) | const |
| QStringList PLModel::selectedURIs | ( | ) |
References getItem(), PLItem::i_id, input_item_GetURI(), playlist_item_t::p_input, PL_LOCK, PL_UNLOCK, playlist_ItemGetById(), and qfu.
| QModelIndex PLModel::index | ( | PLItem * | item, | |
| int | c | |||
| ) | const |
References PLItem::children, PLItem::parent(), and parent().
| QModelIndex PLModel::index | ( | int | i_id, | |
| int | c | |||
| ) |
References index().
| QModelIndex PLModel::currentIndex | ( | ) |
| bool PLModel::isCurrent | ( | const QModelIndex & | index | ) | const |
| int PLModel::itemId | ( | const QModelIndex & | index | ) | const |
References getItem(), and PLItem::i_id.
Referenced by StandardPLPanel::browseInto(), popup(), and search().
| int PLModel::columnFromMeta | ( | int | meta_column | ) | [static] |
| int PLModel::columnToMeta | ( | int | column | ) | [static] |
| bool PLModel::popup | ( | const QModelIndex & | index, | |
| const QPoint & | point, | |||
| const QModelIndexList & | list | |||
| ) |
References COLUMN_END, COLUMN_NUMBER, CONNECT, playlist_item_t::i_id, PLItem::i_id, I_OP_ADVOP, I_PL_ADDDIR, I_PL_ADDF, I_POP_DEL, I_POP_EXPLORE, I_POP_INFO, I_POP_NEWFOLDER, I_POP_PLAY, I_POP_SAVE, I_POP_STREAM, itemId(), playlist_item_t::p_parent, playlist_t::p_playing, PL_LOCK, PL_UNLOCK, playlist_ItemGetById(), psz_column_title(), qfu, qtr, THEDP, THEPL, and var_InheritBool.
| void PLModel::doDelete | ( | QModelIndexList | selected | ) |
Deletion, here we have to do a ugly slow hack as we retrieve the full list of indexes to delete at once: when we delete a node and all of its children, we need to update the list.
Todo: investigate whethere we can use ranges to be sure to delete all items?
References PLItem::children, getItem(), index(), PLItem::p_input, PL_LOCK, pl_Locked, PL_UNLOCK, and playlist_DeleteFromInput().
| void PLModel::search | ( | const QString & | search_text, | |
| const QModelIndex & | root, | |||
| bool | b_recursive | |||
| ) |
References PLItem::children, getItem(), itemId(), PL_LOCK, PL_UNLOCK, playlist_ItemGetById(), playlist_LiveSearchUpdate(), psz_name, qtu, rebuild(), and PLItem::removeChildren().
| void PLModel::sort | ( | int | column, | |
| Qt::SortOrder | order | |||
| ) |
References PLItem::i_id.
| void PLModel::sort | ( | int | i_root_id, | |
| int | column, | |||
| Qt::SortOrder | order | |||
| ) |
| void PLModel::rebuild | ( | ) |
Referenced by PLModel(), search(), and StandardPLPanel::setRoot().
| void PLModel::rebuild | ( | playlist_item_t * | p_root | ) |
References PL_LOCK, PL_UNLOCK, PLItem, PLItem::removeChildren(), and rootChanged().
| PLItem* PLModel::getItem | ( | QModelIndex | index | ) | const [inline] |
Referenced by activateItem(), data(), doDelete(), dropMimeData(), flags(), index(), isCurrent(), itemId(), mimeData(), parent(), rowCount(), search(), selectedURIs(), and LocationBar::setIndex().
| void PLModel::currentChanged | ( | const QModelIndex & | ) | [signal] |
Referenced by sort().
| void PLModel::rootChanged | ( | ) | [signal] |
Referenced by rebuild().
| void PLModel::activateItem | ( | const QModelIndex & | index | ) | [slot] |
References getItem(), PL_LOCK, PL_UNLOCK, and playlist_ItemGetById().
| void PLModel::activateItem | ( | playlist_item_t * | p_item | ) | [slot] |
References PLItem::i_id, playlist_item_t::i_id, playlist_item_t::p_parent, pl_Locked, playlist_Control(), and PLAYLIST_VIEWPLAY.
friend class PLSelector [friend] |
1.5.6