mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 23:30:07 +01:00
2007-08-29 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h - Keep NMConnection object path in sync * libnm-glib/nm-settings.c libnm-glib/nm-settings.h - Break D-Bus object registration out of the init function, because every object that's exported over D-Bus needs to use the _same_ DBusConnection. Otherwise, each object would get a different object path tree and wouldn't be callable. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2747 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
9aab44b772
commit
ad0f89c69f
4 changed files with 31 additions and 12 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2007-08-29 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* include/NetworkManager.h
|
||||
- Keep NMConnection object path in sync
|
||||
|
||||
* libnm-glib/nm-settings.c
|
||||
libnm-glib/nm-settings.h
|
||||
- Break D-Bus object registration out of the init function, because
|
||||
every object that's exported over D-Bus needs to use the _same_
|
||||
DBusConnection. Otherwise, each object would get a different object
|
||||
path tree and wouldn't be callable.
|
||||
|
||||
2007-08-29 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/nm-setting.h
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#define NM_DBUS_PATH_ACCESS_POINT "/org/freedesktop/NetworkManager/AccessPoint"
|
||||
#define NM_DBUS_INTERFACE_ACCESS_POINT "org.freedesktop.NetworkManager.AccessPoint"
|
||||
|
||||
#define NM_DBUS_PATH_CONNECTION_SETTINGS "/org/freedesktop/NetworkManager/Settings/Connection"
|
||||
#define NM_DBUS_PATH_CONNECTION_SETTINGS "/org/freedesktop/NetworkManagerUserSettings/Connection"
|
||||
|
||||
#define NMI_DBUS_SERVICE "org.freedesktop.NetworkManagerInfo"
|
||||
#define NMI_DBUS_PATH "/org/freedesktop/NetworkManagerInfo"
|
||||
|
|
|
|||
|
|
@ -198,17 +198,6 @@ nm_connection_settings_init (NMConnectionSettings *connection)
|
|||
connection->dbus_path = g_strdup_printf ("%s/%u",
|
||||
NM_DBUS_PATH_CONNECTION_SETTINGS,
|
||||
cs_counter++);
|
||||
|
||||
/* register object with DBus */
|
||||
bus_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
||||
if (!bus_connection) {
|
||||
g_warning ("Couldn't connect to session bus: %s", error->message);
|
||||
g_error_free (error);
|
||||
} else {
|
||||
dbus_g_connection_register_g_object (bus_connection,
|
||||
connection->dbus_path,
|
||||
G_OBJECT (connection));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -220,6 +209,8 @@ nm_connection_settings_dispose (GObject *object)
|
|||
g_free (self->dbus_path);
|
||||
self->dbus_path = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nm_connection_settings_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -264,6 +255,18 @@ nm_connection_settings_class_init (NMConnectionSettingsClass *connection_setting
|
|||
&dbus_glib_nm_connection_settings_object_info);
|
||||
}
|
||||
|
||||
void
|
||||
nm_connection_settings_register_object (NMConnectionSettings *connection,
|
||||
DBusGConnection *dbus_connection)
|
||||
{
|
||||
g_return_if_fail (NM_IS_CONNECTION_SETTINGS (connection));
|
||||
g_return_if_fail (dbus_connection != NULL);
|
||||
|
||||
dbus_g_connection_register_g_object (dbus_connection,
|
||||
connection->dbus_path,
|
||||
G_OBJECT (connection));
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_connection_settings_get_dbus_object_path (NMConnectionSettings *connection)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,8 +34,12 @@ typedef struct {
|
|||
} NMConnectionSettingsClass;
|
||||
|
||||
GType nm_connection_settings_get_type (void);
|
||||
void
|
||||
nm_connection_settings_register_object (NMConnectionSettings *connection,
|
||||
DBusGConnection *dbus_connection);
|
||||
const char *nm_connection_settings_get_dbus_object_path (NMConnectionSettings *connection);
|
||||
|
||||
|
||||
void nm_connection_settings_signal_updated (NMConnectionSettings *connection, GHashTable *settings);
|
||||
void nm_connection_settings_signal_removed (NMConnectionSettings *connection);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue