core: add PrimaryConnectionType property to NMManager (bgo #739080)

This will provide an extremely easy way for applications to find out
what type of connection the system is currently using.  They might want
to do this to avoid using data if a phone is on a 3G connection, for
example.

Having this as a separate property provides at least two advantages:

 1) it reduces code complexity for those wanting only this one simple
    piece of information

 2) we could allow access to this property (but nothing else) to
    privilege-separated applications in the future

This patch adds the missing nm_active_connection_get_connection_type()
which was in the header file but never actually implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=739080
This commit is contained in:
Ryan Lortie
2014-10-23 13:56:52 -04:00
committed by Dan Williams
parent 0bc11cb730
commit 07dba25404
4 changed files with 35 additions and 0 deletions

View File

@@ -200,6 +200,17 @@ nm_active_connection_get_connection (NMActiveConnection *self)
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->connection;
}
const char *
nm_active_connection_get_connection_type (NMActiveConnection *self)
{
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
if (priv->connection == NULL)
return NULL;
return nm_connection_get_connection_type (priv->connection);
}
void
nm_active_connection_set_connection (NMActiveConnection *self,
NMConnection *connection)