Revision: 3908 http://geany.svn.sourceforge.net/geany/?rev=3908&view=rev Author: eht16 Date: 2009-07-04 09:17:12 +0000 (Sat, 04 Jul 2009)
Log Message: ----------- Fix warnings when the toolbar does not contain the Run button.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-06-30 18:32:03 UTC (rev 3907) +++ trunk/ChangeLog 2009-07-04 09:17:12 UTC (rev 3908) @@ -1,3 +1,9 @@ +2009-07-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/build.c: + Fix warnings when the toolbar does not contain the Run button. + + 2009-06-30 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* doc/geany.html, doc/geany.txt:
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2009-06-30 18:32:03 UTC (rev 3907) +++ trunk/src/build.c 2009-07-04 09:17:12 UTC (rev 3908) @@ -1726,21 +1726,25 @@ /* Call build_menu_update() instead of calling this directly. */ static void set_stop_button(gboolean stop) { + const gchar *button_stock_id = NULL; GtkStockItem sitem; GtkToolButton *run_button; - GtkWidget *menuitem = - build_get_menu_items(run_info.file_type_id)->item_exec; + GtkWidget *menuitem = build_get_menu_items(run_info.file_type_id)->item_exec;
run_button = GTK_TOOL_BUTTON(toolbar_get_widget_by_name("Run")); - if (stop && utils_str_equal(gtk_tool_button_get_stock_id(run_button), "gtk-stop")) + if (run_button != NULL) + button_stock_id = gtk_tool_button_get_stock_id(run_button); + + if (stop && utils_str_equal(button_stock_id, "gtk-stop")) return; - if (! stop && utils_str_equal(gtk_tool_button_get_stock_id(run_button), "gtk-execute")) + if (! stop && utils_str_equal(button_stock_id, "gtk-execute")) return;
/* use the run button also as stop button */ if (stop) { - gtk_tool_button_set_stock_id(run_button, "gtk-stop"); + if (run_button != NULL) + gtk_tool_button_set_stock_id(run_button, "gtk-stop");
if (menuitem != NULL) { @@ -1753,7 +1757,8 @@ } else { - gtk_tool_button_set_stock_id(run_button, "gtk-execute"); + if (run_button != NULL) + gtk_tool_button_set_stock_id(run_button, "gtk-execute");
if (menuitem != NULL) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.