[Xfce4-commits] <libxfce4ui:master> Return a NULL state file is the sm-client is disabled.

Nick Schermer noreply at xfce.org
Fri Nov 26 15:58:01 CET 2010


Updating branch refs/heads/master
         to 5fc236e047b7cf4996177ec84271fbf1422818ca (commit)
       from 8a6f910703c6ba9b40c74feb78f875ed616e1442 (commit)

commit 5fc236e047b7cf4996177ec84271fbf1422818ca
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Nov 26 15:56:25 2010 +0100

    Return a NULL state file is the sm-client is disabled.

 libxfce4ui/xfce-sm-client.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libxfce4ui/xfce-sm-client.c b/libxfce4ui/xfce-sm-client.c
index 13f40ed..65049ab 100644
--- a/libxfce4ui/xfce-sm-client.c
+++ b/libxfce4ui/xfce-sm-client.c
@@ -2169,7 +2169,8 @@ xfce_sm_client_get_client_id(XfceSMClient *sm_client)
  * valid program identifier set (see xfce_sm_client_set_program())
  * and a valid client ID (see xfce_sm_client_get_client_id()).
  *
- * Returns: a file name string, owned by the object
+ * Returns: a file name string, owned by the object or %NULL if
+ *          the session client is disabled.
  **/
 G_CONST_RETURN gchar *
 xfce_sm_client_get_state_file(XfceSMClient *sm_client)
@@ -2179,11 +2180,12 @@ xfce_sm_client_get_state_file(XfceSMClient *sm_client)
 
     g_return_val_if_fail(XFCE_IS_SM_CLIENT(sm_client), NULL);
 
+    if(!sm_client->client_id)
+        return NULL;
+
     if(sm_client->state_file)
         return sm_client->state_file;
 
-    g_return_val_if_fail(sm_client->client_id, NULL);
-
     prgname = g_get_prgname();
     if(G_UNLIKELY(!prgname))
         prgname = "unknown";



More information about the Xfce4-commits mailing list