forked from qt-creator/qt-creator
Gerrit: Fix SSH output parsing for Gerrit 2.14
Gerrit 2.13: {..., "number":"195547", ...}
Gerrit 2.14: {..., "number":195547, ...}
Change-Id: I13f668d7b8edd012bf72bf03052da56fc99f18eb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
a52b94bbc8
commit
9b9a883a9a
@@ -546,7 +546,9 @@ static GerritUser parseGerritUser(const QJsonObject &object)
|
|||||||
|
|
||||||
static int numberValue(const QJsonObject &object)
|
static int numberValue(const QJsonObject &object)
|
||||||
{
|
{
|
||||||
return object.value("number").toString().toInt();
|
const QJsonValue number = object.value("number");
|
||||||
|
// Since Gerrit 2.14 (commits fa92467dc and b0cfe1401) the change and patch set numbers are int
|
||||||
|
return number.isString() ? number.toString().toInt() : number.toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse gerrit query Json output.
|
/* Parse gerrit query Json output.
|
||||||
|
|||||||
Reference in New Issue
Block a user