Launch a file. fullHandle is either a URL or a filename. If it is a URL, it will be downloaded to a temp dir first.
| 89 | // Launch a file. fullHandle is either a URL or a filename. If it is a URL, |
| 90 | // it will be downloaded to a temp dir first. |
| 91 | bool JavaScriptAPI::launch(QString fullHandle, QString callbackName/*=QString::null*/, QString fileName/*=QString::null*/) |
| 92 | { |
| 93 | bool result = false; |
| 94 | |
| 95 | // First, see if it looks like a URL |
| 96 | QUrl url(fullHandle, QUrl::StrictMode); |
| 97 | if (url.scheme().startsWith("http")) |
| 98 | { |
| 99 | downloadFile(url, callbackName, fileName); |
| 100 | return true; |
| 101 | } |
| 102 | // Otherwise, assume it's a local file |
| 103 | return fsManager->launchFile(fullHandle); |
| 104 | } |
| 105 | |
| 106 | // This slot is connected to a QNetworkReply, probably started by downloadFile() |
| 107 | void JavaScriptAPI::downloadProgress( qint64 received, qint64 total ) |
no test coverage detected