From 5ea4444f5e889b8aa486355cdfcf0c93e2fb34e2 Mon Sep 17 00:00:00 2001 From: nhnielsen Date: Thu, 2 Aug 2007 20:15:16 +0000 Subject: [PATCH] add check for role and orientation to headerData() git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/extragear/multimedia/amarok@695731 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/playlistbrowser/PodcastModel.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/playlistbrowser/PodcastModel.cpp b/src/playlistbrowser/PodcastModel.cpp index 89d1ba3da..78b4fbd73 100644 --- a/src/playlistbrowser/PodcastModel.cpp +++ b/src/playlistbrowser/PodcastModel.cpp @@ -41,6 +41,7 @@ PodcastModel::~PodcastModel() QVariant PlaylistBrowserNS::PodcastModel::data(const QModelIndex & index, int role) const { + DEBUG_BLOCK Q_UNUSED( role ) debug() << k_funcinfo << " index: " << index.row() << ":" << index.column(); switch( index.column() ) @@ -141,6 +142,8 @@ PlaylistBrowserNS::PodcastModel::parent(const QModelIndex & index) const int PlaylistBrowserNS::PodcastModel::rowCount(const QModelIndex & parent) const { + DEBUG_BLOCK + debug() << k_funcinfo << " parent: " << parent.row() << ":" << parent.column(); if (parent.column() > 0) { @@ -187,13 +190,20 @@ PodcastModel::headerData(int section, Qt::Orientation orientation, int role) con Q_UNUSED( role ) debug() << k_funcinfo << "section = " << section; - switch( section ) - { - case 0: return QString("Type"); - case 1: return QString("Title"); - case 2: return QString("Summary"); - default: return QString( "Section ") + QString::number( section ); + + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { + switch( section ) + { + case 0: return QString("Type"); + case 1: return QString("Title"); + case 2: return QString("Summary"); + default: return QString( "Section ") + QString::number( section ); + } + } else { + return QVariant(); } + + } void -- 2.11.4.GIT