[notification-daemon] Various cleanups



commit 02d829353a05726ecb7feac9e10ef03680fd742c
Author: William Jon McCann <jmccann redhat com>
Date:   Thu Jun 24 02:40:15 2010 -0400

    Various cleanups

 src/daemon/daemon.c  |   15 ++++++++++-----
 src/daemon/daemon.h  |    3 +--
 src/daemon/engines.c |   24 ++++++++++++++++++++++--
 src/daemon/engines.h |   22 +++++++++++++++++++++-
 src/daemon/sound.c   |    7 +++----
 src/daemon/sound.h   |    5 +++--
 src/daemon/stack.c   |    6 +++---
 src/daemon/stack.h   |    5 +++--
 8 files changed, 66 insertions(+), 21 deletions(-)
---
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index b9f6af2..8568cf7 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -2,6 +2,7 @@
  *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
  * Copyright (C) 2005 John (J5) Palmieri <johnp redhat com>
+ * Copyright (C) 2010 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,6 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+
 #include "config.h"
 
 #include <stdlib.h>
@@ -804,9 +806,9 @@ _calculate_timeout (NotifyDaemon  *daemon,
                     NotifyTimeout *nt,
                     int            timeout)
 {
-        if (timeout == 0)
+        if (timeout == 0) {
                 nt->has_timeout = FALSE;
-        else {
+        } else {
                 glong usec;
 
                 nt->has_timeout = TRUE;
@@ -1110,7 +1112,8 @@ window_clicked_cb (GtkWindow      *nw,
 }
 
 static void
-url_clicked_cb (GtkWindow *nw, const char *url)
+url_clicked_cb (GtkWindow  *nw,
+                const char *url)
 {
         NotifyDaemon   *daemon = NW_GET_DAEMON (nw);
         char           *escaped_url;
@@ -1174,8 +1177,9 @@ screensaver_active (GtkWidget *nw)
                            error->message);
                 g_error_free (error);
         }
+
         g_object_unref (gs_proxy);
-      out:
+ out:
 
         return active;
 }
@@ -1260,8 +1264,9 @@ monitor_notification_source_windows (NotifyDaemon  *daemon,
 
         /* Start monitoring events if necessary.  We don't want to
            filter events unless we absolutely have to. */
-        if (g_hash_table_size (daemon->priv->monitored_window_hash) == 0)
+        if (g_hash_table_size (daemon->priv->monitored_window_hash) == 0) {
                 gdk_window_add_filter (NULL, _notify_x11_filter, daemon);
+        }
 
         /* Store the window in the timeout */
         g_assert (nt != NULL);
diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h
index 0ebfd96..00e2fe1 100644
--- a/src/daemon/daemon.h
+++ b/src/daemon/daemon.h
@@ -1,9 +1,8 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
  *
- * daemon.h - Implementation of the destop notification spec
- *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
  * Copyright (C) 2005 John (J5) Palmieri <johnp redhat com>
+ * Copyright (C) 2010 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/src/daemon/engines.c b/src/daemon/engines.c
index c5fe9d1..3dfbb0f 100644
--- a/src/daemon/engines.c
+++ b/src/daemon/engines.c
@@ -1,4 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp redhat com>
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
 
 #include "config.h"
 
@@ -110,7 +130,7 @@ load_theme_engine (const char *name)
 
         return engine;
 
-      error:
+ error:
         if (engine->module != NULL && !g_module_close (engine->module))
                 g_warning ("%s: %s", filename, g_module_error ());
 
diff --git a/src/daemon/engines.h b/src/daemon/engines.h
index 6556e33..b53aaff 100644
--- a/src/daemon/engines.h
+++ b/src/daemon/engines.h
@@ -1,4 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
+ * Copyright (C) 2005 John (J5) Palmieri <johnp redhat com>
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
 
 #ifndef _ENGINES_H_
 #define _ENGINES_H_
diff --git a/src/daemon/sound.c b/src/daemon/sound.c
index fa83121..d028bb5 100644
--- a/src/daemon/sound.c
+++ b/src/daemon/sound.c
@@ -1,7 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
  *
- * sound.c - Sound support portion of the destop notification spec
- *
  * Copyright (C) 2007 Jim Ramsay <i am jimramsay com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+
 #include "config.h"
 
 #include "sound.h"
@@ -27,8 +26,8 @@
 #include <canberra-gtk.h>
 
 void
-sound_play_file(GtkWidget *widget,
-                const char *filename)
+sound_play_file (GtkWidget *widget,
+                 const char *filename)
 {
         ca_gtk_play_for_widget (widget, 0,
                                 CA_PROP_MEDIA_ROLE, "event",
diff --git a/src/daemon/sound.h b/src/daemon/sound.h
index bf52f17..89a4b20 100644
--- a/src/daemon/sound.h
+++ b/src/daemon/sound.h
@@ -17,12 +17,13 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+
 #ifndef _SOUND_H
 #define _SOUND_H
 
 #include <gtk/gtk.h>
 
-void sound_play_file(GtkWidget *widget,
-                     const char *filename);
+void sound_play_file (GtkWidget *widget,
+                      const char *filename);
 
 #endif /* _SOUND_H */
diff --git a/src/daemon/stack.c b/src/daemon/stack.c
index 0b07401..20447a4 100644
--- a/src/daemon/stack.c
+++ b/src/daemon/stack.c
@@ -1,8 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
  *
- * stack.c - Notification stack groups.
- *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
+ * Copyright (C) 2010 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +18,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+
 #include "config.h"
 #include "engines.h"
 #include "stack.h"
@@ -197,7 +197,7 @@ notify_stack_new (NotifyDaemon       *daemon,
 
         g_assert (daemon != NULL);
         g_assert (screen != NULL && GDK_IS_SCREEN (screen));
-        g_assert (monitor < gdk_screen_get_n_monitors (screen));
+        g_assert (monitor < (guint)gdk_screen_get_n_monitors (screen));
         g_assert (location != NOTIFY_STACK_LOCATION_UNKNOWN);
 
         stack = g_new0 (NotifyStack, 1);
diff --git a/src/daemon/stack.h b/src/daemon/stack.h
index f3d4ee2..cc043a2 100644
--- a/src/daemon/stack.h
+++ b/src/daemon/stack.h
@@ -1,8 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
  *
- * stack.h - Notification stack groups.
- *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
+ * Copyright (C) 2010 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,10 +18,12 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+
 #ifndef _NOTIFY_STACK_H_
 #define _NOTIFY_STACK_H_
 
 #include <gtk/gtk.h>
+
 #include "daemon.h"
 
 typedef enum



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