[Solved]QNetworkReply
-
I want add auto update check feature into my program, the logic i used is at start(of program) the
checkForUpdate();
function is called and it downloads a XML file, the XML file contains the info bout the latest supported versions and their download link.... checkForUpdate(); readXML(); ...
now my problem is
checkForUpdate();
is called and the file is downloaded and before it could finish thereadXML();
function is called, and thereadXML();
gives and an error as it cannot read the file simply because its not created, yet. I understand it as something to do with theQNetworkReply
bt i don't understand how to fix it.
~thanks in advance. :) -
You can use the
QNetworkReply::finished
signal to know when the download is over. -
@JohanSolo yeah i know bout it, its connected to a slot, bt i want to reuse this code for downloading the new update as well,
checkForUpdate()
calls a functiondownloadFile()
, i would like to use this again for downloading the file from the link which we got from the XML file. -
Sounds like you are well down the road of writing code to do this...
But for the sake of options and if you happen to be running on Windows, there is a fairly inexpensive tool that does all of this for you:
I've used this tool on both small and large projects and it makes updates a snap. It handles virtually any types of files and can be command line driven.