Commit d6cc22d1ee878aca5acfa163e88ff870ddb00b9c
1 parent
0946450f
Exists in
master
Conserto de comparações dos valores armazenados em Json.
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
src/cacic_hardware.cpp
... | ... | @@ -38,7 +38,7 @@ QJsonObject cacic_hardware::coletaLinux() |
38 | 38 | |
39 | 39 | QJsonObject lshwJson = oCacic.getJsonFromFile("lshwJson.json")["children"].toArray().first().toObject(); |
40 | 40 | |
41 | - if( lshwJson.contains("id") && lshwJson["id"] == "core") { | |
41 | + if( lshwJson.contains("id") && lshwJson["id"] == QJsonValue::fromVariant(QString("core")) ) { | |
42 | 42 | if ( lshwJson["children"].isArray() ){ |
43 | 43 | // qDebug() << "IS ARRAY!!"; |
44 | 44 | QJsonArray componentsArray = lshwJson["children"].toArray(); |
... | ... | @@ -55,11 +55,11 @@ QJsonObject cacic_hardware::coletaLinux() |
55 | 55 | * coletaLinuxPci |
56 | 56 | */ |
57 | 57 | |
58 | - if( component["id"] == "memory" ) { | |
58 | + if( component["id"] == QJsonValue::fromVariant(QString("memory")) ) { | |
59 | 59 | coletaLinuxMem(hardware,component); |
60 | - } else if ( component["id"] == "cpu" ) { | |
60 | + } else if ( component["id"] == QJsonValue::fromVariant(QString("cpu")) ) { | |
61 | 61 | coletaLinuxCpu(hardware,component); |
62 | - } else if ( component["id"] == "pci" ) { | |
62 | + } else if ( component["id"] == QJsonValue::fromVariant(QString("pci")) ) { | |
63 | 63 | QJsonArray pciArray = component["children"].toArray(); |
64 | 64 | |
65 | 65 | foreach(QJsonValue pciValue, pciArray){ |
... | ... | @@ -258,7 +258,7 @@ void cacic_hardware::coletaLinuxPci(QJsonObject &hardware, const QJsonObject &pc |
258 | 258 | |
259 | 259 | QJsonObject pciMember; |
260 | 260 | |
261 | - if ( pciJson["id"] == "multimedia") { | |
261 | + if ( pciJson["id"] == QJsonValue::fromVariant(QString("multimedia")) ) { | |
262 | 262 | pciMember["description"] = pciJson["description"]; |
263 | 263 | pciMember["product"] = pciJson["product"]; |
264 | 264 | pciMember["vendor"] = pciJson["vendor"]; |
... | ... | @@ -270,7 +270,7 @@ void cacic_hardware::coletaLinuxPci(QJsonObject &hardware, const QJsonObject &pc |
270 | 270 | foreach( QJsonValue pciChild, pciChildren ) { |
271 | 271 | QJsonObject pciChildJson = pciChild.toObject(); |
272 | 272 | |
273 | - if( pciChildJson["id"] == "network" && | |
273 | + if( pciChildJson["id"] == QJsonValue::fromVariant(QString("network")) && | |
274 | 274 | ( pciChildJson["description"].toString().contains("Wireless") || |
275 | 275 | pciChildJson["product"].toString().contains("Wireless") )) { |
276 | 276 | pciMember["description"] = pciChildJson["description"]; |
... | ... | @@ -281,7 +281,7 @@ void cacic_hardware::coletaLinuxPci(QJsonObject &hardware, const QJsonObject &pc |
281 | 281 | pciMember["firmware"] = pciChildJson["configuration"].toObject()["firmware"]; |
282 | 282 | |
283 | 283 | hardware["wireless_card"] = pciMember; |
284 | - } else if( pciChildJson["id"] == "network" ) { | |
284 | + } else if( pciChildJson["id"] == QJsonValue::fromVariant(QString("network")) ) { | |
285 | 285 | pciMember["description"] = pciChildJson["description"]; |
286 | 286 | pciMember["product"] = pciChildJson["product"]; |
287 | 287 | pciMember["vendor"] = pciChildJson["vendor"]; | ... | ... |