forked from qt-creator/qt-creator
Fix warning: "Use midRef() instead of mid()"
[-Wclazy-qstring-ref] Change-Id: If8a0844b39377feb3772542559655854a92b93cd Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user