Commit f3ac9b084f711e2eb414e3bacf18cbf38559faa5
1 parent
9989db7c
Exists in
master
merge
Showing
3 changed files
with
5 additions
and
2 deletions
Show diff stats
cacic-teste/testcacic.cpp
... | ... | @@ -182,6 +182,7 @@ void CTestCacic::testStartService() |
182 | 182 | QString exitStatus; |
183 | 183 | #ifdef Q_OS_WIN |
184 | 184 | exitStatus = OCacic.startProcess("../../install-cacic/debug/install-cacic.exe", true, &ok); |
185 | + qDebug() << exitStatus; | |
185 | 186 | #else |
186 | 187 | exitStatus = OCacic.startProcess("../../install-cacic/debug/install-cacic", true, &ok); |
187 | 188 | #endif | ... | ... |
src/cacic_comm.h
... | ... | @@ -62,7 +62,7 @@ public: |
62 | 62 | if (isSsl){ |
63 | 63 | url = urlSsl.isEmpty() ? "https://" + this->urlGerente + route : this->urlSsl + route; |
64 | 64 | if (!url.isValid()){ |
65 | - jsonObj["error"] = QVariant("Invalid Url"); | |
65 | + jsonObj["error"] = QJsonValue::fromVariant(QVariant("Invalid Url")); | |
66 | 66 | return jsonObj; |
67 | 67 | } |
68 | 68 | req.setSslConfiguration(QSslConfiguration::defaultConfiguration()); | ... | ... |
src/wmi.cpp
... | ... | @@ -66,6 +66,7 @@ QJsonValue wmi::wmiSearch(QString classe, QStringList params) |
66 | 66 | valueList.remove("{"); |
67 | 67 | if (valueList.contains("}")) |
68 | 68 | valueList.remove("}"); |
69 | + if (!valueList.trimmed().isEmpty()) | |
69 | 70 | jList.append(valueList.trimmed()); |
70 | 71 | } |
71 | 72 | itemWmi[tag] = jList; |
... | ... | @@ -73,7 +74,8 @@ QJsonValue wmi::wmiSearch(QString classe, QStringList params) |
73 | 74 | //O último valor sempre volta com "}" no final. |
74 | 75 | if (aux.contains("}")) |
75 | 76 | aux.remove("}"); |
76 | - itemWmi[tag] = QJsonValue::fromVariant(aux.trimmed()); | |
77 | + if (!aux.trimmed().isEmpty()) | |
78 | + itemWmi[tag] = QJsonValue::fromVariant(aux.trimmed()); | |
77 | 79 | } |
78 | 80 | } |
79 | 81 | } // foreach(QString value, instanceList) | ... | ... |