}
generate_msgid(buf, sizeof(buf), addr);
err |= (fprintf(fp, "Resent-Message-ID: <%s>\n", buf) < 0);
+ if (compose->msgid)
+ g_free(compose->msgid);
compose->msgid = g_strdup(buf);
} else {
compose->msgid = NULL;
}
generate_msgid(buf, sizeof(buf), addr);
g_string_append_printf(header, "Message-ID: <%s>\n", buf);
+ if (compose->msgid)
+ g_free(compose->msgid);
compose->msgid = g_strdup(buf);
} else {
compose->msgid = NULL;
real_list,
NULL);
}
- while (ret == 0 && real_list != NULL) {
- MsgInfo *msginfo = (MsgInfo *)real_list->data;
+ cur = real_list;
+ while (ret == 0 && cur != NULL) {
+ MsgInfo *msginfo = (MsgInfo *)cur->data;
if (msginfo && MSG_IS_LOCKED(msginfo->flags)) {
- real_list = real_list->next;
+ cur = cur->next;
continue;
}
if (!item->folder->klass->remove_msgs)
ret = folder_item_remove_msg(item, msginfo->msgnum);
if (ret != 0) break;
msgcache_remove_msg(item->cache, msginfo->msgnum);
- real_list = real_list->next;
+ cur = cur->next;
}
g_slist_free(real_list);
folder_item_scan_full(item, FALSE);
static FolderItem *folder_create_processing_folder(int account_id)
{
- Folder *processing_folder;
+ static Folder *processing_folder = NULL;
FolderItem *processing_folder_item;
- gchar *tmpname;
gchar *processing_folder_item_name = NULL;
processing_folder_item_name = g_strdup_printf("%s-%d", PROCESSING_FOLDER_ITEM, account_id);
- if ((processing_folder = folder_find_from_name(TEMP_FOLDER, mh_get_class())) == NULL) {
- gchar *tmppath;
-
- tmppath =
+ if (processing_folder == NULL) {
+ gchar *tmppath =
g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
"tempfolder", NULL);
processing_folder =
folder_new(mh_get_class(), TEMP_FOLDER, tmppath);
g_free(tmppath);
+ tmppath = NULL;
+
+ g_assert(processing_folder != NULL);
+ processing_folder->klass->scan_tree(processing_folder);
}
g_assert(processing_folder != NULL);
- debug_print("tmpparentroot %s\n", LOCAL_FOLDER(processing_folder)->rootpath);
- /* FIXME: [W32] The code below does not correctly merge
- relative filenames; there should be a function to handle
- this. */
- if (!is_relative_filename(LOCAL_FOLDER(processing_folder)->rootpath))
- tmpname = g_strconcat(LOCAL_FOLDER(processing_folder)->rootpath,
- G_DIR_SEPARATOR_S,
- processing_folder_item_name,
- NULL);
- else
- tmpname = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
- LOCAL_FOLDER(processing_folder)->rootpath,
- G_DIR_SEPARATOR_S,
- processing_folder_item_name,
- NULL);
-
- if (!is_dir_exist(tmpname)) {
- debug_print("*TMP* creating %s\n", tmpname);
+ processing_folder_item = folder_find_child_item_by_name(FOLDER_ITEM(processing_folder->node->data),
+ processing_folder_item_name);
+ if (processing_folder_item) {
+ debug_print("*TMP* already created %s\n", folder_item_get_path(processing_folder_item));
+ } else {
processing_folder_item = processing_folder->klass->create_folder(processing_folder,
processing_folder->node->data,
processing_folder_item_name);
- } else {
- debug_print("*TMP* already created\n");
- processing_folder_item = folder_item_new(processing_folder, processing_folder_item_name, processing_folder_item_name);
- g_assert(processing_folder_item);
- folder_item_append(processing_folder->node->data, processing_folder_item);
- }
+ folder_item_append(FOLDER_ITEM(processing_folder->node->data), processing_folder_item);
+ debug_print("*TMP* creating %s\n", folder_item_get_path(processing_folder_item));
+ }
g_free(processing_folder_item_name);
g_assert(processing_folder_item != NULL);
- g_free(tmpname);
return(processing_folder_item);
}
break;
}
}
+ procmsg_msg_list_free(list);
} else {
/* if unread messages exist, print with bold font */
use_bold = (item->unread_msgs > 0|| item->new_msgs > 0)
gtk_tree_model_get (GTK_TREE_MODEL(model), iter, 0, &curdata, -1);
if (!g_utf8_collate(data, curdata)) {
gtk_combo_box_set_active_iter(combobox, iter);
+ g_free(curdata);
return TRUE;
+ } else {
+ g_free(curdata);
}
return FALSE;
gtk_cmoption_menu_calc_size (GtkCMOptionMenu *option_menu)
{
GtkWidget *child;
- GList *children;
+ GList *children, *walk;
GtkRequisition child_requisition;
gint old_width = option_menu->width;
gint old_height = option_menu->height;
if (option_menu->menu)
{
children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
- while (children)
+ walk = children;
+ while (walk)
{
- child = children->data;
- children = children->next;
+ child = walk->data;
+ walk = walk->next;
if (gtk_widget_get_visible (child))
{
if( txt == NULL )
return TRUE;
+
+ g_free(txt);
return FALSE;
}
remember_checkbtn = gtk_check_button_new_with_label(_("Remember this"));
gtk_box_pack_start(GTK_BOX(vbox), remember_checkbtn, FALSE, FALSE, 0);
- hbox = gtk_hbox_new(TRUE, 0);
-
gtkut_stock_button_set_create(&confirm_area,
&cancel_button, GTK_STOCK_CANCEL,
&ok_button, GTK_STOCK_OK,
gpointer menu_data;
GList *children;
GList *cur;
- gint n;
+ gint n, found = -1;
menu = gtk_cmoption_menu_get_menu(optmenu);
children = gtk_container_get_children(GTK_CONTAINER(GTK_MENU_SHELL(menu)));
menu_data = g_object_get_data(G_OBJECT(menuitem),
MENU_VAL_ID);
if (func) {
- if (func(menu_data, data) == 0)
- return n;
- } else if (menu_data == data)
- return n;
+ if (func(menu_data, data) == 0) {
+ found = n;
+ break;
+ }
+ } else if (menu_data == data) {
+ found = n;
+ break;
+ }
}
g_list_free(children);
- return -1;
+ return found;
}
#endif
g_list_append(
quicksearch->normal_search_strings,
g_strdup(strings->data));
- g_free(newstr);
- continue;
- }
-
- matcher_list = matcher_parser_get_cond(newstr, FALSE);
- g_free(newstr);
+ } else {
+ matcher_list = matcher_parser_get_cond(newstr, FALSE);
- if (matcher_list) {
- quicksearch->extended_search_strings =
- g_list_prepend(
- quicksearch->extended_search_strings,
- g_strdup(strings->data));
- matcherlist_free(matcher_list);
- } else
- quicksearch->normal_search_strings =
- g_list_prepend(
- quicksearch->normal_search_strings,
- g_strdup(strings->data));
+ if (matcher_list) {
+ quicksearch->extended_search_strings =
+ g_list_prepend(
+ quicksearch->extended_search_strings,
+ g_strdup(strings->data));
+ matcherlist_free(matcher_list);
+ } else
+ quicksearch->normal_search_strings =
+ g_list_prepend(
+ quicksearch->normal_search_strings,
+ g_strdup(strings->data));
+ }
}
+ g_free(newstr);
} while ((strings = g_list_next(strings)) != NULL);
while (imap_folder_get_refcnt(folder) > 0)
gtk_main_iteration();
+ g_free(IMAP_FOLDER(folder)->search_charset);
+
folder_remote_folder_destroy(REMOTE_FOLDER(folder));
imap_done(folder);
}
return TRUE;
}
path = folder_item_get_path(item);
- if (!is_dir_exist(path))
+ if (!is_dir_exist(path)) {
+ g_free(path);
return FALSE;
+ }
filename = g_strconcat(path, G_DIR_SEPARATOR_S, itos(uid), NULL);
g_free(path);
*msgs = g_slist_prepend(*msgs, GUINT_TO_POINTER(((MsgInfo*) cur->data)->msgnum));
count++;
}
+ procmsg_msg_list_free(list);
+
*msgs = g_slist_reverse(*msgs);
+
return count;
}
main_window_reflect_tags_changes(mainwindow_get_mainwindow());
}
- for (cur = seq_list; cur != NULL; cur = g_slist_next(cur)) {
- struct mailimap_set * imapset;
-
- imapset = cur->data;
- mailimap_set_free(imapset);
- }
+ imap_lep_set_free(seq_list);
session_set_access_time(SESSION(session));
stuff->done = TRUE;
vals[0].length = strlen(g_get_user_name()?g_get_user_name():"");
vals[0].value = g_strdup(g_get_user_name()?g_get_user_name():"");
sc_client_set_value (mainwin, SmUserID, SmARRAY8, 1, vals);
+
+ g_free(vals);
}
}
}
gchar *claws_get_socket_name(void)
{
static gchar *filename = NULL;
- const gchar *socket_dir = NULL;
+ gchar *socket_dir = NULL;
gchar md5sum[33];
if (filename == NULL) {
g_free(new_accel);
}
}
+ g_list_free(closures);
}
static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refresh)
to_human_readable((goffset)mimeinfo->length), NULL);
g_free(content_type);
if (desc && *desc) {
- gchar *tmp = NULL;
+ gchar *tmp = NULL, *escaped = NULL;
if (!g_utf8_validate(desc, -1, NULL)) {
tmp = conv_filename_to_utf8(desc);
} else {
tmp = g_strdup(desc);
}
+ escaped = g_markup_escape_text(tmp,-1);
+
tiptmp = g_strconcat(tip, "\n<b>",
prefs_common.attach_desc && mimeinfo->description ?
_("Description:") : _("Filename:"),
- " </b>", g_markup_escape_text(tmp,-1), NULL);
+ " </b>", escaped, NULL);
g_free(tip);
tip = tiptmp;
g_free(tmp);
+ g_free(escaped);
}
if (sigshort && *sigshort) {
tiptmp = g_strjoin("\n", tip, g_markup_escape_text(sigshort, -1), NULL);
static void icon_list_toggle_by_mime_info (MimeView *mimeview,
MimeInfo *mimeinfo)
{
- GList *child;
+ GList *children, *child;
- child = gtk_container_get_children(GTK_CONTAINER(mimeview->icon_vbox));
- for (; child != NULL; child = g_list_next(child)) {
+ children = gtk_container_get_children(GTK_CONTAINER(mimeview->icon_vbox));
+ for (child = children; child != NULL; child = g_list_next(child)) {
if (!GTK_IS_EVENT_BOX(child->data))
continue;
if(g_object_get_data(G_OBJECT(child->data),
gtk_widget_queue_draw(icon);
}
}
+ g_list_free(children);
}
static void ctree_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation,
* system choice. */
static void privacy_system_activated(GtkWidget *combobox)
{
- const gchar *system_id;
- gint privacy_enabled_int;
- GtkTreeIter iter;
- GtkListStore *menu = GTK_LIST_STORE(gtk_combo_box_get_model(
- GTK_COMBO_BOX(combobox)));
-
- gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combobox), &iter);
-
- gtk_tree_model_get(GTK_TREE_MODEL(menu), &iter,
- COMBOBOX_PRIVACY_PLUGIN_ID, &system_id,
- COMBOBOX_DATA, &privacy_enabled_int,
- -1);
-
gtk_widget_set_sensitive (privacy_page.save_clear_text_checkbtn,
!gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(privacy_page.encrypt_to_self_checkbtn)));
GtkWidget *trash_folder_entry;
GtkWidget *imap_use_trash_checkbtn;
GtkSizeGroup *size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+
#define PACK_HBOX(hbox) \
{ \
hbox = gtk_hbox_new (FALSE, 8); \
page->vbox = vbox1;
page->page.widget = vbox1;
+
+ g_object_unref(G_OBJECT(size_group));
}
static gint prefs_basic_apply(void)
names = g_list_next(names);
}
- g_list_free(names);
+ g_list_free(tdata->names);
tdata->names = NULL;
}
*override_from_format = entry_from;
*edit_subject_format = entry_subject;
*edit_body_format = text_format;
+
+ g_object_unref(G_OBJECT(size_group));
}
void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
if (override_from_format)
*override_from_format = entry_from;
*edit_reply_format = text_quotefmt;
+
+ g_object_unref(G_OBJECT(size_group));
}
void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
if (override_from_format)
*override_from_format = entry_from;
*edit_fw_format = text_fw_quotefmt;
+
+ g_object_unref(G_OBJECT(size_group));
}
void quotefmt_add_info_button(GtkWindow *parent_window, GtkWidget *parent_box)