fix display

parent d24a313b
......@@ -923,9 +923,12 @@ QVariant Playlist::data(const QModelIndex& index, int role) const
{
if (role == Qt::DecorationRole) {
// ### TODO: FIXME
return *(m_items[index.row()]->pixmap(index.column()));
// return *(m_items[index.row()]->pixmap(index.column()));
}
if (role != Qt::DisplayRole)
return QVariant();
FileHandle fileHandle = m_items[index.row()]->file();
switch(index.column()) {
case TrackColumn:
......@@ -986,8 +989,12 @@ bool Playlist::removeRows(int row, int count, const QModelIndex& parent)
return QAbstractItemModel::removeRows(row, count, parent);
}
QVariant Playlist::headerData(int section, Qt::Orientation , int role) const
QVariant Playlist::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation != Qt::Horizontal || role != Qt::DisplayRole)
return QVariant();
switch(section) {
case TrackColumn:
return i18n("Track Name");
......@@ -1018,6 +1025,10 @@ QVariant Playlist::headerData(int section, Qt::Orientation , int role) const
}
}
bool Playlist::hasChildren(const QModelIndex &index) const
{
return (!index.isValid());
}
#include "playlist.moc"
......
......@@ -98,6 +98,7 @@ public:
bool insertRows (int row, int count, const QModelIndex & parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex & parent = QModelIndex());
QVariant headerData(int section, Qt::Orientation, int role = Qt::DisplayRole) const;
bool hasChildren(const QModelIndex& index) const;
using QAbstractTableModel::sort;
// The following group of functions implement the PlaylistInterface API.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment