NetworkManager r3274 - in branches/NETWORKMANAGER_0_6_0_RELEASE: . src/vpn-manager
- From: tambeti svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3274 - in branches/NETWORKMANAGER_0_6_0_RELEASE: . src/vpn-manager
- Date: Wed, 30 Jan 2008 03:23:06 +0000 (GMT)
Author: tambeti
Date: Wed Jan 30 03:23:06 2008
New Revision: 3274
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3274&view=rev
Log:
2008-01-29 Tambet Ingo <tambet gmail com>
* src/vpn-manager/nm-dbus-vpn.c
* (nm_dbus_vpn_connections_update_cb): Don't
try to merge the VPN connections, just add everything.
(nm_dbus_vpn_connections_update_from_nmi): Remove the existing
VPN connections
when a new instance of NMI service appears.
* src/vpn-manager/nm-vpn-manager.c
* (nm_vpn_manager_vpn_connection_list_copy):
Remove.
(nm_vpn_manager_clear_connections): Implement.
Modified:
branches/NETWORKMANAGER_0_6_0_RELEASE/ChangeLog
branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-dbus-vpn.c
branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.c
branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.h
Modified: branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-dbus-vpn.c
==============================================================================
--- branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-dbus-vpn.c (original)
+++ branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-dbus-vpn.c Wed Jan 30 03:23:06 2008
@@ -410,8 +410,6 @@
NMData * data = (NMData *) user_data;
DBusMessage * reply;
DBusMessageIter iter, array_iter;
- GSList * remove_list = NULL;
- GSList * elt;
g_return_if_fail (pcall);
g_return_if_fail (data != NULL);
@@ -427,22 +425,15 @@
nm_info ("Updating VPN Connections...");
- remove_list = nm_vpn_manager_vpn_connection_list_copy (data->vpn_manager);
-
dbus_message_iter_init (reply, &iter);
dbus_message_iter_recurse (&iter, &array_iter);
while (dbus_message_iter_get_arg_type (&array_iter) == DBUS_TYPE_STRING)
{
DBusMessage * message;
const char * con_name;
- NMVPNConnection * vpn;
dbus_message_iter_get_basic (&array_iter, &con_name);
- /* If the connection already exists, remove it from the remove list */
- if ((vpn = nm_vpn_manager_find_connection_by_name (data->vpn_manager, con_name)))
- remove_list = g_slist_remove (remove_list, vpn);
-
if ((message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnectionProperties")))
{
DBusPendingCall * vpn_pcall = NULL;
@@ -463,15 +454,6 @@
}
dbus_message_unref (reply);
- /* VPN connections left in the remove list aren't known by NMI, therefore we delete them */
- for (elt = remove_list; elt; elt = g_slist_next (elt))
- {
- nm_vpn_manager_remove_connection (data->vpn_manager, elt->data);
- nm_vpn_connection_unref (elt->data);
- }
-
- g_slist_free (remove_list);
-
out:
dbus_pending_call_unref (pcall);
}
@@ -527,6 +509,8 @@
g_return_val_if_fail (data->dbus_connection != NULL, FALSE);
g_return_val_if_fail (data->vpn_manager != NULL, FALSE);
+ nm_vpn_manager_clear_connections (data->vpn_manager);
+
if (!(message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnections")))
{
nm_warning ("nm_dbus_vpn_connections_update (): Couldn't allocate the dbus message");
Modified: branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.c
==============================================================================
--- branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.c (original)
+++ branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.c Wed Jan 30 03:23:06 2008
@@ -130,28 +130,6 @@
/*
- * nm_vpn_manager_vpn_connection_list_copy
- *
- * Make a shallow copy of the VPN connection list, should
- * only be used by nm-dbus-vpn.c
- *
- */
-GSList *nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager)
-{
- GSList * list;
- GSList * elt;
-
- g_return_val_if_fail (manager != NULL, NULL);
-
- list = g_slist_copy (manager->connections);
- for (elt = list; elt; elt = g_slist_next (elt))
- nm_vpn_connection_ref (elt->data);
-
- return list;
-}
-
-
-/*
* nm_vpn_manager_add_connection
*
* Add a new VPN connection if none already exits, otherwise update the existing one.
@@ -227,6 +205,29 @@
/*
+ * nm_vpn_manager_clear_connections
+ *
+ * Remove all VPN connections.
+ *
+ */
+void
+nm_vpn_manager_clear_connections (NMVPNManager *manager)
+{
+ GSList *connections;
+ GSList *iter;
+
+ g_return_if_fail (manager != NULL);
+
+ connections = g_slist_copy (manager->connections);
+
+ for (iter = connections; iter; iter = iter->next)
+ nm_vpn_manager_remove_connection (manager, (NMVPNConnection *) iter->data);
+
+ g_slist_free (connections);
+}
+
+
+/*
* nm_vpn_manager_get_connection_names
*
* Return an array of strings of all the VPN Connection names
Modified: branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.h
==============================================================================
--- branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.h (original)
+++ branches/NETWORKMANAGER_0_6_0_RELEASE/src/vpn-manager/nm-vpn-manager.h Wed Jan 30 03:23:06 2008
@@ -29,13 +29,12 @@
NMVPNManager * nm_vpn_manager_new (NMData *app_data);
NMVPNConnection * nm_vpn_manager_add_connection (NMVPNManager *manager, const char *name, const char *service_name, const char *user_name);
void nm_vpn_manager_remove_connection (NMVPNManager *manager, NMVPNConnection *vpn);
+void nm_vpn_manager_clear_connections (NMVPNManager *manager);
char ** nm_vpn_manager_get_connection_names (NMVPNManager *manager);
void nm_vpn_manager_dispose (NMVPNManager *manager);
NMVPNActRequest * nm_vpn_manager_get_vpn_act_request (NMVPNManager *manager);
-GSList * nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager);
-
void nm_vpn_manager_activate_vpn_connection (NMVPNManager *manager, NMVPNConnection *vpn, char **password_items,
int password_count, char **data_items, int data_count,
char **user_routes, int user_routes_count );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]