[gnome-settings-daemon] sharing: use UUIDs instead of IDs for NM connection identification



commit bc3be2b760963688f15d28a853cd99954594e979
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jun 25 12:14:31 2014 +0200

    sharing: use UUIDs instead of IDs for NM connection identification
    
    Despite the name, the connection ID is a human readable string
    and is not guaranteed to be unique.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732218

 ...ttings-daemon.plugins.sharing.gschema.xml.in.in |    2 +-
 plugins/sharing/gsd-sharing-manager.c              |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in.in 
b/data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in.in
index 2389a94..0668b66 100644
--- a/data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in.in
@@ -16,7 +16,7 @@
     <key name="enabled-connections" type="as">
       <default>[]</default>
       <_summary>On which connections the service is enabled</_summary>
-      <_description>The list of NetworkManager connections on which this service is enabled and 
started.</_description>
+      <_description>The list of NetworkManager connections (each one represented with its UUID) on which 
this service is enabled and started.</_description>
     </key>
   </schema>
 </schemalist>
diff --git a/plugins/sharing/gsd-sharing-manager.c b/plugins/sharing/gsd-sharing-manager.c
index bb013b0..9ef4d01 100644
--- a/plugins/sharing/gsd-sharing-manager.c
+++ b/plugins/sharing/gsd-sharing-manager.c
@@ -351,8 +351,8 @@ gsd_sharing_manager_disable_service (GsdSharingManager  *manager,
 
 #ifdef HAVE_NETWORK_MANAGER
 static const char *
-get_type_for_connection_id (GsdSharingManager *manager,
-                            const char        *id)
+get_type_for_connection_uuid (GsdSharingManager *manager,
+                              const char        *uuid)
 {
         NMRemoteConnection *conn;
         const char *type;
@@ -360,7 +360,7 @@ get_type_for_connection_id (GsdSharingManager *manager,
         if (!manager->priv->remote_settings)
                 return NULL;
 
-        conn = nm_remote_settings_get_connection_by_id (manager->priv->remote_settings, id);
+        conn = nm_remote_settings_get_connection_by_uuid (manager->priv->remote_settings, uuid);
         if (!conn)
                 return NULL;
         type = nm_connection_get_connection_type (NM_CONNECTION (conn));
@@ -379,14 +379,14 @@ get_type_for_connection_id (GsdSharingManager *manager,
 #ifdef HAVE_NETWORK_MANAGER
 static gboolean
 connection_is_low_security (GsdSharingManager *manager,
-                            const char        *id)
+                            const char        *uuid)
 {
         NMRemoteConnection *conn;
 
         if (!manager->priv->remote_settings)
                 return TRUE;
 
-        conn = nm_remote_settings_get_connection_by_id (manager->priv->remote_settings, id);
+        conn = nm_remote_settings_get_connection_by_uuid (manager->priv->remote_settings, uuid);
         if (!conn)
                 return TRUE;
 
@@ -423,7 +423,7 @@ gsd_sharing_manager_list_networks (GsdSharingManager  *manager,
         for (i = 0; connections[i] != NULL; i++) {
                 const char *type;
 
-                type = get_type_for_connection_id (manager, connections[i]);
+                type = get_type_for_connection_uuid (manager, connections[i]);
                 if (!type)
                         continue;
 
@@ -574,7 +574,7 @@ primary_connection_changed (GObject    *gobject,
         g_clear_pointer (&manager->priv->carrier_type, g_free);
 
         if (a_con) {
-                manager->priv->current_network = g_strdup (nm_active_connection_get_id (a_con));
+                manager->priv->current_network = g_strdup (nm_active_connection_get_uuid (a_con));
                 manager->priv->carrier_type = g_strdup (nm_active_connection_get_connection_type (a_con));
         } else {
                 manager->priv->current_network = g_strdup ("");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]