rpms/gnomeradio/devel gnomeradio-crash.patch, NONE, 1.1 gnomeradio.spec, 1.13, 1.14

Dominik Mierzejewski rathann at fedoraproject.org
Thu Jul 8 17:50:22 UTC 2010


Author: rathann

Update of /cvs/pkgs/rpms/gnomeradio/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv22369

Modified Files:
	gnomeradio.spec 
Added Files:
	gnomeradio-crash.patch 
Log Message:
* Thu Jul 08 2010 Dominik Mierzejewski <rpm at greysector.net> - 1.8-6
- fixed crash in the preferences dialog, patch from upstream (rhbz#576922)


gnomeradio-crash.patch:
 ChangeLog   |    7 +++++
 src/gui.c   |    4 +++
 src/prefs.c |   73 ++++++++++++++++++++++++++++++++----------------------------
 3 files changed, 51 insertions(+), 33 deletions(-)

--- NEW FILE gnomeradio-crash.patch ---
>From 7694c70f99731724dad64444484d070ff760db89 Mon Sep 17 00:00:00 2001
From: Jörgen Scheibengruber <mfcn at src.gnome.org>
Date: Sat, 13 Sep 2008 21:00:09 +0000
Subject: Don't update menus while main-view and tray-icon are not visible yet

	* src/gui.c (main):
	* src/prefs.c (add_button_clicked_cb), (del_button_clicked_cb),
	(name_cell_edited_cb):
	Don't update menus while main-view and tray-icon are not visible yet


svn path=/trunk/; revision=208
---
diff --git a/ChangeLog b/ChangeLog
index 973a754..814a52d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-09-13  Jörgen Scheibengruber  <mfcn at gmx.de>
 
+	* src/gui.c (main):
+	* src/prefs.c (add_button_clicked_cb), (del_button_clicked_cb),
+	(name_cell_edited_cb):
+	Don't update menus while main-view and tray-icon are not visible yet
+
+2008-09-13  Jörgen Scheibengruber  <mfcn at gmx.de>
+
 	* configure.in:
 	* src/Makefile.am:
 
diff --git a/src/gui.c b/src/gui.c
index faca2b7..6c2155f 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -54,6 +54,8 @@ GtkTooltips *tooltips;
 int mom_ps;
 gnomeradio_settings settings;
 
+gboolean main_visible;
+
 static GtkWidget *drawing_area;
 static GdkPixmap *digits, *signal_s, *stereo;
 static GtkWidget *freq_scale;
@@ -1110,6 +1112,7 @@ int main(int argc, char* argv[])
 					NULL);
 	gtk_window_set_default_icon_name("gnomeradio");
 	/* Main app */
+	main_visible = FALSE;
 	app = gnome_radio_gui();
 
 	/* Initizialize GStreamer */
@@ -1150,6 +1153,7 @@ int main(int argc, char* argv[])
 	preset_combo_set_item(mom_ps);
 
 	gtk_widget_show_all(app);
+	main_visible = TRUE;
 
 	/* Create an tray icon */
 	create_tray_icon(app);
diff --git a/src/prefs.c b/src/prefs.c
index 425d116..7b8ee20 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -30,6 +30,8 @@ extern GtkTooltips *tooltips;
 extern int mom_ps;
 extern gnomeradio_settings settings;
 
+extern gboolean main_visible;
+
 static GtkWidget *device_entry;
 static GtkWidget *mixer_combo;
 static GtkWidget *mute_on_exit_cb;
@@ -310,16 +312,18 @@ static void add_button_clicked_cb(GtkWidget *widget, gpointer data)
 	v_scb = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list_view));
 	gtk_adjustment_set_value(v_scb, v_scb->upper);
 	
-	gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
-	mom_ps = g_list_length(settings.presets) - 1;
-	preset_combo_set_item(mom_ps);
-
-	menuitems = GTK_MENU_SHELL(tray_menu)->children;
-	menuitem = gtk_menu_item_new_with_label(ps->title); 
-		
-	gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);		
-	g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
-	gtk_widget_show(menuitem);
+	if (main_visible) {
+		gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
+		mom_ps = g_list_length(settings.presets) - 1;
+		preset_combo_set_item(mom_ps);
+
+		menuitems = GTK_MENU_SHELL(tray_menu)->children;
+		menuitem = gtk_menu_item_new_with_label(ps->title); 
+			
+		gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);		
+		g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
+		gtk_widget_show(menuitem);
+	}
 
 	buffer = g_strdup_printf("%d", g_list_length(settings.presets) - 1);
 	path = gtk_tree_path_new_from_string(buffer);
