TreeModel: takeItem should return the item

The usual Qt API for "takeXyz()" methods is to return the item that was
"taken".

Change-Id: Ie144051801487a301b3f13e2857735b65f58150b
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-06-09 09:33:14 +02:00
parent 5309e217e4
commit b1393d4778
9 changed files with 14 additions and 22 deletions

View File

@@ -412,8 +412,7 @@ void BreakHandler::deletionHelper(BreakpointModelId id)
{
Breakpoint b = breakpointById(id);
QTC_ASSERT(b, return);
takeItem(b.b);
delete b.b;
delete takeItem(b.b);
}
Breakpoint BreakHandler::findWatchpoint(const BreakpointParameters &params) const
@@ -1235,8 +1234,7 @@ void BreakHandler::changeLineNumberFromMarkerHelper(BreakpointModelId id)
Breakpoint b = breakpointById(id);
QTC_ASSERT(b, return);
BreakpointParameters params = b.parameters();
takeItem(b.b);
delete b.b;
delete takeItem(b.b);
appendBreakpoint(params);
}