diff options
author | hjk <hjk121@nokiamail.com> | 2013-06-20 09:27:42 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-06-20 09:33:29 +0200 |
commit | 5addb7c6f205b128f231cc435c31accfb30e25a6 (patch) | |
tree | b3e7329183f61f19695da617d2a5576dd7efe85a /src/plugins/valgrind/callgrindcostview.cpp | |
parent | ee8a0b30d933e875697bc969a0d4adf729aa21ff (diff) |
Valgrind: De-pimpl Valgrind::Internal::CostView
No need for that in internal classes.
Change-Id: Id2e2783972e068cef9873c248ae54c013b933530
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/valgrind/callgrindcostview.cpp')
-rw-r--r-- | src/plugins/valgrind/callgrindcostview.cpp | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/src/plugins/valgrind/callgrindcostview.cpp b/src/plugins/valgrind/callgrindcostview.cpp index 412d96c900d..5bd1a10743b 100644 --- a/src/plugins/valgrind/callgrindcostview.cpp +++ b/src/plugins/valgrind/callgrindcostview.cpp @@ -46,24 +46,10 @@ using namespace Valgrind::Callgrind; namespace Valgrind { namespace Internal { -class CostView::Private -{ -public: - explicit Private(CostView *qq); - - CostDelegate *m_costDelegate; - NameDelegate *m_nameDelegate; -}; - -CostView::Private::Private(CostView *qq) - : m_costDelegate(new CostDelegate(qq)) - , m_nameDelegate(new NameDelegate(qq)) -{} - - CostView::CostView(QWidget *parent) : Utils::BaseTreeView(parent) - , d(new Private(this)) + , m_costDelegate(new CostDelegate(this)) + , m_nameDelegate(new NameDelegate(this)) { setSelectionMode(QAbstractItemView::ExtendedSelection); setSelectionBehavior(QAbstractItemView::SelectRows); @@ -77,7 +63,6 @@ CostView::CostView(QWidget *parent) CostView::~CostView() { - delete d; } void CostView::setModel(QAbstractItemModel *model) @@ -86,36 +71,35 @@ void CostView::setModel(QAbstractItemModel *model) forever { QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(model); - if (proxy) - model = proxy->sourceModel(); - else + if (!proxy) break; + model = proxy->sourceModel(); } setItemDelegate(new QStyledItemDelegate(this)); if (qobject_cast<CallModel *>(model)) { - setItemDelegateForColumn(CallModel::CalleeColumn, d->m_nameDelegate); - setItemDelegateForColumn(CallModel::CallerColumn, d->m_nameDelegate); - setItemDelegateForColumn(CallModel::CostColumn, d->m_costDelegate); + setItemDelegateForColumn(CallModel::CalleeColumn, m_nameDelegate); + setItemDelegateForColumn(CallModel::CallerColumn, m_nameDelegate); + setItemDelegateForColumn(CallModel::CostColumn, m_costDelegate); } else if (qobject_cast<DataModel *>(model)) { - setItemDelegateForColumn(DataModel::InclusiveCostColumn, d->m_costDelegate); - setItemDelegateForColumn(DataModel::NameColumn, d->m_nameDelegate); - setItemDelegateForColumn(DataModel::SelfCostColumn, d->m_costDelegate); + setItemDelegateForColumn(DataModel::InclusiveCostColumn, m_costDelegate); + setItemDelegateForColumn(DataModel::NameColumn, m_nameDelegate); + setItemDelegateForColumn(DataModel::SelfCostColumn, m_costDelegate); } - d->m_costDelegate->setModel(model); + m_costDelegate->setModel(model); } void CostView::setCostFormat(CostDelegate::CostFormat format) { - d->m_costDelegate->setFormat(format); + m_costDelegate->setFormat(format); viewport()->update(); } CostDelegate::CostFormat CostView::costFormat() const { - return d->m_costDelegate->format(); + return m_costDelegate->format(); } void CostView::contextMenuEvent(QContextMenuEvent *ev) |