Progress notifications for sendHttpPostFileUpload()
| 196 | |
| 197 | // Progress notifications for sendHttpPostFileUpload() |
| 198 | void JavaScriptAPI::uploadProgress(qint64 bytesSent, qint64 bytesTotal) |
| 199 | { |
| 200 | // get the filename associated with this upload progress by checking who sent the signal |
| 201 | QNetworkReply* signalSender = (QNetworkReply*)QObject::sender(); |
| 202 | QString fileNameAttr = signalSender->request().attribute(QNetworkRequest::User).toString(); |
| 203 | |
| 204 | _page->evaluateJavaScript(QString_NT("updateProgress(\"%1\", %2, %3);").arg(fileNameAttr).arg(bytesSent).arg(bytesTotal)); |
| 205 | } |
| 206 | |
| 207 | // terminate any uploads in progress |
| 208 | void JavaScriptAPI::abortAllUploads() |