[gnome-session] gsm, capplet: Do not define IS_STRING_EMPTY in multiple places



commit 378f502047022b263d14bbbec213ad442e5ad822
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Nov 29 15:13:50 2010 +0100

    gsm, capplet: Do not define IS_STRING_EMPTY in multiple places
    
    Just define it in gsm-util.h once.

 capplet/gsm-properties-dialog.c    |    2 --
 gnome-session/gsm-dbus-client.c    |    3 +--
 gnome-session/gsm-inhibit-dialog.c |    2 --
 gnome-session/gsm-inhibitor.c      |    4 ++--
 gnome-session/gsm-manager.c        |    2 --
 gnome-session/gsm-presence.c       |    2 --
 gnome-session/gsm-session-fill.c   |    5 ++---
 gnome-session/gsm-util.h           |    2 ++
 gnome-session/gsm-xsmp-client.c    |    2 --
 9 files changed, 7 insertions(+), 17 deletions(-)
---
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
index 1410bdd..c49bf42 100644
--- a/capplet/gsm-properties-dialog.c
+++ b/capplet/gsm-properties-dialog.c
@@ -38,8 +38,6 @@
 
 #define GSM_PROPERTIES_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_PROPERTIES_DIALOG, GsmPropertiesDialogPrivate))
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 #define REALLY_IDENTICAL_STRING(a, b)                   \
         ((a && b && !strcmp (a, b)) || (!a && !b))
 
diff --git a/gnome-session/gsm-dbus-client.c b/gnome-session/gsm-dbus-client.c
index e0aaf3d..8d44f50 100644
--- a/gnome-session/gsm-dbus-client.c
+++ b/gnome-session/gsm-dbus-client.c
@@ -36,11 +36,10 @@
 #include "gsm-marshal.h"
 
 #include "gsm-manager.h"
+#include "gsm-util.h"
 
 #define GSM_DBUS_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_DBUS_CLIENT, GsmDBusClientPrivate))
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 
 #define SM_DBUS_NAME                     "org.gnome.SessionManager"
 #define SM_DBUS_CLIENT_PRIVATE_INTERFACE "org.gnome.SessionManager.ClientPrivate"
diff --git a/gnome-session/gsm-inhibit-dialog.c b/gnome-session/gsm-inhibit-dialog.c
index e11ad2e..7621a5b 100644
--- a/gnome-session/gsm-inhibit-dialog.c
+++ b/gnome-session/gsm-inhibit-dialog.c
@@ -47,8 +47,6 @@
 
 #define GSM_INHIBIT_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_INHIBIT_DIALOG, GsmInhibitDialogPrivate))
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 #define GTKBUILDER_FILE "gsm-inhibit-dialog.ui"
 
 #ifndef DEFAULT_ICON_SIZE
diff --git a/gnome-session/gsm-inhibitor.c b/gnome-session/gsm-inhibitor.c
index 4b7178c..56525c5 100644
--- a/gnome-session/gsm-inhibitor.c
+++ b/gnome-session/gsm-inhibitor.c
@@ -31,9 +31,9 @@
 #include "gsm-inhibitor.h"
 #include "gsm-inhibitor-glue.h"
 
-static guint32 inhibitor_serial = 1;
+#include "gsm-util.h"
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
+static guint32 inhibitor_serial = 1;
 
 #define GSM_INHIBITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_INHIBITOR, GsmInhibitorPrivate))
 
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index d5a774f..2b4ad93 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -85,8 +85,6 @@
 
 #define KEY_SLEEP_LOCK            "/apps/gnome-screensaver/lock_enabled"
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 typedef enum
 {
         GSM_MANAGER_LOGOUT_NONE,
diff --git a/gnome-session/gsm-presence.c b/gnome-session/gsm-presence.c
index c3918de..942ea9f 100644
--- a/gnome-session/gsm-presence.c
+++ b/gnome-session/gsm-presence.c
@@ -41,8 +41,6 @@
 
 #define MAX_STATUS_TEXT 140
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 #define GSM_PRESENCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_PRESENCE, GsmPresencePrivate))
 
 struct GsmPresencePrivate
diff --git a/gnome-session/gsm-session-fill.c b/gnome-session/gsm-session-fill.c
index 1d5099d..4745ea5 100644
--- a/gnome-session/gsm-session-fill.c
+++ b/gnome-session/gsm-session-fill.c
@@ -21,18 +21,17 @@
 
 #include <config.h>
 
+#include "gsm-session-fill.h"
+
 #include "gsm-consolekit.h"
 #include "gsm-gconf.h"
 #include "gsm-util.h"
 #include "gsm-manager.h"
-#include "gsm-session-fill.h"
 
 #define GSM_GCONF_DEFAULT_SESSION_KEY           "/desktop/gnome/session/default_session"
 #define GSM_GCONF_REQUIRED_COMPONENTS_DIRECTORY "/desktop/gnome/session/required_components"
 #define GSM_GCONF_REQUIRED_COMPONENTS_LIST_KEY  "/desktop/gnome/session/required_components_list"
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 /* This doesn't contain the required components, so we need to always
  * call append_required_apps() after a call to append_default_apps(). */
 static void
diff --git a/gnome-session/gsm-util.h b/gnome-session/gsm-util.h
index b67a4ab..1a437f7 100644
--- a/gnome-session/gsm-util.h
+++ b/gnome-session/gsm-util.h
@@ -24,6 +24,8 @@
 
 G_BEGIN_DECLS
 
+#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
+
 char *      gsm_util_find_desktop_file_for_app_name (const char  *app_name,
                                                      char       **dirs);
 
diff --git a/gnome-session/gsm-xsmp-client.c b/gnome-session/gsm-xsmp-client.c
index ce22ed9..f62cb4f 100644
--- a/gnome-session/gsm-xsmp-client.c
+++ b/gnome-session/gsm-xsmp-client.c
@@ -40,8 +40,6 @@
 
 #define GsmDesktopFile "_GSM_DesktopFile"
 
-#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
-
 #define GSM_XSMP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_XSMP_CLIENT, GsmXSMPClientPrivate))
 
 struct GsmXSMPClientPrivate



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