fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / addrduplicates.c
index cc3bb22c0710321d7c1b23b50971307a186de64d..80b83c57d198015b3be83072c93187f4081df218 100644 (file)
@@ -144,8 +144,8 @@ static gboolean create_dialog()
        val = alertpanel_full(_("Find address book email duplicates"),
                              _("Claws Mail will now search for duplicate email "
                                "addresses in the address book."),
-                             GTK_STOCK_CANCEL,GTK_STOCK_FIND,NULL, FALSE, vbox, ALERT_NOTICE,
-                             G_ALERTALTERNATE);
+                             GTK_STOCK_CANCEL,GTK_STOCK_FIND, NULL,
+                                                                                               ALERTFOCUS_SECOND, FALSE, vbox, ALERT_NOTICE);
        if(val == G_ALERTALTERNATE) {
                want_search = TRUE;
 
@@ -272,7 +272,7 @@ static gint collect_emails(ItemPerson *itemperson, AddressDataSource *ds)
                addr = g_utf8_strdown(email->address, -1);
                old_val = g_hash_table_lookup(addr_hash, addr);
                if(old_val)
-                       new_val = slist_copy_deep(old_val, copy_hash_val);
+                       new_val = slist_copy_deep(old_val, (GCopyFunc)copy_hash_val);
                else
                        new_val = NULL;
 
@@ -335,6 +335,7 @@ static void present_finder_results(GtkWindow *parent)
                         (GCallback)detail_selection_changed, NULL);
 
        dialog = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "address_dupes_finder");
+       gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
        gtk_window_set_transient_for(GTK_WINDOW(dialog),parent);
        gtk_window_set_modal(GTK_WINDOW(dialog),TRUE);
        if(!geometry.min_height) {
@@ -514,8 +515,7 @@ static gboolean is_editing_entry_only_selection(void)
                return FALSE;
 
        selected = gtk_tree_selection_get_selected_rows(sel_detail,&model);
-       if(!selected)
-               return FALSE;
+       cm_return_val_if_fail(selected, FALSE);
 
        gtk_tree_model_get_iter(model, &iter, (GtkTreePath*)selected->data);
        g_list_foreach(selected, (GFunc)gtk_tree_path_free, NULL);
@@ -786,13 +786,12 @@ static void cb_del_btn_clicked(GtkButton *button, gpointer data)
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(detail_view));
 
        list = gtk_tree_selection_get_selected_rows(selection, &model);
-
-       if(!list)
-               return;
+       cm_return_if_fail(list);
 
        aval = alertpanel(_("Delete address(es)"),
                          _("Really delete the address(es)?"),
-                         GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL);
+                         GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                                                                               ALERTFOCUS_SECOND);
        if(aval != G_ALERTALTERNATE)
                return;
 
@@ -841,7 +840,7 @@ gboolean addrduplicates_delete_item_person(ItemPerson *item, AddressDataSource *
        if( iface && iface->readOnly ) {
                alertpanel( _("Delete address"),
                            _("This address data is readonly and cannot be deleted."),
-                           GTK_STOCK_CLOSE, NULL, NULL );
+                           GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                return FALSE;
        }
 
@@ -862,10 +861,7 @@ gboolean addrduplicates_delete_item_person(ItemPerson *item, AddressDataSource *
 #endif
 
        if(item) {
-               gchar *filename = addritem_person_get_picture(item);
-               if (filename && is_file_exist(filename))
-                       claws_unlink(filename);
-               g_free(filename);
+               addritem_person_remove_picture(item);
                addritem_free_item_person(item);
        }
        return TRUE;