diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 23:13:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-29 00:13:23 +0800 |
commit | fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch) | |
tree | ae78be371695c3dc18847b87d3f014f985aa3a40 /addressbook/gui/widgets/eab-gui-util.c | |
parent | 6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff) | |
download | gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.bz2 gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.lz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.xz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'addressbook/gui/widgets/eab-gui-util.c')
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 58895c736c..9b3b0c7730 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -54,7 +54,7 @@ /* the NULL's in this table correspond to the status codes that should *never* be generated by a backend */ -static const char *status_to_string[] = { +static const gchar *status_to_string[] = { /* E_BOOK_ERROR_OK */ N_("Success"), /* E_BOOK_ERROR_INVALID_ARG */ NULL, /* E_BOOK_ERROR_BUSY */ N_("Backend busy"), @@ -81,9 +81,9 @@ static const char *status_to_string[] = { }; void -eab_error_dialog (const char *msg, EBookStatus status) +eab_error_dialog (const gchar *msg, EBookStatus status) { - const char *status_str; + const gchar *status_str; if (status >= G_N_ELEMENTS (status_to_string)) status_str = "Other error"; @@ -97,7 +97,7 @@ eab_error_dialog (const char *msg, EBookStatus status) void eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) { - char *label_string, *label = NULL, *uri; + gchar *label_string, *label = NULL, *uri; GtkWidget *dialog; gboolean can_detail_error = TRUE; @@ -114,7 +114,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) } else if (!strncmp (uri, "file:", 5)) { - char *path = g_filename_from_uri (uri, NULL, NULL); + gchar *path = g_filename_from_uri (uri, NULL, NULL); label = g_strdup_printf ( _("This address book cannot be opened. Please check that the " "path %s exists and that permissions are set to access it."), path); @@ -162,7 +162,7 @@ void eab_search_result_dialog (GtkWidget *parent, EBookViewStatus status) { - char *str = NULL; + gchar *str = NULL; switch (status) { case E_BOOK_VIEW_STATUS_OK: @@ -304,7 +304,7 @@ eab_show_multiple_contacts (EBook *book, gboolean editable) { if (list) { - int length = g_list_length (list); + gint length = g_list_length (list); if (length > 5) { GtkWidget *dialog; gint response; @@ -336,11 +336,11 @@ eab_show_multiple_contacts (EBook *book, static gint -file_exists(GtkWindow *window, const char *filename) +file_exists(GtkWindow *window, const gchar *filename) { GtkWidget *dialog; gint response; - char * utf8_filename; + gchar * utf8_filename; utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); dialog = gtk_message_dialog_new (window, @@ -362,15 +362,15 @@ file_exists(GtkWindow *window, const char *filename) typedef struct { GtkWidget *filesel; - char *vcard; + gchar *vcard; gboolean has_multiple_contacts; } SaveAsInfo; static void save_it(GtkWidget *widget, SaveAsInfo *info) { - const char *filename; - char *uri; + const gchar *filename; + gchar *uri; gint response = 0; @@ -388,7 +388,7 @@ save_it(GtkWidget *widget, SaveAsInfo *info) } if (!e_write_file_uri (uri, info->vcard)) { - char *err_str_ext; + gchar *err_str_ext; if (info->has_multiple_contacts) { /* more than one, finding the total number of contacts might * hit performance while saving large number of contacts @@ -419,7 +419,7 @@ close_it(GtkWidget *widget, SaveAsInfo *info) } static void -destroy_it(void *data, GObject *where_the_object_was) +destroy_it(gpointer data, GObject *where_the_object_was) { SaveAsInfo *info = data; g_free (info->vcard); @@ -435,10 +435,10 @@ filechooser_response (GtkWidget *widget, gint response_id, SaveAsInfo *info) close_it (widget, info); } -static char * -make_safe_filename (char *name) +static gchar * +make_safe_filename (gchar *name) { - char *safe; + gchar *safe; if (!name) { /* This is a filename. Translators take note. */ @@ -521,11 +521,11 @@ eab_select_source (const gchar *title, const gchar *message, const gchar *select } void -eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window) +eab_contact_save (gchar *title, EContact *contact, GtkWindow *parent_window) { GtkWidget *filesel; - char *file; - char *name; + gchar *file; + gchar *name; SaveAsInfo *info = g_new(SaveAsInfo, 1); name = e_contact_get (contact, E_CONTACT_FILE_AS); @@ -563,11 +563,11 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window) } void -eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window) +eab_contact_list_save (gchar *title, GList *list, GtkWindow *parent_window) { GtkWidget *filesel; SaveAsInfo *info = g_new(SaveAsInfo, 1); - char *file; + gchar *file; filesel = gtk_file_chooser_dialog_new (title, parent_window, @@ -586,7 +586,7 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window) /* This is a filename. Translators take note. */ if (list && list->data && list->next == NULL) { - char *name; + gchar *name; name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FILE_AS); if (!name) name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FULL_NAME); @@ -621,7 +621,7 @@ typedef struct ContactCopyProcess_ ContactCopyProcess; typedef void (*ContactCopyDone) (ContactCopyProcess *process); struct ContactCopyProcess_ { - int count; + gint count; gboolean book_status; GList *contacts; EBook *source; @@ -644,7 +644,7 @@ do_delete (gpointer data, gpointer user_data) { EBook *book = user_data; EContact *contact = data; - const char *id; + const gchar *id; id = e_contact_get_const (contact, E_CONTACT_UID); e_book_remove_contact(book, id, NULL); @@ -678,7 +678,7 @@ process_unref (ContactCopyProcess *process) } static void -contact_added_cb (EBook* book, EBookStatus status, const char *id, gpointer user_data) +contact_added_cb (EBook* book, EBookStatus status, const gchar *id, gpointer user_data) { ContactCopyProcess *process = user_data; @@ -733,9 +733,9 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de { EBook *dest; ESource *destination_source; - static char *last_uid = NULL; + static gchar *last_uid = NULL; ContactCopyProcess *process; - char *desc; + gchar *desc; if (contacts == NULL) return; @@ -785,7 +785,7 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de typedef struct { EContact *contact; - int email_num; /* if the contact is a person (not a list), the email address to use */ + gint email_num; /* if the contact is a person (not a list), the email address to use */ } ContactAndEmailNum; static void @@ -858,11 +858,11 @@ eab_send_to_contact_and_email_num_list (GList *contact_list) gtk_widget_show (GTK_WIDGET (composer)); } -static const char * +static const gchar * get_email (EContact *contact, EContactField field_id, gchar **to_free) { - char *name = NULL, *mail = NULL; - const char *value = e_contact_get_const (contact, field_id); + gchar *name = NULL, *mail = NULL; + const gchar *value = e_contact_get_const (contact, field_id); *to_free = NULL; @@ -986,7 +986,7 @@ eab_send_contact_list (GList *contacts, EABDisposition disposition) } void -eab_send_contact (EContact *contact, int email_num, EABDisposition disposition) +eab_send_contact (EContact *contact, gint email_num, EABDisposition disposition) { GList *list = NULL; @@ -1016,7 +1016,7 @@ eab_create_image_chooser_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { - char *filename; + gchar *filename; GtkWidget *w = NULL; w = e_image_chooser_new (); @@ -1064,12 +1064,12 @@ eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) then makes one string and returns it, otherwise returns NULL. Returned string is usable to place directly into GtkHtml stream. Returned value should be freed with g_free. */ -char * +gchar * eab_parse_qp_email_to_html (const gchar *string) { - char *name = NULL, *mail = NULL; - char *html_name, *html_mail; - char *value; + gchar *name = NULL, *mail = NULL; + gchar *html_name, *html_mail; + gchar *value; if (!eab_parse_qp_email (string, &name, &mail)) return NULL; |