This slot is triggered from an HTTP request in sendXmlHttpRequest().
| 285 | |
| 286 | // This slot is triggered from an HTTP request in sendXmlHttpRequest(). |
| 287 | void JavaScriptAPI::httpRequestFinished( int id, bool error ) |
| 288 | { |
| 289 | if (_pendingHttpRequests.contains(id)) |
| 290 | { |
| 291 | assert(_stringData.isNull()); |
| 292 | _stringData = _httpImpl.readAll(); |
| 293 | |
| 294 | // If we close the connection here, we don't seem to be able to make any |
| 295 | // further requests with this object. |
| 296 | // _httpImpl.close(); |
| 297 | |
| 298 | QString callbackCode = QString("%1(BumpTopNative.internal_getStringData(), %2);") |
| 299 | .arg(_pendingHttpRequests[id]) |
| 300 | .arg(error ? "false" : "true"); |
| 301 | _page->evaluateJavaScript(callbackCode); |
| 302 | |
| 303 | // Remove the object from the list, and let Qt delete it when signal processing is done |
| 304 | _pendingHttpRequests.remove(id); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | // This slot is triggered from an HTTP request in sendXmlHttpRequest(). |
| 309 | // Not connected by default, but left here because it's useful for debugging. |