TreeModel: Introduce a destroyItem() convenience function

Shorthand for delete takeItem(...).

Change-Id: Icb7b60e5c19aa0d21650eefff65f7eb55e9f90b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-07-04 15:53:53 +02:00
committed by hjk
parent 4c5ee0c02b
commit 7b4c7d49a9
15 changed files with 30 additions and 29 deletions

View File

@@ -320,7 +320,7 @@ void ThreadsHandler::updateThread(const ThreadData &threadData)
void ThreadsHandler::removeThread(ThreadId threadId)
{
if (ThreadItem *item = itemForThreadId(this, threadId))
delete takeItem(item);
destroyItem(item);
}
void ThreadsHandler::setThreads(const Threads &threads)
@@ -363,7 +363,7 @@ bool ThreadsHandler::notifyGroupExited(const QString &groupId)
list.append(item);
});
foreach (ThreadItem *item, list)
delete takeItem(item);
destroyItem(item);
m_pidForGroupId.remove(groupId);
return m_pidForGroupId.isEmpty();