gnome-media r3870 - in trunk: . gst-mixer/src



Author: malureau
Date: Sun Jun  1 18:38:46 2008
New Revision: 3870
URL: http://svn.gnome.org/viewvc/gnome-media?rev=3870&view=rev

Log:
2008-06-01  Marc-Andrà Lureau  <marcandre lureau gmail com>

	* gst-mixer/src/track.c (gnome_volume_control_track_add_option),
	* gst-mixer/src/element.c (cb_gconf),
	* gst-mixer/src/window.c (gnome_volume_control_window_new):

	Use g_str_equal () and check arguments.
	(Closes #441641)


Modified:
   trunk/ChangeLog
   trunk/gst-mixer/src/element.c
   trunk/gst-mixer/src/track.c
   trunk/gst-mixer/src/window.c

Modified: trunk/gst-mixer/src/element.c
==============================================================================
--- trunk/gst-mixer/src/element.c	(original)
+++ trunk/gst-mixer/src/element.c	Sun Jun  1 18:38:46 2008
@@ -369,7 +369,10 @@
 	g_object_get_data (G_OBJECT (track), "gnome-volume-control-trkw");
       gchar *key = get_gconf_key (el->mixer, track);
 
-      if (!strcmp (gconf_entry_get_key (entry), key)) {
+      g_return_if_fail (gconf_entry_get_key (entry) != NULL);
+      g_return_if_fail (key != NULL);
+
+      if (g_str_equal (gconf_entry_get_key (entry), key)) {
         GConfValue *value = gconf_entry_get_value (entry);
 
         if (value->type == GCONF_VALUE_BOOL) {

Modified: trunk/gst-mixer/src/track.c
==============================================================================
--- trunk/gst-mixer/src/track.c	(original)
+++ trunk/gst-mixer/src/track.c	Sun Jun  1 18:38:46 2008
@@ -456,12 +456,18 @@
 
   /* optionmenu */
   active_opt = gst_mixer_get_option (mixer, GST_MIXER_OPTIONS (track));
-  ctrl->options = gtk_combo_box_new_text ();
-  opts = gst_mixer_options_get_values (options);
-  for (opt = opts; opt != NULL; opt = opt->next, i++) {
-    gtk_combo_box_append_text (GTK_COMBO_BOX (ctrl->options), opt->data);
-    if (!strcmp (active_opt, opt->data)) {
-      gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->options), i);
+  if (active_opt != NULL) {
+    ctrl->options = gtk_combo_box_new_text ();
+    opts = gst_mixer_options_get_values (options);
+    for (opt = opts; opt != NULL; opt = opt->next, i++) {
+      if (opt->data == NULL)
+	continue;
+
+      gtk_combo_box_append_text (GTK_COMBO_BOX (ctrl->options), opt->data);
+
+      if (g_str_equal (active_opt, opt->data)) {
+	gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->options), i);
+      }
     }
   }
 

Modified: trunk/gst-mixer/src/window.c
==============================================================================
--- trunk/gst-mixer/src/window.c	(original)
+++ trunk/gst-mixer/src/window.c	Sun Jun  1 18:38:46 2008
@@ -168,7 +168,11 @@
 
     for (item = win->elements; item != NULL; item = item->next) {
       cur_el_str = g_object_get_data (item->data, "gnome-volume-control-name");
-      if (!strcmp (cur_el_str, el)) {
+
+      g_return_if_fail (cur_el_str != NULL);
+      g_return_if_fail (el != NULL);
+
+      if (g_str_equal (cur_el_str, el)) {
         GstElement *old_element = GST_ELEMENT (win->el->mixer);
         gchar *title;
 
@@ -319,7 +323,10 @@
   if (active_el_str != NULL && active_el_str != '\0') {
     for (count = 0, item = elements; item != NULL; item = item->next, count++) {
       cur_el_str = g_object_get_data (item->data, "gnome-volume-control-name");
-      if (!strcmp (active_el_str, cur_el_str)) {
+      if (cur_el_str == NULL)
+	continue;
+
+      if (g_str_equal (active_el_str, cur_el_str)) {
         active_element = item->data;
         break;
       }



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