-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow connman bearer backend to use UserConfig to popup a connection dialog #42
base: master
Are you sure you want to change the base?
Conversation
@@ -139,6 +140,7 @@ private Q_SLOTS: | |||
|
|||
int inotifyWatcher; | |||
int inotifyFileDescriptor; | |||
void updateUserConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no implementation for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops. gone
As a general comment instead of using a UserChoice configuration, I think a much cleaner solution would be to make use of Connman sessions. For example one would define service networks based on the available technologies: "cellular", "wlan", and any type service network. Opening the sessions based on these service networks would pop up the dialog if necessary. Otherwise it would connect using the Connman Session API. This way connections are reference counted by Connman and close() can be implemented. |
Connman sessions do not work like that. As in, calling Connect on a session does not create a DNS lookup error, nor does it create an input request, and so does not popup the connection selector, so we would still need this here. Personally, I have not yet found a good reason for connman sessions. I believe it is more for per application routing. Never noticed that close does nothing really. I will look into adding sessions for service configs, but subject to a later patch. |
emit quitPendingWaitsForOpened(); | ||
return; | ||
} | ||
lastError = QNetworkSession::OperationNotSupportedError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will emit an OperationNotSupported error if open() is called on an already open session. I don't think it should emit an error in this case.
a connection dialog when there is nothing else around. code in use is using a 'ConnectInBackground' property, so we can enable and use this to supress the popup
Finally managed to get qtbase built. Tested with a couple of QNAM only applications, network connections established as expected and network requests via QNAM waited for said connect and completed successfully. Tested switching between different connected technology. Seems to work fine in my testing. LGTM. |
This change causes the connection selector to be displayed when the only connected service is in the ready state. The fact that the only connected service is in the ready state is a separate issue. |
Old harmattan used a similar thing. Here, I use dbus to popup the sailfish specific dialog. This way this can tell if user cancels and deal with that.
This fixes a bug in QNAM when someone issues a network request, like get() or head() when there is no network connection and no connection dialog is shown.
It also fixes when alwaysAsk is enabled for cellular connections.
Also enabled the already in use "ConnectInBackground" property.