Commit 9dd60b34 authored by Thiago Macieira's avatar Thiago Macieira

Fix use of variable before initialization

That's what you get for shadowing a variable... The "childItem" variable
on the second part of the foreach refers to one declared on the first
part, which is uninitialized.

Found by ICC 14.0:
graphicalnodeinstance.cpp(300): warning #592: variable "childItem" is used before its value is set

Change-Id: I9079a428eda90f4bb06f9ccd1adf836fee119133
Reviewed-by: default avatarKurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 293d4d9a
......@@ -292,12 +292,12 @@ int GraphicalNodeInstance::penWidth() const
}
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *childItem) const
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *item) const
{
QList<ServerNodeInstance> instanceList;
if (childItem) {
foreach (QQuickItem *childItem, childItem->childItems())
if (item) {
foreach (QQuickItem *childItem, item->childItems())
{
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
......
......@@ -69,7 +69,7 @@ protected:
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal();
void resetVertical();
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
void refresh();
static bool anyItemHasContent(QQuickItem *quickItem);
static bool childItemsHaveContent(QQuickItem *quickItem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment