Fix warning: "Use midRef() instead of mid()"

[-Wclazy-qstring-ref]

Change-Id: If8a0844b39377feb3772542559655854a92b93cd
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2019-01-17 01:38:54 +01:00
parent 8acd583d10
commit 710e57a628
19 changed files with 38 additions and 38 deletions

View File

@@ -437,7 +437,7 @@ void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &objec
const int firstIndex = strlen("inspect");
const int secondIndex = iname.indexOf('.', firstIndex + 1);
if (secondIndex != -1)
engineId = iname.mid(firstIndex + 1, secondIndex - firstIndex - 1).toInt();
engineId = iname.midRef(firstIndex + 1, secondIndex - firstIndex - 1).toInt();
}
// Still not found? Maybe we're loading the engine itself.
@@ -462,7 +462,7 @@ void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &objec
int lastIndex = iname.lastIndexOf('.');
int secondLastIndex = iname.lastIndexOf('.', lastIndex - 1);
if (secondLastIndex != WatchItem::InvalidId)
parentId = iname.mid(secondLastIndex + 1, lastIndex - secondLastIndex - 1).toInt();
parentId = iname.midRef(secondLastIndex + 1, lastIndex - secondLastIndex - 1).toInt();
else
parentId = engineId;
} else {