@@ -356,15 +360,17 @@ static void del_button_clicked_cb(GtkWidget *widget, gpointer data)
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
 	gtk_list_store_remove(list_store, &iter);
 
-	gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
-	if (--mom_ps < 0) mom_ps = 0;
-	if (!g_list_length(settings.presets)) mom_ps = -1;
-	preset_combo_set_item(mom_ps);
+	if (main_visible) {
+		gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
+		if (--mom_ps < 0) mom_ps = 0;
+		if (!g_list_length(settings.presets)) mom_ps = -1;
+		preset_combo_set_item(mom_ps);
 
-	menuitems = GTK_MENU_SHELL(tray_menu)->children;
-	g_assert(*row < g_list_length(menuitems));
-	menuitem = g_list_nth_data(menuitems, *row);
-	gtk_widget_destroy(menuitem);
+		menuitems = GTK_MENU_SHELL(tray_menu)->children;
+		g_assert(*row < g_list_length(menuitems));
+		menuitem = g_list_nth_data(menuitems, *row);
+		gtk_widget_destroy(menuitem);
+	}
 	
 	gtk_tree_path_prev(path);
 	gtk_tree_view_set_cursor(GTK_TREE_VIEW(list_view), path, NULL, FALSE);
@@ -420,20 +426,22 @@ static void name_cell_edited_cb(GtkCellRendererText *cellrenderertext, gchar *pa
 	if (ps->title) g_free(ps->title);
 	ps->title = g_strdup(new_val);
 
-	gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
-	gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
-	mom_ps = *row;
-	preset_combo_set_item(mom_ps);
-	
-	menuitems = GTK_MENU_SHELL(tray_menu)->children;
-	g_assert(mom_ps < g_list_length(menuitems));
-	menuitem = g_list_nth_data(menuitems, mom_ps);
-	gtk_widget_destroy(menuitem);
-	menuitem = gtk_menu_item_new_with_label(ps->title); 
-		
-	gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);		
-	g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
-	gtk_widget_show(menuitem);
+	if (main_visible) {
+		gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
+		gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
+		mom_ps = *row;
+		preset_combo_set_item(mom_ps);
+
+		menuitems = GTK_MENU_SHELL(tray_menu)->children;
+		g_assert(mom_ps < g_list_length(menuitems));
+		menuitem = g_list_nth_data(menuitems, mom_ps);
+		gtk_widget_destroy(menuitem);
+		menuitem = gtk_menu_item_new_with_label(ps->title); 
+			
+		gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);		
+		g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
+		gtk_widget_show(menuitem);
+	}
 	
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
 	gtk_list_store_set(GTK_LIST_STORE(list_store), &iter, 0, new_val, -1);
--
cgit v0.8.3.1


Index: gnomeradio.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnomeradio/devel/gnomeradio.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- gnomeradio.spec	15 Feb 2010 01:16:18 -0000	1.13
+++ gnomeradio.spec	8 Jul 2010 17:50:22 -0000	1.14
@@ -1,7 +1,7 @@
 Summary: Graphical FM-Tuner program for GNOME
 Name: gnomeradio
 Version: 1.8
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 Group: Applications/Multimedia
 URL: http://projects.gnome.org/gnomeradio/
@@ -9,6 +9,8 @@ Source0: http://www.wh-hms.uni-ulm.de/~m
 Source1: gnomeradio.sh
 Patch0: %{name}-v4l2.patch
 Patch1: %{name}-ld.patch
+# http://git.gnome.org/browse/gnomeradio/commit/?id=7694c70f99731724dad64444484d070ff760db89
+Patch2: %{name}-crash.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: desktop-file-utils
 BuildRequires: gettext
@@ -36,6 +38,7 @@ Ogg files.
 %setup -q
 %patch0 -p1 -b .v4l2
 %patch1 -p1 -b .ld
+%patch2 -p1 -b .crash
 %{__install} -m 755 %{SOURCE1} .
 
 %build
@@ -109,6 +112,9 @@ scrollkeeper-update -q || :
 %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
 
 %changelog
+* Thu Jul 08 2010 Dominik Mierzejewski <rpm at greysector.net> - 1.8-6
+- fixed crash in the preferences dialog, patch from upstream (rhbz#576922)
+
 * Mon Feb 15 2010 Dominik Mierzejewski <rpm at greysector.net> - 1.8-5
 - fixed FTBFS with the new ld (rhbz#564863)
 



More information about the scm-commits mailing list