2007-12-06 [colin] 3.1.0cvs62
[claws.git] / src / prefs_matcher.c
index 10d499c02ef29db3af173484b87988d47e91e5a0..f52926c4206993076154b9167ba35d23c7d10a33 100644 (file)
@@ -1321,7 +1321,7 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
        gint value, sel;
 
        if (value_criteria == -1)
-               return -1;
+               return NULL;
 
        criteria = prefs_matcher_get_matching_from_criteria(value_criteria);
 
@@ -2020,13 +2020,15 @@ static void prefs_matcher_test_info(void)
 
 static void prefs_matcher_addressbook_select(void)
 {
-       gchar *folderpath = NULL;
-       gboolean ret = FALSE;
-
-       folderpath = (gchar *) gtk_entry_get_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child));
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child), folderpath);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child), new_path);
+               g_free(new_path);
+       } 
 }