Webkit GTK :: How to detect when a download has finished?

后端 未结 3 1404
情书的邮戳
情书的邮戳 2020-12-19 22:24

I was wondering if there is a way to know when a webkitdownload has finished without error. I am using the C API. I was hoping a signal would be emitted (similar to when a d

3条回答
  •  无人及你
    2020-12-19 22:36

    Looks like you have to poll the WebKitDownload by hand:

    WebKitDownloadStatus s = webkit_download_get_status(downloader);
    if(s == WEBKIT_DOWNLOAD_STATUS_FINISHED) {
        /* The download has successfully finished. */
    }
    else if(s == WEBKIT_DOWNLOAD_STATUS_STARTED) {
        /* Still going, 100*webkit_download_get_progress(downloader) percent complete. */
    }
    

提交回复
热议问题