Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lpotter
Copy link

@lpotter lpotter commented May 5, 2014

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.

@@ -139,6 +140,7 @@ private Q_SLOTS:

int inotifyWatcher;
int inotifyFileDescriptor;
void updateUserConfig();

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops. gone

@amccarthy
Copy link

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.

@lpotter
Copy link
Author

lpotter commented May 6, 2014

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;

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
@amccarthy
Copy link

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.

@amccarthy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants