comparison gtk/gtkdialogs.c @ 14468:847e846eb07e

[gaim-migrate @ 17184] Plug a small memory-leak, and mark a string for translation. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 07 Sep 2006 22:18:54 +0000
parents 8395297271c6
children 3d8c09a6df48
comparison
equal deleted inserted replaced
14467:fd45915c6988 14468:847e846eb07e
999 999
1000 g_free(text); 1000 g_free(text);
1001 } 1001 }
1002 } 1002 }
1003 1003
1004 static void free_ggmo(struct _GaimGroupMergeObject *ggp)
1005 {
1006 g_free(ggp->new_name);
1007 g_free(ggp);
1008 }
1009
1004 static void 1010 static void
1005 gaim_gtkdialogs_merge_groups_cb(struct _GaimGroupMergeObject *GGP) 1011 gaim_gtkdialogs_merge_groups_cb(struct _GaimGroupMergeObject *GGP)
1006 { 1012 {
1007 gaim_blist_rename_group(GGP->parent, GGP->new_name); 1013 gaim_blist_rename_group(GGP->parent, GGP->new_name);
1014 free_ggmo(GGP);
1008 } 1015 }
1009 1016
1010 void 1017 void
1011 gaim_gtkdialogs_merge_groups(GaimGroup *source, const char *new_name) 1018 gaim_gtkdialogs_merge_groups(GaimGroup *source, const char *new_name)
1012 { 1019 {
1015 1022
1016 g_return_if_fail(source != NULL); 1023 g_return_if_fail(source != NULL);
1017 g_return_if_fail(new_name != NULL); 1024 g_return_if_fail(new_name != NULL);
1018 1025
1019 text = g_strdup_printf( 1026 text = g_strdup_printf(
1020 "You are about to merge the group called %s into the group " 1027 _("You are about to merge the group called %s into the group "
1021 "called %s. Do you want to continue?", source->name, new_name); 1028 "called %s. Do you want to continue?"), source->name, new_name);
1022 1029
1023 ggp = g_new(struct _GaimGroupMergeObject, 1); 1030 ggp = g_new(struct _GaimGroupMergeObject, 1);
1024 ggp->parent = source; 1031 ggp->parent = source;
1025 ggp->new_name = g_strdup(new_name); 1032 ggp->new_name = g_strdup(new_name);
1026 1033
1027 gaim_request_action(source, NULL, _("Merge Groups"), text, 0, ggp, 2, 1034 gaim_request_action(source, NULL, _("Merge Groups"), text, 0, ggp, 2,
1028 _("_Merge Groups"), G_CALLBACK(gaim_gtkdialogs_merge_groups_cb), 1035 _("_Merge Groups"), G_CALLBACK(gaim_gtkdialogs_merge_groups_cb),
1029 _("Cancel"), NULL); 1036 _("Cancel"), G_CALLBACK(free_ggmo));
1030 1037
1031 g_free(text); 1038 g_free(text);
1032 } 1039 }
1033 1040
1034 static void 1041 static void