[SailfishDevel] QNetworkAccessManager: how to wait for Internet?

Andrey Kozhevnikov coderusinbox at gmail.com
Wed Feb 12 13:02:39 UTC 2014


     manager = new QNetworkConfigurationManager(this);
     connect(manager,SIGNAL(onlineStateChanged(bool)),
             this,SLOT(networkStatusChanged(bool)));

connect(manager,SIGNAL(configurationChanged(QNetworkConfiguration)),
this,SLOT(networkConfigurationChanged(QNetworkConfiguration)));

     session = new QNetworkSession(manager->defaultConfiguration());
     connect(session, SIGNAL(opened()), this, SLOT(networkSessionOpened()));
     connect(session, SIGNAL(stateChanged(QNetworkSession::State)), this,
             SLOT(networkStateChanged(QNetworkSession::State)));

On 12.02.2014 18:57, Sylvain B. wrote:
> Hello,
> QNetworkAccessManager does not behave like in Harmattan: when you were 
> triggering a request while not connected to Internet, the "Select 
> Internet connection" dialog was showing, and the request was waiting 
> for the device to connect to the Internet.
> In Sailfish, triggering a request when the phone is not connected to 
> Internet pop the "Select Internet connection" dialog, but the request 
> immediately returns a HostNotFoundError.
>
> Is it something that will change in the future or do we have to handle 
> that manually?
> If it needs to be done manually, could anyone share a clean way to do so?
>
> Thanks a lot,
>
> -- 
> Sylvain.
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140212/fa6624b1/attachment.html>


More information about the Devel mailing list