[gnome-session] gsm: Do not add autostart apps providing a service already provided
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] gsm: Do not add autostart apps providing a service already provided
- Date: Tue, 22 Mar 2011 12:47:12 +0000 (UTC)
commit f436a357396ed54544de801ac018461f616e14e7
Author: Vincent Untz <vuntz gnome org>
Date: Tue Mar 22 13:15:21 2011 +0100
gsm: Do not add autostart apps providing a service already provided
We were already doing this, but only for the Provides defined in the
session definition, and we were ignoring Provides defined in the
.desktop files themselves.
gnome-session/gsm-manager.c | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index abbc223..d50c76d 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -3744,7 +3744,8 @@ add_autostart_app_internal (GsmManager *manager,
const char *provides,
gboolean is_required)
{
- GsmApp *app;
+ GsmApp *app;
+ char **internal_provides;
g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
@@ -3768,6 +3769,32 @@ add_autostart_app_internal (GsmManager *manager,
return FALSE;
}
+ internal_provides = gsm_app_get_provides (app);
+ if (internal_provides) {
+ int i;
+ gboolean provided = FALSE;
+
+ for (i = 0; internal_provides[i] != NULL; i++) {
+ GsmApp *dup;
+
+ dup = (GsmApp *)gsm_store_find (manager->priv->apps,
+ (GsmStoreFunc)_find_app_provides,
+ (char *)internal_provides[i]);
+ if (dup != NULL) {
+ g_debug ("GsmManager: service '%s' is already provided", internal_provides[i]);
+ provided = TRUE;
+ break;
+ }
+ }
+
+ g_strfreev (internal_provides);
+
+ if (provided) {
+ g_object_unref (app);
+ return FALSE;
+ }
+ }
+
g_debug ("GsmManager: read %s", path);
append_app (manager, app, is_required);
g_object_unref (app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]