24246ef7a03dba41bef49580b8b3ef401f7e8345
[gpg4win.git] / patches / claws-mail-3.0.0-rc2 / 04-cvs116.patch
1 #! /bin/sh
2 patch -p1 -f $* < $0
3 exit $?
4
5 Marcus Brinkmann:
6
7         * src/msgcache.c: Release hMapping.
8
9 Cherry picking some changes since the 3.0.0-rc2 release candidate:
10
11 2007-08-12 [wwp]        2.10.0cvs116
12
13         * src/plugins/pgpcore/prefs_gpg.c
14                 Don't try to unset a GPG_AGENT_INFO that was not
15                 set (and don't use a NULL string in Windows, it was
16                 crashing with --debug if GPG_AGENT_INFO was not set).
17
18 2007-08-12 [wwp]        2.10.0cvs115
19
20         * src/privacy.h
21                 Make gcc type-check arguments passed to privacy_set_error().
22
23 2007-08-12 [ticho]      2.10.0cvs114
24
25         * src/prefs_folder_item.c
26                 Make sure that folder default account combobox always has some
27                 account preselected.
28         * src/gtk/combobox.c
29                 Handle empty combobox gracefully (warning instead of crash).
30
31 2007-08-12 [ticho]      2.10.0cvs114
32
33         * src/prefs_folder_item.c
34                 Make sure that folder default account combobox is not empty.
35         * src/gtk/combobox.c
36                 Handle empty combobox gracefully (warning instead of crash).
37
38
39 diff -rup claws-mail-3.0.0-rc2/src/gtk/combobox.c claws-mail-2.10.0cvs116/src/gtk/combobox.c
40 --- claws-mail-3.0.0-rc2/src/gtk/combobox.c     2007-08-10 12:58:28.000000000 +0200
41 +++ claws-mail-2.10.0cvs116/src/gtk/combobox.c  2007-08-12 17:14:05.000000000 +0200
42 @@ -74,7 +74,7 @@ gint combobox_get_active_data(GtkComboBo
43  
44         g_return_val_if_fail(combobox != NULL, -1);
45  
46 -       gtk_combo_box_get_active_iter(combobox, &iter);
47 +       g_return_val_if_fail(gtk_combo_box_get_active_iter(combobox, &iter), -1);
48  
49         model = gtk_combo_box_get_model(combobox);
50  
51 diff -rup claws-mail-3.0.0-rc2/src/plugins/pgpcore/prefs_gpg.c claws-mail-2.10.0cvs116/src/plugins/pgpcore/prefs_gpg.c
52 --- claws-mail-3.0.0-rc2/src/plugins/pgpcore/prefs_gpg.c        2007-08-10 12:58:34.000000000 +0200
53 +++ claws-mail-2.10.0cvs116/src/plugins/pgpcore/prefs_gpg.c     2007-08-13 06:07:37.000000000 +0200
54 @@ -530,9 +530,13 @@ void prefs_gpg_enable_agent(gboolean ena
55                         debug_print("Can't enable gpg agent (no GPG_AGENT_INFO)\n");
56                 }
57         } else {
58 +               if (saved_gpg_agent_info) {
59                         g_unsetenv("GPG_AGENT_INFO");
60                         debug_print("unset GPG_AGENT_INFO=%s\n", 
61                                 saved_gpg_agent_info);
62 +               } else {
63 +                       debug_print("Can't disable gpg agent (no GPG_AGENT_INFO)\n");
64 +               }
65         }
66  }
67  
68 diff -rup claws-mail-3.0.0-rc2/src/prefs_folder_item.c claws-mail-2.10.0cvs116/src/prefs_folder_item.c
69 --- claws-mail-3.0.0-rc2/src/prefs_folder_item.c        2007-08-10 12:58:30.000000000 +0200
70 +++ claws-mail-2.10.0cvs116/src/prefs_folder_item.c     2007-08-12 17:14:03.000000000 +0200
71 @@ -721,6 +721,7 @@ static void prefs_folder_item_compose_cr
72         GList *cur_ac;
73         GList *account_list;
74         PrefsAccount *ac_prefs;
75 +       gboolean default_account_set = FALSE;
76  
77         page->item         = item;
78  
79 @@ -857,11 +858,20 @@ static void prefs_folder_item_compose_cr
80                                         ac_prefs->account_id);
81  
82                 /* Set combobox to current default account id */
83 -               if (ac_prefs->account_id == item->prefs->default_account)
84 +               if (ac_prefs->account_id == item->prefs->default_account) {
85                         combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
86                                         ac_prefs->account_id);
87 +                       default_account_set = TRUE;
88 +               }
89         }
90  
91 +       /* If nothing has been set (folder doesn't have a default account set),
92 +        * pre-select global default account, since that's what actually used
93 +        * anyway. We don't want nothing selected in combobox. */
94 +       if( !default_account_set )
95 +               combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
96 +                               account_get_default()->account_id);
97 +
98         SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_account, optmenu_default_account);
99  
100         default_account_rec_checkbtn = gtk_check_button_new();
101 diff -rup claws-mail-3.0.0-rc2/src/privacy.h claws-mail-2.10.0cvs116/src/privacy.h
102 --- claws-mail-3.0.0-rc2/src/privacy.h  2007-08-10 12:58:29.000000000 +0200
103 +++ claws-mail-2.10.0cvs116/src/privacy.h       2007-08-12 17:14:03.000000000 +0200
104 @@ -66,7 +66,7 @@ gboolean privacy_encrypt                      (const gchar 
105                                                  MimeInfo     *mimeinfo,
106                                                  const gchar  *encdata);
107  
108 -void privacy_set_error                         (const gchar *format, ...);
109 +void privacy_set_error                         (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
110  void privacy_reset_error                               (void);
111  gboolean privacy_peek_error                            (void);
112  const gchar *privacy_get_error                 (void);
113
114
115 --- claws-mail-old/src/msgcache.c       2007-08-13 15:42:39.000000000 +0200
116 +++ claws-mail/src/msgcache.c   2007-08-13 15:43:26.000000000 +0200
117 @@ -648,6 +648,7 @@
118                         if (!hMapping)
119                                 goto w32_fail;
120                         cache_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
121 +                       CloseHandle (hMapping);
122                 w32_fail:
123                         ;
124  #else
125 @@ -830,6 +831,7 @@
126                         if (!hMapping)
127                                 goto w32_fail2;
128                         cache_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
129 +                       CloseHandle (hMapping);
130                 w32_fail2:
131                         ;
132  #else
133 @@ -913,6 +915,7 @@
134                         if (!hMapping)
135                                 goto w32_fail6;
136                         cache_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
137 +                       CloseHandle (hMapping);
138                 w32_fail6:
139                         ;
140  #else
141 @@ -1248,6 +1251,7 @@
142                         if (!hMapping)
143                                 goto w32_fail3;
144                         cache_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
145 +                       CloseHandle (hMapping);
146                 w32_fail3:
147                         ;
148  #else
149 @@ -1267,6 +1271,7 @@
150                                 if (!hMapping)
151                                         goto w32_fail4;
152                                 mark_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
153 +                               CloseHandle (hMapping);
154                         w32_fail4:
155                                 ;
156  #else
157 @@ -1293,6 +1298,7 @@
158                                                 if (!hMapping)
159                                                         goto w32_fail5;
160                                                 tags_data = (unsigned char *)MapViewOfFile(hMapping, FILE_MAP_COPY, 0, 0, 0);
161 +                                               CloseHandle (hMapping);
162                                         w32_fail5:
163                                                 ;
164  #else