From b69e098519c056115763a19004c4fcefe4ad49d5 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 6 Nov 2009 09:19:14 +0000 Subject: svn s git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2337 ee746299-78ed-0310-b773-934348b2243d --- libsylph/mh.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'libsylph/mh.c') diff --git a/libsylph/mh.c b/libsylph/mh.c index e86b5671..6141abbe 100644 --- a/libsylph/mh.c +++ b/libsylph/mh.c @@ -515,7 +515,8 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, } } - g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); g_free(destfile); dest->last_num++; @@ -628,7 +629,8 @@ static gint mh_add_msgs_msginfo(Folder *folder, FolderItem *dest, } } - g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); g_free(srcfile); g_free(destfile); @@ -718,8 +720,10 @@ static gint mh_do_move_msgs(Folder *folder, FolderItem *dest, GSList *msglist) break; } - g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); - g_signal_emit_by_name(syl_app_get(), "remove-msg", src, srcfile, msginfo->msgnum); + if (syl_app_get()) { + g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); + g_signal_emit_by_name(syl_app_get(), "remove-msg", src, srcfile, msginfo->msgnum); + } g_free(srcfile); g_free(destfile); @@ -835,7 +839,8 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, GSList *msglist) break; } - g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "add-msg", dest, destfile, dest->last_num + 1); g_free(srcfile); g_free(destfile); @@ -871,7 +876,8 @@ static gint mh_remove_msg(Folder *folder, FolderItem *item, MsgInfo *msginfo) file = mh_fetch_msg(folder, item, msginfo->msgnum); g_return_val_if_fail(file != NULL, -1); - g_signal_emit_by_name(syl_app_get(), "remove-msg", item, file, msginfo->msgnum); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "remove-msg", item, file, msginfo->msgnum); S_LOCK(mh); @@ -909,7 +915,8 @@ static gint mh_remove_all_msg(Folder *folder, FolderItem *item) path = folder_item_get_path(item); g_return_val_if_fail(path != NULL, -1); - g_signal_emit_by_name(syl_app_get(), "remove-all-msg", item); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "remove-all-msg", item); S_LOCK(mh); @@ -1399,8 +1406,9 @@ static gint mh_move_folder_real(Folder *folder, FolderItem *item, g_free(paths[1]); new_id = folder_item_get_identifier(item); - g_signal_emit_by_name(syl_app_get(), "move-folder", item, old_id, - new_id); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "move-folder", item, + old_id, new_id); g_free(new_id); g_free(old_id); @@ -1439,7 +1447,8 @@ static gint mh_remove_folder(Folder *folder, FolderItem *item) } g_free(path); - g_signal_emit_by_name(syl_app_get(), "remove-folder", item); + if (syl_app_get()) + g_signal_emit_by_name(syl_app_get(), "remove-folder", item); folder_item_remove(item); S_UNLOCK(mh); -- cgit v1.2.3