rpms/gnome-session/devel gnome-session-play-login-sound-2.patch, NONE, 1.1 gnome-session.spec, 1.147, 1.148 gnome-session-2.21.5-user-share.patch, 1.1, NONE
Bastien Nocera (hadess)
fedora-extras-commits at redhat.com
Mon Feb 11 12:00:38 UTC 2008
Author: hadess
Update of /cvs/pkgs/rpms/gnome-session/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9467
Modified Files:
gnome-session.spec
Added Files:
gnome-session-play-login-sound-2.patch
Removed Files:
gnome-session-2.21.5-user-share.patch
Log Message:
* Mon Feb 11 2008 - Bastien Nocera <bnocera at redhat.com> - 2.21.90-2
- Add patch to make login sounds work
- Remove unneeded patch to launch gnome-user-share, it launches
using autostart now
gnome-session-play-login-sound-2.patch:
--- NEW FILE gnome-session-play-login-sound-2.patch ---
Index: gsm-sound.c
===================================================================
--- gsm-sound.c (revision 4557)
+++ gsm-sound.c (working copy)
@@ -9,8 +9,7 @@
#endif
#include "util.h"
-#include <libgnome/gnome-sound.h>
-#include <libgnome/gnome-triggers.h>
+#include <libgnome/libgnome.h>
#define ENABLE_SOUND_KEY "/desktop/gnome/sound/enable_esd"
#define ENABLE_EVENT_SOUNDS_KEY "/desktop/gnome/sound/event_sounds"
@@ -138,10 +137,81 @@
#endif
}
+static char *
+get_filename_from_string (const char *string)
+{
+ if (string[0] != '/')
+ {
+ return gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_SOUND, string,
+ TRUE, NULL);
+ }
+
+ return g_strdup (string);
+}
+
+static char *
+get_filename_for_sound_from_keyfile (const char *name, const char *soundlist_file)
+{
+ GKeyFile *keyfile;
+ char *sound;
+
+ keyfile = g_key_file_new ();
+
+ if (g_key_file_load_from_file (keyfile, soundlist_file, G_KEY_FILE_NONE, NULL) == FALSE)
+ {
+ g_key_file_free (keyfile);
+ return NULL;
+ }
+
+ sound = g_key_file_get_string (keyfile, name, "file", NULL);
+ g_key_file_free (keyfile);
+ if (sound != NULL)
+ {
+ char *res;
+
+ res = get_filename_from_string (sound);
+ if (res != NULL)
+ {
+ g_free (sound);
+ return res;
+ }
+ }
+ g_free (sound);
+
+ return NULL;
+}
+
+static char *
+get_filename_for_sound (const char *name)
+{
+ char *soundlist, *sound;
+
+ /* Try to load the user configuration first */
+ soundlist = g_build_filename (g_get_home_dir(), ".gnome2", "sound",
+ "events", "gnome-2.soundlist", NULL);
+ sound = get_filename_for_sound_from_keyfile (name, soundlist);
+ g_free (soundlist);
+ if (sound != NULL)
+ return sound;
+
+ soundlist = g_build_filename (SYSCONFDIR, "sound", "events", "gnome-2.soundlist", NULL);
+ sound = get_filename_for_sound_from_keyfile (name, soundlist);
+ g_free (soundlist);
+
+ return sound;
+}
+
static void
play_sound_event (const char *name)
{
- gnome_triggers_do (NULL, NULL, "gnome-2", name, NULL);
+ char *sound;
+
+ sound = get_filename_for_sound (name);
+ if (sound != NULL)
+ {
+ gnome_sound_play (sound);
+ g_free (sound);
+ }
}
void
Index: Makefile.am
===================================================================
--- Makefile.am (revision 4557)
+++ Makefile.am (working copy)
@@ -16,12 +16,12 @@
-DDEFAULTDIR="\"$(defaultdir)\"" \
-DESD_SERVER="\"$(ESD_SERVER)\"" \
-DAT_SPI_REGISTRYD_DIR="\"$(AT_SPI_REGISTRYD_DIR)\"" \
- -DTIME_UTILITY="\"$(TIME_UTILITY)\""
+ -DTIME_UTILITY="\"$(TIME_UTILITY)\"" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\"
# Used by the GNOME_PROGRAM_STANDARD_PROPERTIES macros
STANDARD_PROPERTIES_CFLAGS = \
-DPREFIX=\""$(prefix)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDATADIR=\""$(datadir)"\" \
$(NULL)
Index: gnome-session.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-session/devel/gnome-session.spec,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -r1.147 -r1.148
--- gnome-session.spec 29 Jan 2008 16:23:38 -0000 1.147
+++ gnome-session.spec 11 Feb 2008 11:59:56 -0000 1.148
@@ -12,7 +12,7 @@
Summary: GNOME session manager
Name: gnome-session
Version: 2.21.90
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-session/2.21/%{name}-%{version}.tar.bz2
Source1: redhat-default-session
@@ -41,9 +41,8 @@
# Launch "esd" (really pulseaudio) all the time
Patch2: gnome-session-enable-sound-by-default.patch
-
-# Launch gnome-user-share on login if enabled
-Patch7: gnome-session-2.21.5-user-share.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=466458
+Patch3: gnome-session-play-login-sound-2.patch
# too much crashing
Patch9: gnome-session-2.13.4-no-crashes.patch
@@ -102,7 +101,9 @@
%patch1 -p1 -b .icons
%patch2 -p0 -b .sound
-%patch7 -p1 -b .user-share
+pushd gnome-session
+%patch3 -p0 -b .login-sound
+popd
%patch9 -p1 -b .no-crashes
%patch13 -p1 -b .window-manager
%patch20 -p1 -b .timeout
@@ -192,6 +193,11 @@
%doc %{_mandir}/man*/*
%changelog
+* Mon Feb 11 2008 - Bastien Nocera <bnocera at redhat.com> - 2.21.90-2
+- Add patch to make login sounds work
+- Remove unneeded patch to launch gnome-user-share, it launches
+ using autostart now
+
* Tue Jan 29 2008 Matthias Clasen <mclasen at redhat.com> - 2.21.90-1
- Update to 2.21.90
--- gnome-session-2.21.5-user-share.patch DELETED ---
More information about the fedora-extras-commits
mailing list