[Galago-commits] r2891 - in trunk/notification-daemon: . src

galago-commits at freedesktop.org galago-commits at freedesktop.org
Sun Jul 30 15:45:52 PDT 2006


Author: chipx86
Date: 2006-07-30 15:45:44 -0700 (Sun, 30 Jul 2006)
New Revision: 2891

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/src/daemon.c
Log:
Fix a crash. We were making bad assumptions about the ordering of enum 
values for stack locations.


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2006-07-30 21:23:40 UTC (rev 2890)
+++ trunk/notification-daemon/ChangeLog	2006-07-30 22:45:44 UTC (rev 2891)
@@ -1,3 +1,9 @@
+Sun Jul 30 15:32:10 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Fix a crash. We were making bad assumptions about the ordering of
+	    enum values for stack locations.
+
 Sun Jul 30 14:22:47 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* src/Makefile.am:

Modified: trunk/notification-daemon/src/daemon.c
===================================================================
--- trunk/notification-daemon/src/daemon.c	2006-07-30 21:23:40 UTC (rev 2890)
+++ trunk/notification-daemon/src/daemon.c	2006-07-30 22:45:44 UTC (rev 2891)
@@ -72,6 +72,8 @@
 	{ NOTIFY_STACK_LOCATION_UNKNOWN,      NULL }
 };
 
+#define POPUP_STACK_DEFAULT_INDEX 3 /* XXX Hack! */
+
 typedef struct
 {
 	GTimeVal expiration;
@@ -192,7 +194,7 @@
 {
 	NotifyStackLocation stack_location = NOTIFY_STACK_LOCATION_DEFAULT;
 
-	if (slocation != NULL && *slocation != '\0')
+	if (slocation == NULL || *slocation == '\0')
 		return NOTIFY_STACK_LOCATION_DEFAULT;
 	else
 	{
@@ -675,7 +677,7 @@
 	{
 		gconf_client_set_string(get_gconf_client(),
 			"/apps/notification-daemon/popup_location",
-			popup_stack_locations[NOTIFY_STACK_LOCATION_DEFAULT].identifier,
+			popup_stack_locations[POPUP_STACK_DEFAULT_INDEX].identifier,
 			NULL);
 
 		stack_location = NOTIFY_STACK_LOCATION_DEFAULT;



More information about the galago-commits mailing list