[Commits] [SCM] claws branch, master, updated. 3.11.1-67-g87ab2b6

miras at claws-mail.org miras at claws-mail.org
Thu Feb 5 01:21:46 CET 2015


The branch, master has been updated
       via  87ab2b6cf05444a26509543bc7cfa52d842539be (commit)
      from  d6ba81337a6217737996bb0e6faf46b47ccc2722 (commit)

Summary of changes:
 src/plugins/clamd/clamav_plugin_gtk.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit 87ab2b6cf05444a26509543bc7cfa52d842539be
Author: Michael Rasmussen <mir at datanom.net>
Date:   Thu Feb 5 01:21:31 2015 +0100

    Fix bug #3380. Initialize widget before callback handler for 'clicked'

diff --git a/src/plugins/clamd/clamav_plugin_gtk.c b/src/plugins/clamd/clamav_plugin_gtk.c
index 231d378..f400f6d 100644
--- a/src/plugins/clamd/clamav_plugin_gtk.c
+++ b/src/plugins/clamd/clamav_plugin_gtk.c
@@ -189,13 +189,15 @@ static void setting_type_cb(GtkWidget *widget, gpointer data) {
 				}
 			}
 			c->ConfigType = AUTOMATIC;
-			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->config_type), TRUE);
+			if (page->config_type)
+			    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->config_type), TRUE);
 		}
 		else {
 			/* Manual configuration */
 			debug_print("Setting clamd to manual configuration\n");
 			c->ConfigType = MANUAL;
-			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->config_type), FALSE);
+			if (page->config_type)
+			    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->config_type), FALSE);
 		}
 		clamav_show_config(c);
 		if (tmp_conf)
@@ -403,15 +405,6 @@ static void clamav_create_widget_func(PrefsPage * _page, GtkWindow *window, gpoi
 
  	SET_TOGGLE_SENSITIVITY (enable_clamav, config_port);
 
-	g_signal_connect(G_OBJECT(save_folder_select), "clicked", 
-			 G_CALLBACK(foldersel_cb), page);
-	g_signal_connect(G_OBJECT(config_folder_select), "clicked",
-			 G_CALLBACK(clamd_folder_cb), page);
-	g_signal_connect(G_OBJECT(permission_select), "clicked",
-			 G_CALLBACK(folder_permission_cb), page);
-	g_signal_connect(G_OBJECT(setting_type), "clicked",
-			 G_CALLBACK(setting_type_cb), page);
-
 	config = clamav_get_config();
 
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable_clamav), config->clamav_enable);
@@ -420,6 +413,15 @@ static void clamav_create_widget_func(PrefsPage * _page, GtkWindow *window, gpoi
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(recv_infected), config->clamav_recv_infected);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(setting_type), config->clamd_config_type);
 
+        g_signal_connect(G_OBJECT(save_folder_select), "clicked",
+			 G_CALLBACK(foldersel_cb), page);
+	g_signal_connect(G_OBJECT(config_folder_select), "clicked",
+			 G_CALLBACK(clamd_folder_cb), page);
+	g_signal_connect(G_OBJECT(permission_select), "clicked",
+			 G_CALLBACK(folder_permission_cb), page);
+	g_signal_connect(G_OBJECT(setting_type), "clicked",
+			 G_CALLBACK(setting_type_cb), page);
+
 	clamd_config = clamd_get_config();
 		
 	if (config->clamav_save_folder != NULL)
@@ -460,7 +462,7 @@ static void clamav_create_widget_func(PrefsPage * _page, GtkWindow *window, gpoi
 				debug_print("Showing manual configuration and hiding automatic configuration\n");
 				clamav_show_config(c);
 			}
-		}
+		}	
 	}
 /*	else {
 		gtk_entry_set_text(GTK_ENTRY(config_folder), config->clamd_config_folder);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list