1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

For custom JobItems, the delegate is parented to the view, so don't attempt to delete it in the destructor of the item

This commit is contained in:
Jeff Mitchell
2012-06-18 01:29:40 -04:00
parent 4a1adbfb8a
commit 7896d15536
2 changed files with 2 additions and 3 deletions

View File

@@ -164,8 +164,6 @@ AclJobItem::AclJobItem( ACLRegistry::User user, const QString &username )
AclJobItem::~AclJobItem() AclJobItem::~AclJobItem()
{ {
tLog() << Q_FUNC_INFO; tLog() << Q_FUNC_INFO;
if ( m_delegate )
delete m_delegate;
} }
@@ -173,6 +171,7 @@ void
AclJobItem::createDelegate( QObject* parent ) AclJobItem::createDelegate( QObject* parent )
{ {
tLog() << Q_FUNC_INFO; tLog() << Q_FUNC_INFO;
if ( m_delegate ) if ( m_delegate )
return; return;

View File

@@ -71,7 +71,7 @@ public:
virtual int concurrentJobLimit() const { return 3; } virtual int concurrentJobLimit() const { return 3; }
virtual bool hasCustomDelegate() const { return true; } virtual bool hasCustomDelegate() const { return true; }
virtual void createDelegate( QObject* parent ); virtual void createDelegate( QObject* parent = 0 );
virtual QStyledItemDelegate* customDelegate() const { return m_delegate; } virtual QStyledItemDelegate* customDelegate() const { return m_delegate; }
virtual ACLRegistry::User user() const { return m_user; } virtual ACLRegistry::User user() const { return m_user; }