gnome-session r4874 - in branches/dbus_based: . gnome-session
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-session r4874 - in branches/dbus_based: . gnome-session
- Date: Tue, 29 Jul 2008 15:53:13 +0000 (UTC)
Author: mccann
Date: Tue Jul 29 15:53:12 2008
New Revision: 4874
URL: http://svn.gnome.org/viewvc/gnome-session?rev=4874&view=rev
Log:
2008-07-29 William Jon McCann <jmccann redhat com>
* gnome-session/gsm-client.c (gsm_client_peek_id),
(gsm_client_peek_app_id), (gsm_client_peek_startup_id),
(gsm_client_peek_restart_style_hint), (gsm_client_get_startup_id),
(gsm_client_get_app_id), (gsm_client_get_restart_style_hint),
(gsm_client_get_app_name):
* gnome-session/gsm-client.h:
* gnome-session/gsm-client.xml:
* gnome-session/gsm-dbus-client.c (dbus_client_stop),
(dbus_client_query_end_session), (dbus_client_end_session):
* gnome-session/gsm-inhibit-dialog.c (add_inhibitor):
* gnome-session/gsm-inhibitor.c (gsm_inhibitor_peek_bus_name),
(gsm_inhibitor_get_app_id), (gsm_inhibitor_get_client_id),
(gsm_inhibitor_get_reason), (gsm_inhibitor_get_flags),
(gsm_inhibitor_get_toplevel_xid), (gsm_inhibitor_peek_id),
(gsm_inhibitor_peek_app_id), (gsm_inhibitor_peek_client_id),
(gsm_inhibitor_peek_reason), (gsm_inhibitor_peek_flags),
(gsm_inhibitor_peek_toplevel_xid), (gsm_inhibitor_peek_cookie):
* gnome-session/gsm-inhibitor.h:
* gnome-session/gsm-manager.c (_debug_client), (_debug_inhibitor),
(_find_by_cookie), (_find_by_startup_id), (_client_end_session),
(_client_query_end_session), (inhibitor_has_flag),
(inhibitor_is_jit), (on_query_end_session_timeout),
(disconnect_client), (inhibitor_has_bus_name),
(_client_has_startup_id), (inhibitor_has_client_id),
(on_client_end_session_response), (gsm_manager_register_client),
(gsm_manager_inhibit), (gsm_manager_uninhibit):
* gnome-session/gsm-xsmp-client.c (set_description):
* gnome-session/gsm-xsmp-server.c (accept_ice_connection):
Add client introspection info. Fix the inhibitor methods.
Modified:
branches/dbus_based/ChangeLog
branches/dbus_based/gnome-session/gsm-client.c
branches/dbus_based/gnome-session/gsm-client.h
branches/dbus_based/gnome-session/gsm-client.xml
branches/dbus_based/gnome-session/gsm-dbus-client.c
branches/dbus_based/gnome-session/gsm-inhibit-dialog.c
branches/dbus_based/gnome-session/gsm-inhibitor.c
branches/dbus_based/gnome-session/gsm-inhibitor.h
branches/dbus_based/gnome-session/gsm-manager.c
branches/dbus_based/gnome-session/gsm-xsmp-client.c
branches/dbus_based/gnome-session/gsm-xsmp-server.c
Modified: branches/dbus_based/gnome-session/gsm-client.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-client.c (original)
+++ branches/dbus_based/gnome-session/gsm-client.c Tue Jul 29 15:53:12 2008
@@ -297,44 +297,80 @@
}
const char *
-gsm_client_get_id (GsmClient *client)
+gsm_client_peek_id (GsmClient *client)
{
g_return_val_if_fail (GSM_IS_CLIENT (client), NULL);
return client->priv->id;
}
-
const char *
-gsm_client_get_startup_id (GsmClient *client)
+gsm_client_peek_app_id (GsmClient *client)
{
g_return_val_if_fail (GSM_IS_CLIENT (client), NULL);
- return client->priv->startup_id;
+ return client->priv->app_id;
}
const char *
-gsm_client_get_app_id (GsmClient *client)
+gsm_client_peek_startup_id (GsmClient *client)
{
g_return_val_if_fail (GSM_IS_CLIENT (client), NULL);
- return client->priv->app_id;
+ return client->priv->startup_id;
}
-char *
-gsm_client_get_app_name (GsmClient *client)
+guint
+gsm_client_peek_restart_style_hint (GsmClient *client)
{
- g_return_val_if_fail (GSM_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (GSM_IS_CLIENT (client), GSM_CLIENT_RESTART_NEVER);
- return GSM_CLIENT_GET_CLASS (client)->impl_get_app_name (client);
+ return GSM_CLIENT_GET_CLASS (client)->impl_get_restart_style_hint (client);
}
-GsmClientRestartStyle
-gsm_client_get_restart_style_hint (GsmClient *client)
+
+gboolean
+gsm_client_get_startup_id (GsmClient *client,
+ char **id,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_CLIENT (client), FALSE);
+
+ *id = g_strdup (client->priv->startup_id);
+
+ return TRUE;
+}
+
+gboolean
+gsm_client_get_app_id (GsmClient *client,
+ char **id,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_CLIENT (client), FALSE);
+
+ *id = g_strdup (client->priv->app_id);
+
+ return TRUE;
+}
+
+gboolean
+gsm_client_get_restart_style_hint (GsmClient *client,
+ guint *hint,
+ GError **error)
{
g_return_val_if_fail (GSM_IS_CLIENT (client), GSM_CLIENT_RESTART_NEVER);
- return GSM_CLIENT_GET_CLASS (client)->impl_get_restart_style_hint (client);
+ *hint = GSM_CLIENT_GET_CLASS (client)->impl_get_restart_style_hint (client);
+
+ return TRUE;
+}
+
+char *
+gsm_client_get_app_name (GsmClient *client)
+{
+ g_return_val_if_fail (GSM_IS_CLIENT (client), NULL);
+
+ return GSM_CLIENT_GET_CLASS (client)->impl_get_app_name (client);
}
void
Modified: branches/dbus_based/gnome-session/gsm-client.h
==============================================================================
--- branches/dbus_based/gnome-session/gsm-client.h (original)
+++ branches/dbus_based/gnome-session/gsm-client.h Tue Jul 29 15:53:12 2008
@@ -87,15 +87,18 @@
GType gsm_client_get_type (void) G_GNUC_CONST;
-const char *gsm_client_get_id (GsmClient *client);
-const char *gsm_client_get_startup_id (GsmClient *client);
-const char *gsm_client_get_app_id (GsmClient *client);
-char *gsm_client_get_app_name (GsmClient *client);
-GsmClientRestartStyle gsm_client_get_restart_style_hint (GsmClient *client);
+const char *gsm_client_peek_id (GsmClient *client);
+
+
+const char * gsm_client_peek_startup_id (GsmClient *client);
+const char * gsm_client_peek_app_id (GsmClient *client);
+guint gsm_client_peek_restart_style_hint (GsmClient *client);
+guint gsm_client_peek_status (GsmClient *client);
+
+char *gsm_client_get_app_name (GsmClient *client);
void gsm_client_set_app_id (GsmClient *client,
const char *app_id);
-int gsm_client_get_status (GsmClient *client);
void gsm_client_set_status (GsmClient *client,
int status);
@@ -105,10 +108,23 @@
guint flags);
void gsm_client_cancel_end_session (GsmClient *client);
+void gsm_client_disconnected (GsmClient *client);
+
+/* exported to bus */
gboolean gsm_client_stop (GsmClient *client,
GError **error);
-
-void gsm_client_disconnected (GsmClient *client);
+gboolean gsm_client_get_startup_id (GsmClient *client,
+ char **startup_id,
+ GError **error);
+gboolean gsm_client_get_app_id (GsmClient *client,
+ char **app_id,
+ GError **error);
+gboolean gsm_client_get_restart_style_hint (GsmClient *client,
+ guint *hint,
+ GError **error);
+gboolean gsm_client_get_status (GsmClient *client,
+ guint *status,
+ GError **error);
/* private */
Modified: branches/dbus_based/gnome-session/gsm-client.xml
==============================================================================
--- branches/dbus_based/gnome-session/gsm-client.xml (original)
+++ branches/dbus_based/gnome-session/gsm-client.xml Tue Jul 29 15:53:12 2008
@@ -1,6 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
+<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<interface name="org.gnome.SessionManager.Client">
+ <property name="app-id" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>The application identifier associated with the client</doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+ <property name="startup-id" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>The startup identifier to be used by the client</doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
</interface>
</node>
Modified: branches/dbus_based/gnome-session/gsm-dbus-client.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-dbus-client.c (original)
+++ branches/dbus_based/gnome-session/gsm-dbus-client.c Tue Jul 29 15:53:12 2008
@@ -203,7 +203,7 @@
ret = FALSE;
/* unicast the signal to only the registered bus name */
- message = dbus_message_new_signal (gsm_client_get_id (client),
+ message = dbus_message_new_signal (gsm_client_peek_id (client),
CLIENT_INTERFACE,
"Stop");
if (message == NULL) {
@@ -294,7 +294,7 @@
g_debug ("GsmDBusClient: sending QueryEndSession signal to %s", dbus_client->priv->bus_name);
/* unicast the signal to only the registered bus name */
- message = dbus_message_new_signal (gsm_client_get_id (client),
+ message = dbus_message_new_signal (gsm_client_peek_id (client),
CLIENT_INTERFACE,
"QueryEndSession");
if (message == NULL) {
@@ -341,7 +341,7 @@
ret = FALSE;
/* unicast the signal to only the registered bus name */
- message = dbus_message_new_signal (gsm_client_get_id (client),
+ message = dbus_message_new_signal (gsm_client_peek_id (client),
CLIENT_INTERFACE,
"EndSession");
if (message == NULL) {
Modified: branches/dbus_based/gnome-session/gsm-inhibit-dialog.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-inhibit-dialog.c (original)
+++ branches/dbus_based/gnome-session/gsm-inhibit-dialog.c Tue Jul 29 15:53:12 2008
@@ -484,7 +484,7 @@
name = NULL;
pixbuf = NULL;
- app_id = gsm_inhibitor_get_app_id (inhibitor);
+ app_id = gsm_inhibitor_peek_app_id (inhibitor);
if (app_id == NULL || app_id[0] == '\0') {
desktop_filename = NULL;
@@ -494,7 +494,7 @@
desktop_filename = g_strdup (app_id);
}
- xid = gsm_inhibitor_get_toplevel_xid (inhibitor);
+ xid = gsm_inhibitor_peek_toplevel_xid (inhibitor);
g_debug ("GsmInhibitDialog: inhibitor has XID %u", xid);
if (xid > 0 && dialog->priv->have_xrender) {
pixbuf = get_pixbuf_for_window (xid, DEFAULT_SNAPSHOT_SIZE, DEFAULT_SNAPSHOT_SIZE);
@@ -564,8 +564,8 @@
NULL, 0,
INHIBIT_IMAGE_COLUMN, pixbuf,
INHIBIT_NAME_COLUMN, name,
- INHIBIT_REASON_COLUMN, gsm_inhibitor_get_reason (inhibitor),
- INHIBIT_ID_COLUMN, gsm_inhibitor_get_id (inhibitor),
+ INHIBIT_REASON_COLUMN, gsm_inhibitor_peek_reason (inhibitor),
+ INHIBIT_ID_COLUMN, gsm_inhibitor_peek_id (inhibitor),
-1);
g_free (desktop_filename);
Modified: branches/dbus_based/gnome-session/gsm-inhibitor.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-inhibitor.c (original)
+++ branches/dbus_based/gnome-session/gsm-inhibitor.c Tue Jul 29 15:53:12 2008
@@ -208,15 +208,75 @@
}
const char *
-gsm_inhibitor_get_bus_name (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_bus_name (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), NULL);
return inhibitor->priv->bus_name;
}
+gboolean
+gsm_inhibitor_get_app_id (GsmInhibitor *inhibitor,
+ char **id,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), FALSE);
+
+ *id = g_strdup (inhibitor->priv->app_id);
+
+ return TRUE;
+}
+
+gboolean
+gsm_inhibitor_get_client_id (GsmInhibitor *inhibitor,
+ char **id,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), FALSE);
+
+ *id = g_strdup (inhibitor->priv->client_id);
+
+ return TRUE;
+}
+
+gboolean
+gsm_inhibitor_get_reason (GsmInhibitor *inhibitor,
+ char **reason,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), FALSE);
+
+ *reason = g_strdup (inhibitor->priv->reason);
+
+ return TRUE;
+}
+
+gboolean
+gsm_inhibitor_get_flags (GsmInhibitor *inhibitor,
+ guint *flags,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), FALSE);
+
+ *flags = inhibitor->priv->flags;
+
+ return TRUE;
+}
+
+gboolean
+gsm_inhibitor_get_toplevel_xid (GsmInhibitor *inhibitor,
+ guint *xid,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), FALSE);
+
+ *xid = inhibitor->priv->toplevel_xid;
+
+ return TRUE;
+}
+
const char *
-gsm_inhibitor_get_id (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_id (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), NULL);
@@ -224,7 +284,7 @@
}
const char *
-gsm_inhibitor_get_app_id (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_app_id (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), NULL);
@@ -232,7 +292,7 @@
}
const char *
-gsm_inhibitor_get_client_id (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_client_id (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), NULL);
@@ -240,7 +300,7 @@
}
const char *
-gsm_inhibitor_get_reason (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_reason (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), NULL);
@@ -248,7 +308,7 @@
}
guint
-gsm_inhibitor_get_flags (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_flags (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), 0);
@@ -256,7 +316,7 @@
}
guint
-gsm_inhibitor_get_toplevel_xid (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_toplevel_xid (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), 0);
@@ -264,7 +324,7 @@
}
guint
-gsm_inhibitor_get_cookie (GsmInhibitor *inhibitor)
+gsm_inhibitor_peek_cookie (GsmInhibitor *inhibitor)
{
g_return_val_if_fail (GSM_IS_INHIBITOR (inhibitor), 0);
Modified: branches/dbus_based/gnome-session/gsm-inhibitor.h
==============================================================================
--- branches/dbus_based/gnome-session/gsm-inhibitor.h (original)
+++ branches/dbus_based/gnome-session/gsm-inhibitor.h Tue Jul 29 15:53:12 2008
@@ -70,14 +70,32 @@
const char *bus_name,
guint cookie);
-const char * gsm_inhibitor_get_id (GsmInhibitor *inhibitor);
-const char * gsm_inhibitor_get_app_id (GsmInhibitor *inhibitor);
-const char * gsm_inhibitor_get_client_id (GsmInhibitor *inhibitor);
-const char * gsm_inhibitor_get_reason (GsmInhibitor *inhibitor);
-const char * gsm_inhibitor_get_bus_name (GsmInhibitor *inhibitor);
-guint gsm_inhibitor_get_cookie (GsmInhibitor *inhibitor);
-guint gsm_inhibitor_get_flags (GsmInhibitor *inhibitor);
-guint gsm_inhibitor_get_toplevel_xid (GsmInhibitor *inhibitor);
+const char * gsm_inhibitor_peek_id (GsmInhibitor *inhibitor);
+const char * gsm_inhibitor_peek_app_id (GsmInhibitor *inhibitor);
+const char * gsm_inhibitor_peek_client_id (GsmInhibitor *inhibitor);
+const char * gsm_inhibitor_peek_reason (GsmInhibitor *inhibitor);
+const char * gsm_inhibitor_peek_bus_name (GsmInhibitor *inhibitor);
+guint gsm_inhibitor_peek_cookie (GsmInhibitor *inhibitor);
+guint gsm_inhibitor_peek_flags (GsmInhibitor *inhibitor);
+guint gsm_inhibitor_peek_toplevel_xid (GsmInhibitor *inhibitor);
+
+/* exported to bus */
+gboolean gsm_inhibitor_get_app_id (GsmInhibitor *inhibitor,
+ char **id,
+ GError **error);
+gboolean gsm_inhibitor_get_client_id (GsmInhibitor *inhibitor,
+ char **id,
+ GError **error);
+gboolean gsm_inhibitor_get_reason (GsmInhibitor *inhibitor,
+ char **reason,
+ GError **error);
+gboolean gsm_inhibitor_get_flags (GsmInhibitor *inhibitor,
+ guint *flags,
+ GError **error);
+gboolean gsm_inhibitor_get_toplevel_xid (GsmInhibitor *inhibitor,
+ guint *xid,
+ GError **error);
+
G_END_DECLS
Modified: branches/dbus_based/gnome-session/gsm-manager.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-manager.c (original)
+++ branches/dbus_based/gnome-session/gsm-manager.c Tue Jul 29 15:53:12 2008
@@ -168,7 +168,7 @@
GsmClient *client,
GsmManager *manager)
{
- g_debug ("GsmManager: Client %s", gsm_client_get_id (client));
+ g_debug ("GsmManager: Client %s", gsm_client_peek_id (client));
return FALSE;
}
@@ -186,10 +186,10 @@
GsmManager *manager)
{
g_debug ("GsmManager: Inhibitor app:%s client:%s bus-name:%s reason:%s",
- gsm_inhibitor_get_app_id (inhibitor),
- gsm_inhibitor_get_client_id (inhibitor),
- gsm_inhibitor_get_bus_name (inhibitor),
- gsm_inhibitor_get_reason (inhibitor));
+ gsm_inhibitor_peek_app_id (inhibitor),
+ gsm_inhibitor_peek_client_id (inhibitor),
+ gsm_inhibitor_peek_bus_name (inhibitor),
+ gsm_inhibitor_peek_reason (inhibitor));
return FALSE;
}
@@ -208,7 +208,7 @@
{
guint cookie_b;
- cookie_b = gsm_inhibitor_get_cookie (inhibitor);
+ cookie_b = gsm_inhibitor_peek_cookie (inhibitor);
return (*cookie_ap == cookie_b);
}
@@ -220,7 +220,7 @@
{
const char *startup_id_b;
- startup_id_b = gsm_client_get_startup_id (client);
+ startup_id_b = gsm_client_peek_startup_id (client);
if (startup_id_b == NULL) {
return FALSE;
}
@@ -485,7 +485,7 @@
GsmClient *client,
ClientEndSessionData *data)
{
- g_debug ("GsmManager: adding client to end-session clients: %s", gsm_client_get_id (client));
+ g_debug ("GsmManager: adding client to end-session clients: %s", gsm_client_peek_id (client));
data->manager->priv->query_clients = g_slist_prepend (data->manager->priv->query_clients,
client);
@@ -529,7 +529,7 @@
GsmClient *client,
ClientEndSessionData *data)
{
- g_debug ("GsmManager: adding client to query clients: %s", gsm_client_get_id (client));
+ g_debug ("GsmManager: adding client to query clients: %s", gsm_client_peek_id (client));
data->manager->priv->query_clients = g_slist_prepend (data->manager->priv->query_clients,
client);
gsm_client_query_end_session (client, data->flags);
@@ -547,7 +547,7 @@
flag = GPOINTER_TO_UINT (data);
- flags = gsm_inhibitor_get_flags (inhibitor);
+ flags = gsm_inhibitor_peek_flags (inhibitor);
return (flags & flag);
}
@@ -588,7 +588,7 @@
gboolean matches;
const char *id;
- id = gsm_inhibitor_get_client_id (inhibitor);
+ id = gsm_inhibitor_peek_client_id (inhibitor);
matches = (id != NULL && id[0] != '\0');
@@ -845,7 +845,7 @@
char *app_id;
g_warning ("Client '%s' failed to reply before timeout",
- gsm_client_get_id (l->data));
+ gsm_client_peek_id (l->data));
/* Add JIT inhibit for unresponsive client */
if (GSM_IS_DBUS_CLIENT (l->data)) {
@@ -854,21 +854,21 @@
bus_name = NULL;
}
- app_id = g_strdup (gsm_client_get_app_id (l->data));
+ app_id = g_strdup (gsm_client_peek_app_id (l->data));
if (app_id == NULL || app_id[0] == '\0') {
/* XSMP clients don't give us an app id unless we start them */
app_id = gsm_client_get_app_name (l->data);
}
cookie = _generate_unique_cookie (manager);
- inhibitor = gsm_inhibitor_new_for_client (gsm_client_get_id (l->data),
+ inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (l->data),
app_id,
GSM_INHIBITOR_FLAG_LOGOUT,
_("Not responding"),
bus_name,
cookie);
g_free (app_id);
- gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_get_id (inhibitor), G_OBJECT (inhibitor));
+ gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), G_OBJECT (inhibitor));
g_object_unref (inhibitor);
}
@@ -996,7 +996,7 @@
/* take a ref so it doesn't get finalized */
g_object_ref (client);
- gsm_store_remove (manager->priv->clients, gsm_client_get_id (client));
+ gsm_store_remove (manager->priv->clients, gsm_client_peek_id (client));
is_condition_client = FALSE;
if (g_slist_find (manager->priv->condition_clients, client)) {
@@ -1005,7 +1005,7 @@
is_condition_client = TRUE;
}
- app_id = gsm_client_get_app_id (client);
+ app_id = gsm_client_peek_app_id (client);
if (app_id == NULL) {
g_debug ("GsmManager: no application associated with client, not restarting application");
goto out;
@@ -1024,7 +1024,7 @@
}
app_restart = gsm_app_get_autorestart (app);
- client_restart_hint = gsm_client_get_restart_style_hint (client);
+ client_restart_hint = gsm_client_peek_restart_style_hint (client);
/* allow legacy clients to override the app info */
if (! app_restart
@@ -1108,16 +1108,16 @@
gboolean matches;
const char *bus_name_b;
- bus_name_b = gsm_inhibitor_get_bus_name (inhibitor);
+ bus_name_b = gsm_inhibitor_peek_bus_name (inhibitor);
matches = FALSE;
if (data->service_name != NULL && bus_name_b != NULL) {
matches = (strcmp (data->service_name, bus_name_b) == 0);
if (matches) {
g_debug ("GsmManager: removing inhibitor from %s for reason '%s' on connection %s",
- gsm_inhibitor_get_app_id (inhibitor),
- gsm_inhibitor_get_reason (inhibitor),
- gsm_inhibitor_get_bus_name (inhibitor));
+ gsm_inhibitor_peek_app_id (inhibitor),
+ gsm_inhibitor_peek_reason (inhibitor),
+ gsm_inhibitor_peek_bus_name (inhibitor));
}
}
@@ -1266,7 +1266,7 @@
{
const char *startup_id_b;
- startup_id_b = gsm_client_get_startup_id (client);
+ startup_id_b = gsm_client_peek_startup_id (client);
if (startup_id_b == NULL) {
return FALSE;
@@ -1353,15 +1353,15 @@
gboolean matches;
const char *client_id_b;
- client_id_b = gsm_inhibitor_get_client_id (inhibitor);
+ client_id_b = gsm_inhibitor_peek_client_id (inhibitor);
matches = FALSE;
if (client_id_a != NULL && client_id_b != NULL) {
matches = (strcmp (client_id_a, client_id_b) == 0);
if (matches) {
g_debug ("GsmManager: removing JIT inhibitor for %s for reason '%s'",
- gsm_inhibitor_get_client_id (inhibitor),
- gsm_inhibitor_get_reason (inhibitor));
+ gsm_inhibitor_peek_client_id (inhibitor),
+ gsm_inhibitor_peek_reason (inhibitor));
}
}
@@ -1398,26 +1398,26 @@
bus_name = NULL;
}
- app_id = g_strdup (gsm_client_get_app_id (client));
+ app_id = g_strdup (gsm_client_peek_app_id (client));
if (app_id == NULL || app_id[0] == '\0') {
/* XSMP clients don't give us an app id unless we start them */
app_id = gsm_client_get_app_name (client);
}
cookie = _generate_unique_cookie (manager);
- inhibitor = gsm_inhibitor_new_for_client (gsm_client_get_id (client),
+ inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (client),
app_id,
GSM_INHIBITOR_FLAG_LOGOUT,
reason,
bus_name,
cookie);
g_free (app_id);
- gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_get_id (inhibitor), G_OBJECT (inhibitor));
+ gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), G_OBJECT (inhibitor));
g_object_unref (inhibitor);
} else {
gsm_store_foreach_remove (manager->priv->inhibitors,
(GsmStoreFunc)inhibitor_has_client_id,
- (gpointer)gsm_client_get_id (client));
+ (gpointer)gsm_client_peek_id (client));
}
if (manager->priv->query_clients == NULL
@@ -2540,7 +2540,7 @@
return FALSE;
}
- gsm_store_add (manager->priv->clients, gsm_client_get_id (client), G_OBJECT (client));
+ gsm_store_add (manager->priv->clients, gsm_client_peek_id (client), G_OBJECT (client));
if (app != NULL) {
gsm_client_set_app_id (client, gsm_app_get_id (app));
@@ -2556,7 +2556,7 @@
g_assert (new_startup_id != NULL);
g_free (new_startup_id);
- dbus_g_method_return (context, gsm_client_get_id (client));
+ dbus_g_method_return (context, gsm_client_peek_id (client));
return TRUE;
}
@@ -2657,7 +2657,7 @@
reason,
dbus_g_method_get_sender (context),
cookie);
- gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_get_id (inhibitor), G_OBJECT (inhibitor));
+ gsm_store_add (manager->priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), G_OBJECT (inhibitor));
g_object_unref (inhibitor);
dbus_g_method_return (context, cookie);
@@ -2692,13 +2692,13 @@
}
g_debug ("GsmManager: removing inhibitor %s %u reason '%s' %u connection %s",
- gsm_inhibitor_get_app_id (inhibitor),
- gsm_inhibitor_get_toplevel_xid (inhibitor),
- gsm_inhibitor_get_reason (inhibitor),
- gsm_inhibitor_get_flags (inhibitor),
- gsm_inhibitor_get_bus_name (inhibitor));
+ gsm_inhibitor_peek_app_id (inhibitor),
+ gsm_inhibitor_peek_toplevel_xid (inhibitor),
+ gsm_inhibitor_peek_reason (inhibitor),
+ gsm_inhibitor_peek_flags (inhibitor),
+ gsm_inhibitor_peek_bus_name (inhibitor));
- gsm_store_remove (manager->priv->inhibitors, gsm_inhibitor_get_id (inhibitor));
+ gsm_store_remove (manager->priv->inhibitors, gsm_inhibitor_peek_id (inhibitor));
dbus_g_method_return (context);
Modified: branches/dbus_based/gnome-session/gsm-xsmp-client.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-xsmp-client.c (original)
+++ branches/dbus_based/gnome-session/gsm-xsmp-client.c Tue Jul 29 15:53:12 2008
@@ -140,7 +140,7 @@
const char *id;
prop = find_property (client, SmProgram, NULL);
- id = gsm_client_get_startup_id (GSM_CLIENT (client));
+ id = gsm_client_peek_startup_id (GSM_CLIENT (client));
g_free (client->priv->description);
if (prop) {
Modified: branches/dbus_based/gnome-session/gsm-xsmp-server.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-xsmp-server.c (original)
+++ branches/dbus_based/gnome-session/gsm-xsmp-server.c Tue Jul 29 15:53:12 2008
@@ -126,7 +126,7 @@
client = gsm_xsmp_client_new (ice_conn);
ice_conn->context = client;
- gsm_store_add (server->priv->client_store, gsm_client_get_id (client), G_OBJECT (client));
+ gsm_store_add (server->priv->client_store, gsm_client_peek_id (client), G_OBJECT (client));
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]