[gnome-session] [gsm] Use defines for GKeyFile keys we use
- From: Vincent Untz <vuntz src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-session] [gsm] Use defines for GKeyFile keys we use
- Date: Mon, 29 Jun 2009 20:59:17 +0000 (UTC)
commit f0be9f71bca86c111d31794bdb3ef3ba792838db
Author: Vincent Untz <vuntz gnome org>
Date: Wed Jun 24 23:44:41 2009 +0200
[gsm] Use defines for GKeyFile keys we use
This will help us avoid typos, and they're now easier to find.
gnome-session/gsm-autostart-app.c | 28 ++++++++++++++--------------
gnome-session/gsm-autostart-app.h | 10 ++++++++++
gnome-session/gsm-session-save.c | 5 +++--
gnome-session/gsm-xsmp-client.c | 5 +++--
4 files changed, 30 insertions(+), 18 deletions(-)
---
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 095dda7..529a346 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -105,12 +105,12 @@ is_disabled (GsmApp *app)
priv = GSM_AUTOSTART_APP (app)->priv;
- /* X-GNOME-Autostart-enabled key, used by old gnome-session */
+ /* GSM_AUTOSTART_APP_ENABLED_KEY key, used by old gnome-session */
if (egg_desktop_file_has_key (priv->desktop_file,
- "X-GNOME-Autostart-enabled", NULL) &&
+ GSM_AUTOSTART_APP_ENABLED_KEY, NULL) &&
!egg_desktop_file_get_boolean (priv->desktop_file,
- "X-GNOME-Autostart-enabled", NULL)) {
- g_debug ("app %s is disabled by X-GNOME-Autostart-enabled",
+ GSM_AUTOSTART_APP_ENABLED_KEY, NULL)) {
+ g_debug ("app %s is disabled by " GSM_AUTOSTART_APP_ENABLED_KEY,
gsm_app_peek_id (app));
return TRUE;
}
@@ -387,7 +387,7 @@ load_desktop_file (GsmAutostartApp *app)
}
phase_str = egg_desktop_file_get_string (app->priv->desktop_file,
- "X-GNOME-Autostart-Phase",
+ GSM_AUTOSTART_APP_PHASE_KEY,
NULL);
if (phase_str != NULL) {
if (strcmp (phase_str, "Initialization") == 0) {
@@ -408,7 +408,7 @@ load_desktop_file (GsmAutostartApp *app)
}
dbus_name = egg_desktop_file_get_string (app->priv->desktop_file,
- "X-GNOME-DBus-Name",
+ GSM_AUTOSTART_APP_DBUS_NAME_KEY,
NULL);
if (dbus_name != NULL) {
app->priv->launch_type = AUTOSTART_LAUNCH_ACTIVATE;
@@ -421,7 +421,7 @@ load_desktop_file (GsmAutostartApp *app)
case AUTOSTART_LAUNCH_SPAWN:
startup_id =
egg_desktop_file_get_string (app->priv->desktop_file,
- "X-GNOME-Autostart-startup-id",
+ GSM_AUTOSTART_APP_STARTUP_ID_KEY,
NULL);
if (startup_id == NULL) {
@@ -436,11 +436,11 @@ load_desktop_file (GsmAutostartApp *app)
}
res = egg_desktop_file_has_key (app->priv->desktop_file,
- "X-GNOME-AutoRestart",
+ GSM_AUTOSTART_APP_AUTORESTART_KEY,
NULL);
if (res) {
app->priv->autorestart = egg_desktop_file_get_boolean (app->priv->desktop_file,
- "X-GNOME-AutoRestart",
+ GSM_AUTOSTART_APP_AUTORESTART_KEY,
NULL);
} else {
app->priv->autorestart = FALSE;
@@ -875,7 +875,7 @@ autostart_app_start_activate (GsmAutostartApp *app,
g_assert (name != NULL);
path = egg_desktop_file_get_string (app->priv->desktop_file,
- "X-GNOME-DBus-Path",
+ GSM_AUTOSTART_APP_DBUS_PATH_KEY,
NULL);
if (path == NULL) {
/* just pick one? */
@@ -883,7 +883,7 @@ autostart_app_start_activate (GsmAutostartApp *app,
}
arguments = egg_desktop_file_get_string (app->priv->desktop_file,
- "X-GNOME-DBus-Start-Arguments",
+ GSM_AUTOSTART_APP_DBUS_ARGS_KEY,
NULL);
app->priv->proxy = dbus_g_proxy_new_for_name (bus,
@@ -986,7 +986,7 @@ gsm_autostart_app_provides (GsmApp *app,
}
provides = egg_desktop_file_get_string_list (aapp->priv->desktop_file,
- "X-GNOME-Provides",
+ GSM_AUTOSTART_APP_PROVIDES_KEY,
&len, NULL);
if (!provides) {
return FALSE;
@@ -1038,11 +1038,11 @@ gsm_autostart_app_get_autorestart (GsmApp *app)
autorestart = FALSE;
res = egg_desktop_file_has_key (GSM_AUTOSTART_APP (app)->priv->desktop_file,
- "X-GNOME-AutoRestart",
+ GSM_AUTOSTART_APP_AUTORESTART_KEY,
NULL);
if (res) {
autorestart = egg_desktop_file_get_boolean (GSM_AUTOSTART_APP (app)->priv->desktop_file,
- "X-GNOME-AutoRestart",
+ GSM_AUTOSTART_APP_AUTORESTART_KEY,
NULL);
}
diff --git a/gnome-session/gsm-autostart-app.h b/gnome-session/gsm-autostart-app.h
index 91cf86e..58101f2 100644
--- a/gnome-session/gsm-autostart-app.h
+++ b/gnome-session/gsm-autostart-app.h
@@ -59,6 +59,16 @@ GType gsm_autostart_app_get_type (void) G_GNUC_CONST;
GsmApp *gsm_autostart_app_new (const char *desktop_file);
+#define GSM_AUTOSTART_APP_ENABLED_KEY "X-GNOME-Autostart-enabled"
+#define GSM_AUTOSTART_APP_PHASE_KEY "X-GNOME-Autostart-Phase"
+#define GSM_AUTOSTART_APP_PROVIDES_KEY "X-GNOME-Provides"
+#define GSM_AUTOSTART_APP_STARTUP_ID_KEY "X-GNOME-Autostart-startup-id"
+#define GSM_AUTOSTART_APP_AUTORESTART_KEY "X-GNOME-AutoRestart"
+#define GSM_AUTOSTART_APP_DBUS_NAME_KEY "X-GNOME-DBus-Name"
+#define GSM_AUTOSTART_APP_DBUS_PATH_KEY "X-GNOME-DBus-Path"
+#define GSM_AUTOSTART_APP_DBUS_ARGS_KEY "X-GNOME-DBus-Start-Arguments"
+#define GSM_AUTOSTART_APP_DISCARD_KEY "X-GNOME-Autostart-discard-exec"
+
G_END_DECLS
#endif /* __GSM_AUTOSTART_APP_H__ */
diff --git a/gnome-session/gsm-session-save.c b/gnome-session/gsm-session-save.c
index d317031..817aa0a 100644
--- a/gnome-session/gsm-session-save.c
+++ b/gnome-session/gsm-session-save.c
@@ -24,6 +24,7 @@
#include <glib/gstdio.h>
#include "gsm-util.h"
+#include "gsm-autostart-app.h"
#include "gsm-client.h"
#include "gsm-session-save.h"
@@ -83,7 +84,7 @@ save_one_client (char *id,
discard_exec = g_key_file_get_string (keyfile,
G_KEY_FILE_DESKTOP_GROUP,
- "X-GNOME-Autostart-discard-exec",
+ GSM_AUTOSTART_APP_DISCARD_KEY,
NULL);
if (discard_exec) {
g_hash_table_insert (data->discard_hash,
@@ -183,7 +184,7 @@ gsm_session_clear_one_client (const char *filename,
discard_exec = g_key_file_get_string (key_file,
G_KEY_FILE_DESKTOP_GROUP,
- "X-GNOME-Autostart-discard-exec",
+ GSM_AUTOSTART_APP_DISCARD_KEY,
NULL);
if (!discard_exec)
goto out;
diff --git a/gnome-session/gsm-xsmp-client.c b/gnome-session/gsm-xsmp-client.c
index 64732be..15c1464 100644
--- a/gnome-session/gsm-xsmp-client.c
+++ b/gnome-session/gsm-xsmp-client.c
@@ -35,6 +35,7 @@
#include "gsm-marshal.h"
#include "gsm-util.h"
+#include "gsm-autostart-app.h"
#include "gsm-manager.h"
#define GsmDesktopFile "_GSM_DesktopFile"
@@ -663,7 +664,7 @@ xsmp_save (GsmClient *client,
g_key_file_set_string (keyfile,
G_KEY_FILE_DESKTOP_GROUP,
- "X-GNOME-Autostart-startup-id",
+ GSM_AUTOSTART_APP_STARTUP_ID_KEY,
startup_id);
g_key_file_set_string (keyfile,
@@ -675,7 +676,7 @@ xsmp_save (GsmClient *client,
if (exec_discard)
g_key_file_set_string (keyfile,
G_KEY_FILE_DESKTOP_GROUP,
- "X-GNOME-Autostart-discard-exec",
+ GSM_AUTOSTART_APP_DISCARD_KEY,
exec_discard);
out:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]