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 | |
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')
58 files changed, 921 insertions, 921 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index aa7bb74c6a..c82726276c 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -96,7 +96,7 @@ static EContactField priority [] = { E_CONTACT_FIELD_LAST }; -static int priority_label [] = { +static gint priority_label [] = { LABEL_WORK, LABEL_HOME, LABEL_FAX, @@ -168,10 +168,10 @@ struct _EAddrConduitCfg { * this function (see e_pilot_utf8_to_pchar() in e-pilot-util.c) */ static int -e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *category) +e_pilot_add_category_if_possible(gchar *cat_to_add, struct CategoryAppInfo *category) { - int i, j; - int retval = 0; /* 0 is the Unfiled category */ + gint i, j; + gint retval = 0; /* 0 is the Unfiled category */ LOG(g_message("e_pilot_add_category_if_possible\n")); for(i=0; i<PILOT_MAX_CATEGORIES; i++){ @@ -179,14 +179,14 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ the PalmOS doesn't let 0-length strings for categories */ if(strlen(category->name[i]) == 0){ - int cat_to_add_len; - int desktopUniqueID; + gint cat_to_add_len; + gint desktopUniqueID; cat_to_add_len = strlen(cat_to_add); retval = i; if(cat_to_add_len > 15){ - char tmpstr[16]; + gchar tmpstr[16]; strncpy(tmpstr, cat_to_add,16); tmpstr[16] = '\0'; /* Have to truncate the category name */ @@ -214,7 +214,7 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ * we don't have much use for it at present. */ for (desktopUniqueID = 128; desktopUniqueID <= 255; desktopUniqueID++) { - int found = 0; + gint found = 0; for(j=0; j<PILOT_MAX_CATEGORIES; j++){ if (category->ID[j] == desktopUniqueID) { found = 1; @@ -252,22 +252,22 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ * is set to zero ("Unfiled"). */ static -void e_pilot_local_category_to_remote(int * pilotCategory, +void e_pilot_local_category_to_remote(gint * pilotCategory, EContact *contact, struct CategoryAppInfo *category) { GList *c_list = NULL, *l; - char * category_string, *first_category = NULL; - int i; + gchar * category_string, *first_category = NULL; + gint i; *pilotCategory = 0; /* default to "Unfiled" */ c_list = e_contact_get (contact, E_CONTACT_CATEGORY_LIST); if (c_list) { /* remember the first category */ - first_category = e_pilot_utf8_to_pchar((const char *)c_list->data); + first_category = e_pilot_utf8_to_pchar((const gchar *)c_list->data); } l = c_list; while(l && *pilotCategory == 0) { /* list != 0, so at least 1 category is assigned */ - category_string = e_pilot_utf8_to_pchar((const char *)l->data); + category_string = e_pilot_utf8_to_pchar((const gchar *)l->data); for (i=0; i < PILOT_MAX_CATEGORIES; i++) { /* only 15 chars + nul in palm category name */ if (strncmp(category_string,category->name[i], 15) == 0) { @@ -297,10 +297,10 @@ void e_pilot_local_category_to_remote(int * pilotCategory, * conversion from a palm category to an evolution category */ static -void e_pilot_remote_category_to_local(int pilotCategory, +void e_pilot_remote_category_to_local(gint pilotCategory, EContact *contact, struct CategoryAppInfo *category) { - char *category_string = NULL; + gchar *category_string = NULL; if (pilotCategory != 0) { /* pda has category assigned */ @@ -345,17 +345,17 @@ void e_pilot_remote_category_to_local(int pilotCategory, } } -static char * -build_setup_path (const char *path, const char *key) +static gchar * +build_setup_path (const gchar *path, const gchar *key) { return g_strconcat ("/apps/evolution/conduit", "/", path, "/", key, NULL); } static gboolean -e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) +e_pilot_setup_get_bool (const gchar *path, const gchar *key, gboolean def) { gboolean res = def; - char *full_path; + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -380,10 +380,10 @@ e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) } static void -e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) +e_pilot_setup_set_bool (const gchar *path, const gchar *key, gboolean value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -403,11 +403,11 @@ e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) } } -static char * -e_pilot_setup_get_string (const char *path, const char *key, const char *def) +static gchar * +e_pilot_setup_get_string (const gchar *path, const gchar *key, const gchar *def) { - char *res = g_strdup (def); - char *full_path; + gchar *res = g_strdup (def); + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -434,10 +434,10 @@ e_pilot_setup_get_string (const char *path, const char *key, const char *def) } static void -e_pilot_setup_set_string (const char *path, const char *key, const char *value) +e_pilot_setup_set_string (const gchar *path, const gchar *key, const gchar *value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -578,7 +578,7 @@ e_addr_gui_new (EPilotSettings *ps) EAddrConduitGui *gui; GtkWidget *lbl; gint rows, i; - static const char *items[] = {"Business", "Home", "Other", NULL}; + static const gchar *items[] = {"Business", "Home", "Other", NULL}; g_return_val_if_fail (ps != NULL, NULL); g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL); @@ -603,7 +603,7 @@ e_addr_gui_new (EPilotSettings *ps) return gui; } -static const int default_address_map[] = { +static const gint default_address_map[] = { E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_HOME, E_CONTACT_ADDRESS_OTHER, @@ -721,7 +721,7 @@ e_addr_context_destroy (EAddrConduitContext *ctxt) static const gchar * print_local (EAddrLocalRecord *local) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; if (local == NULL) { sprintf (buff, "[NULL]"); @@ -742,9 +742,9 @@ print_local (EAddrLocalRecord *local) return ""; } -static char *print_remote (GnomePilotRecord *remote) +static gchar *print_remote (GnomePilotRecord *remote) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; struct Address addr; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; @@ -786,10 +786,10 @@ static char *print_remote (GnomePilotRecord *remote) } /* Utility routines */ -static char * +static gchar * map_name (EAddrConduitContext *ctxt) { - char *filename = NULL; + gchar *filename = NULL; filename = g_strdup_printf ("%s/.evolution/addressbook/local/system/pilot-map-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); @@ -951,15 +951,15 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) EContactField next_mail, next_home, next_work, next_fax; EContactField next_other, next_main, next_pager, next_mobile; gboolean syncable = TRUE; - int i, l = 0; + gint i, l = 0; /* See if there are fields we can't sync or not in priority order */ get_next_init (&next_mail, &next_home, &next_work, &next_fax, &next_other, &next_main, &next_pager, &next_mobile); for (i = entryPhone1; i <= entryPhone5 && syncable; i++) { - int phonelabel = local->addr->phoneLabel[i - entryPhone1]; - const char *phone_str = local->addr->entry[i]; + gint phonelabel = local->addr->phoneLabel[i - entryPhone1]; + const gchar *phone_str = local->addr->entry[i]; gboolean empty = !(phone_str && *phone_str); if (empty) @@ -1029,9 +1029,9 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) } static void -set_contact_text (EContact *contact, EContactField field, struct Address address, int entry) +set_contact_text (EContact *contact, EContactField field, struct Address address, gint entry) { - char *text = NULL; + gchar *text = NULL; if (address.entry[entry]) text = e_pilot_utf8_from_pchar (address.entry[entry]); @@ -1041,8 +1041,8 @@ set_contact_text (EContact *contact, EContactField field, struct Address address g_free (text); } -static char * -get_entry_text (struct Address address, int entry) +static gchar * +get_entry_text (struct Address address, gint entry) { if (address.entry[entry]) return e_pilot_utf8_from_pchar (address.entry[entry]); @@ -1051,7 +1051,7 @@ get_entry_text (struct Address address, int entry) } static void -clear_entry_text (struct Address address, int field) +clear_entry_text (struct Address address, gint field) { if (address.entry[field]) { free (address.entry[field]); @@ -1060,7 +1060,7 @@ clear_entry_text (struct Address address, int field) } static void -compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const char *uid) +compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const gchar *uid) { EBookChange *ebc; @@ -1095,7 +1095,7 @@ local_record_to_pilot_record (EAddrLocalRecord *local, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #else - static char record[0xffff]; + static gchar record[0xffff]; #endif g_assert (local->addr != NULL ); @@ -1127,7 +1127,7 @@ local_record_to_pilot_record (EAddrLocalRecord *local, pi_buffer_free(buffer); #else - p.record = (unsigned char *)record; + p.record = (guchar *)record; p.length = pack_Address (local->addr, p.record, 0xffff); #endif return p; @@ -1137,10 +1137,10 @@ static void local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrConduitContext *ctxt) { EContactAddress *address = NULL; - int phone = entryPhone1; + gint phone = entryPhone1; EContactField field; gboolean syncable; - int i; + gint i; g_return_if_fail (local != NULL); g_return_if_fail (contact != NULL); @@ -1157,7 +1157,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui */ if (local->local.ID != 0) { struct Address addr; - int cat = 0; + gint cat = 0; #ifdef PILOT_LINK_0_12 pi_buffer_t * record; record = pi_buffer_new(DLP_BUF_SIZE); @@ -1166,7 +1166,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui return; } #else - char record[0xffff]; + gchar record[0xffff]; #endif if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, @@ -1183,7 +1183,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui #ifdef PILOT_LINK_0_12 unpack_Address (&addr, record, address_v1); #else - unpack_Address (&addr, (unsigned char *)record, 0xffff); + unpack_Address (&addr, (guchar *)record, 0xffff); #endif for (i = 0; i < 5; i++) { if (addr.entry[entryPhone1 + i]) @@ -1224,7 +1224,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui } if (address) { - char *add; + gchar *add; /* If the address has 2 lines, make sure both get added */ if (address->ext != NULL && @@ -1258,7 +1258,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui /* Sync by priority */ for (i = 0, phone = entryPhone1; priority[i] != E_CONTACT_FIELD_LAST && phone <= entryPhone5; i++) { - const char *phone_str; + const gchar *phone_str; phone_str = e_contact_get_const (contact, priority[i]); if (phone_str && *phone_str) { @@ -1281,8 +1281,8 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui /* Not completely syncable, so do the best we can */ for (i = entryPhone1; i <= entryPhone5; i++) { - int phonelabel = local->addr->phoneLabel[i - entryPhone1]; - const char *phone_str = NULL; + gint phonelabel = local->addr->phoneLabel[i - entryPhone1]; + const gchar *phone_str = NULL; if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) { phone_str = e_contact_get_const (contact, next_mail); @@ -1323,11 +1323,11 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui static void local_record_from_uid (EAddrLocalRecord *local, - const char *uid, + const gchar *uid, EAddrConduitContext *ctxt) { EContact *contact = NULL; - const char *cuid; + const gchar *cuid; GList *l; g_assert (local != NULL); @@ -1362,10 +1362,10 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, EContactName *name; EContactAddress *eaddress; EContactField mailing_address; - char *txt, *find, *full_name; + gchar *txt, *find, *full_name; EContactField next_mail, next_home, next_work, next_fax; EContactField next_other, next_main, next_pager, next_mobile; - int i; + gint i; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif @@ -1460,8 +1460,8 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, &next_other, &next_main, &next_pager, &next_mobile); for (i = entryPhone1; i <= entryPhone5; i++) { - int phonelabel = address.phoneLabel[i - entryPhone1]; - char *phonenum = get_entry_text (address, i); + gint phonelabel = address.phoneLabel[i - entryPhone1]; + gchar *phonenum = get_entry_text (address, i); if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) { e_contact_set (contact, next_mail, phonenum); @@ -1504,8 +1504,8 @@ static void check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt) { GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); - int map_count; - const char *uri; + gint map_count; + const gchar *uri; map_count = g_hash_table_size (ctxt->map->pid_map); if (map_count == 0) @@ -1580,15 +1580,15 @@ pre_sync (GnomePilotConduit *conduit, GnomePilotConduitSyncAbs *abs_conduit; EBookQuery *query; GList *l; - int len; - char *filename; - char *change_id; - char *auth; + gint len; + gchar *filename; + gchar *change_id; + gchar *auth; gint num_records, add_records = 0, mod_records = 0, del_records = 0; #ifdef PILOT_LINK_0_12 pi_buffer_t *buffer; #else - unsigned char *buf; + guchar *buf; #endif abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit); @@ -1645,7 +1645,7 @@ pre_sync (GnomePilotConduit *conduit, for (l = ctxt->changed; l != NULL; l = l->next) { EBookChange *ebc = l->data; - const char *uid; + const gchar *uid; uid = e_contact_get_const (ebc->contact, E_CONTACT_UID); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -1684,9 +1684,9 @@ pre_sync (GnomePilotConduit *conduit, len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, DLP_BUF_SIZE, buffer); #else - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, - (unsigned char *)buf, 0xffff); + (guchar *)buf, 0xffff); #endif if (len < 0) { WARN (_("Could not read pilot's Address application block")); @@ -1717,18 +1717,18 @@ post_sync (GnomePilotConduit *conduit, { GList *changed; gchar *filename, *change_id; - unsigned char *buf; - int dlpRetVal, len; + guchar *buf; + gint dlpRetVal, len; LOG (g_message ( "post_sync: Address Conduit v.%s", CONDUIT_VERSION )); /* Write AppBlock to PDA - updates categories */ - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = pack_AddressAppInfo (&(ctxt->ai), buf, 0xffff); dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, - (unsigned char *)buf, len); + (guchar *)buf, len); g_free (buf); @@ -1779,7 +1779,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord *local, EAddrConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_status_cleared: clearing status\n" )); @@ -1795,7 +1795,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { static GList *cards, *iterator; - static int count; + static gint count; g_return_val_if_fail (local != NULL, -1); @@ -1845,7 +1845,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { static GList *iterator; - static int count; + static gint count; g_return_val_if_fail (local != NULL, 0); @@ -1899,7 +1899,7 @@ compare (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { GnomePilotRecord local_pilot; - int retval = 0; + gint retval = 0; LOG (g_message ("compare: local=%s remote=%s...\n", print_local (local), print_remote (remote))); @@ -1927,7 +1927,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { EContact *contact; - int retval = 0; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1958,8 +1958,8 @@ replace_record (GnomePilotConduitSyncAbs *conduit, { EContact *new_contact; EBookChange *ebc; - char *old_id; - int retval = 0; + gchar *old_id; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1990,7 +1990,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, /* Adding a record causes wombat to assign a new uid so we must tidy */ if (ebc && ebc->change_type == E_BOOK_CHANGE_CARD_DELETED) { - const char *uid = e_contact_get_const (local->contact, E_CONTACT_UID); + const gchar *uid = e_contact_get_const (local->contact, E_CONTACT_UID); gboolean arch; arch = e_pilot_map_uid_is_archived (ctxt->map, uid); @@ -2016,7 +2016,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { GError *error = NULL; - int retval = 0; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (local->contact != NULL, -1); @@ -2040,7 +2040,7 @@ archive_record (GnomePilotConduitSyncAbs *conduit, gboolean archive, EAddrConduitContext *ctxt) { - int retval = 0; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -2057,7 +2057,7 @@ match (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord **local, EAddrConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ("match: looking for local copy of %s\n", print_remote (remote))); diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 2c1d5caa9b..ec715b7cb9 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -61,7 +61,7 @@ static BonoboObjectClass *parent_class = NULL; struct _AddressbookComponentPrivate { GConfClient *gconf_client; - char *base_directory; + gchar *base_directory; GList *views; }; @@ -71,7 +71,7 @@ ensure_sources (AddressbookComponent *component) ESourceList *source_list; ESourceGroup *on_this_computer; ESource *personal_source; - char *base_uri, *base_uri_proto, base_uri_proto_seventh; + gchar *base_uri, *base_uri_proto, base_uri_proto_seventh; const gchar *base_dir; personal_source = NULL; @@ -204,28 +204,28 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_sequence_set_release (list, FALSE); - list->_buffer[0].id = (char *) "contact"; + list->_buffer[0].id = (gchar *) "contact"; list->_buffer[0].description = _("New Contact"); - list->_buffer[0].menuDescription = (char *) C_("New", "_Contact"); + list->_buffer[0].menuDescription = (gchar *) C_("New", "_Contact"); list->_buffer[0].tooltip = _("Create a new contact"); list->_buffer[0].menuShortcut = 'c'; - list->_buffer[0].iconName = (char *) "contact-new"; + list->_buffer[0].iconName = (gchar *) "contact-new"; list->_buffer[0].type = GNOME_Evolution_CREATABLE_OBJECT; - list->_buffer[1].id = (char *) "contact_list"; + list->_buffer[1].id = (gchar *) "contact_list"; list->_buffer[1].description = _("New Contact List"); - list->_buffer[1].menuDescription = (char *) C_("New", "Contact _List"); + list->_buffer[1].menuDescription = (gchar *) C_("New", "Contact _List"); list->_buffer[1].tooltip = _("Create a new contact list"); list->_buffer[1].menuShortcut = 'l'; - list->_buffer[1].iconName = (char *) "stock_contact-list"; + list->_buffer[1].iconName = (gchar *) "stock_contact-list"; list->_buffer[1].type = GNOME_Evolution_CREATABLE_OBJECT; - list->_buffer[2].id = (char *) "address_book"; + list->_buffer[2].id = (gchar *) "address_book"; list->_buffer[2].description = _("New Address Book"); - list->_buffer[2].menuDescription = (char *) C_("New", "Address _Book"); + list->_buffer[2].menuDescription = (gchar *) C_("New", "Address _Book"); list->_buffer[2].tooltip = _("Create a new address book"); list->_buffer[2].menuShortcut = '\0'; - list->_buffer[2].iconName = (char *) "address-book-new"; + list->_buffer[2].iconName = (gchar *) "address-book-new"; list->_buffer[2].type = GNOME_Evolution_CREATABLE_FOLDER; return list; @@ -235,7 +235,7 @@ static void book_loaded_cb (EBook *book, EBookStatus status, gpointer data) { EContact *contact; - char *item_type_name = data; + gchar *item_type_name = data; if (status != E_BOOK_ERROR_OK) { /* XXX we really need a dialog here, but we don't have @@ -267,7 +267,7 @@ impl_requestCreateItem (PortableServer_Servant servant, EBook *book; GConfClient *gconf_client; ESourceList *source_list; - char *uid; + gchar *uid; if (!item_type_name || (strcmp (item_type_name, "address_book") && @@ -310,7 +310,7 @@ impl_requestCreateItem (PortableServer_Servant servant, static void impl_handleURI (PortableServer_Servant servant, - const char* uri, + const gchar * uri, CORBA_Environment *ev) { AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant)); @@ -318,8 +318,8 @@ impl_handleURI (PortableServer_Servant servant, AddressbookView *view = NULL; GList *l; - char *src_uid = NULL; - char *contact_uid = NULL; + gchar *src_uid = NULL; + gchar *contact_uid = NULL; priv = addressbook_component->priv; l = g_list_last (priv->views); @@ -330,8 +330,8 @@ impl_handleURI (PortableServer_Servant servant, if (!strncmp (uri, "contacts:", 9)) { EUri *euri = e_uri_new (uri); - const char *p; - char *header, *content; + const gchar *p; + gchar *header, *content; size_t len, clen; p = euri->query; @@ -343,7 +343,7 @@ impl_handleURI (PortableServer_Servant servant, if (p[len] != '=') break; - header = (char *) p; + header = (gchar *) p; header[len] = '\0'; p += len + 1; @@ -462,7 +462,7 @@ static void addressbook_component_init (AddressbookComponent *component) { AddressbookComponentPrivate *priv; - static int first = TRUE; + static gint first = TRUE; priv = g_new0 (AddressbookComponentPrivate, 1); @@ -518,7 +518,7 @@ addressbook_component_peek_gconf_client (AddressbookComponent *component) return component->priv->gconf_client; } -const char * +const gchar * addressbook_component_peek_base_directory (AddressbookComponent *component) { g_return_val_if_fail (ADDRESSBOOK_IS_COMPONENT (component), NULL); diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h index 222ace82d7..4208994117 100644 --- a/addressbook/gui/component/addressbook-component.h +++ b/addressbook/gui/component/addressbook-component.h @@ -59,6 +59,6 @@ GType addressbook_component_get_type (void); AddressbookComponent *addressbook_component_peek (void); GConfClient *addressbook_component_peek_gconf_client (AddressbookComponent *component); -const char *addressbook_component_peek_base_directory (AddressbookComponent *component); +const gchar *addressbook_component_peek_base_directory (AddressbookComponent *component); #endif /* _ADDRESSBOOK_COMPONENT_H_ */ diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index ebb2d18b5d..46ab002ecb 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -75,8 +75,8 @@ #define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory:" BASE_VERSION #define LDAP_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl:" BASE_VERSION -GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2, - int num1, int num2); +GtkWidget* supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, + gint num1, gint num2); /* default objectclasses */ #define TOP "top" @@ -152,7 +152,7 @@ ldap_unparse_auth (AddressbookLDAPAuthType auth_type) } static AddressbookLDAPAuthType -ldap_parse_auth (const char *auth) +ldap_parse_auth (const gchar *auth) { if (!auth) return ADDRESSBOOK_LDAP_AUTH_NONE; @@ -196,7 +196,7 @@ ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type) } static AddressbookLDAPSSLType -ldap_parse_ssl (const char *ssl) +ldap_parse_ssl (const gchar *ssl) { if (!ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */ @@ -209,7 +209,7 @@ ldap_parse_ssl (const char *ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; } -static const char * +static const gchar * ldap_get_ssl_tooltip (AddressbookLDAPSSLType ssl_type) { switch (ssl_type) { @@ -271,8 +271,8 @@ addressbook_ldap_init (GtkWidget *window, ESource *source) LDAP *ldap; gchar *host; gint port; - int ldap_error; - int protocol_version = LDAP_VERSION3; + gint ldap_error; + gint protocol_version = LDAP_VERSION3; if (!source_to_uri_parts (source, &host, NULL, NULL, NULL, &port)) return NULL; @@ -310,7 +310,7 @@ static int addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, const gchar **attrs, LDAPMessage **resp) { - int ldap_error; + gint ldap_error; struct timeval timeout; timeout.tv_sec = (gint) gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment); @@ -328,7 +328,7 @@ addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, /* searching page */ GtkWidget* -supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2) +supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, gint num1, gint num2) { GtkWidget *table, *scrolled; GtkTreeSelection *selection; @@ -359,10 +359,10 @@ do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkListStore *model, E { LDAP *ldap; const gchar *attrs[2]; - int ldap_error; - char **values; + gint ldap_error; + gchar **values; LDAPMessage *resp; - int i; + gint i; ldap = addressbook_ldap_init (sdialog->window, source); if (!ldap) @@ -419,7 +419,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) GtkWidget *supported_bases_table; GladeXML *gui; GtkTreeIter iter; - char *gladefile; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, @@ -450,7 +450,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK && gtk_tree_selection_get_selected (selection, &model, &iter)) { - char *dn; + gchar *dn; gtk_tree_model_get (model, &iter, 0, &dn, -1); gtk_entry_set_text((GtkEntry *)sdialog->rootdn, dn); @@ -474,7 +474,7 @@ addressbook_config_create_new_source (GtkWidget *parent) static void eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) { - int id = gtk_combo_box_get_active(dropdown); + gint id = gtk_combo_box_get_active(dropdown); GtkTreeModel *model; GtkTreeIter iter; @@ -494,7 +494,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "groupwise:", 10)) { GSList *l; ESource *source; - char *tmp; + gchar *tmp; l = e_source_group_peek_sources(sdialog->source_group); if (l && l->data ) { @@ -510,7 +510,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) g_free (tmp); #ifdef HAVE_LDAP } else if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "ldap:", 5)) { - char *tmp; + gchar *tmp; tmp = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s", "", LDAP_PORT_STRING, @@ -529,7 +529,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkComboBox *dropdown; @@ -538,7 +538,7 @@ eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str GtkTreeIter iter; GSList *l; GtkWidget *w, *label; - int i, row = 0; + gint i, row = 0; if (old) return old; @@ -595,13 +595,13 @@ offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *uri; + const gchar *uri; GtkWidget *w; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (old) return old; @@ -634,11 +634,11 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static GtkWidget * -eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *offline_setting; - const char *offline_sync; + const gchar *offline_sync; gboolean is_local_book; is_local_book = g_str_has_prefix (e_source_group_peek_base_uri (sdialog->source_group), "file:"); @@ -701,7 +701,7 @@ host_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *port = gtk_entry_get_text((GtkEntry *)w); + const gchar *port = gtk_entry_get_text((GtkEntry *)w); if (!strcmp (port, LDAPS_PORT_STRING)) { sdialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS; @@ -725,15 +725,15 @@ ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static GtkWidget * -eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *tmp; + const gchar *tmp; GtkWidget *w; - char *uri, port[16]; + gchar *uri, port[16]; LDAPURLDesc *lud; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -783,7 +783,7 @@ eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static void auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *principal = gtk_entry_get_text((GtkEntry *)w); + const gchar *principal = gtk_entry_get_text((GtkEntry *)w); /* seems messy ... but the api is */ switch (sdialog->auth) { @@ -814,13 +814,13 @@ auth_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -883,14 +883,14 @@ scope_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; LDAPURLDesc *lud; - char *uri; + gchar *uri; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -951,7 +951,7 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s static void timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char *timeout; + gchar *timeout; timeout = g_strdup_printf("%f", gtk_adjustment_get_value(((GtkRange *)sdialog->timeout_scale)->adjustment)); e_source_set_property(sdialog->source, "timeout", timeout); @@ -961,7 +961,7 @@ timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void limit_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char limit[16]; + gchar limit[16]; sprintf(limit, "%d", gtk_spin_button_get_value_as_int((GtkSpinButton *)sdialog->limit_spinbutton)); e_source_set_property(sdialog->source, "limit", limit); @@ -977,13 +977,13 @@ canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source) } static GtkWidget * -eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -1045,18 +1045,18 @@ static EConfigItem eabc_new_items[] = { }; static void -eabc_commit(EConfig *ec, GSList *items, void *data) +eabc_commit(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; xmlNodePtr xml; #if d(!)0 - char *txt; + gchar *txt; #endif if (sdialog->original_source) { d(printf("committing addressbook changes\n")); /* these api's kinda suck */ - xml = xmlNewNode(NULL, (const unsigned char *)"dummy"); + xml = xmlNewNode(NULL, (const guchar *)"dummy"); e_source_dump_to_xml_node(sdialog->source, xml); e_source_update_from_xml_node(sdialog->original_source, xml->children, NULL); xmlFreeNode(xml); @@ -1079,7 +1079,7 @@ eabc_commit(EConfig *ec, GSList *items, void *data) } static void -eabc_free(EConfig *ec, GSList *items, void *data) +eabc_free(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; @@ -1098,11 +1098,11 @@ eabc_free(EConfig *ec, GSList *items, void *data) } static gboolean -eabc_check_complete(EConfig *ec, const char *pageid, void *data) +eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data) { AddressbookSourceDialog *sdialog = data; - int valid = TRUE; - const char *tmp; + gint valid = TRUE; + const gchar *tmp; ESource *source; d(printf("check complete, pageid = '%s'\n", pageid?pageid:"<all>")); @@ -1114,7 +1114,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) #ifdef HAVE_LDAP if (valid && source_group_is_remote(sdialog->source_group)) { - char *uri = e_source_get_uri(sdialog->source); + gchar *uri = e_source_get_uri(sdialog->source); LDAPURLDesc *lud; /* check host and port set */ @@ -1158,7 +1158,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) static void source_changed(ESource *source, AddressbookSourceDialog *sdialog) { - char *xml; + gchar *xml; xml = e_source_to_standalone_xml(source); printf("source changed:\n%s\n", xml); @@ -1171,11 +1171,11 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) { AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); EABConfig *ec; - int i; + gint i; GSList *items = NULL; EABConfigTargetSource *target; - char *xml; - char *gladefile; + gchar *xml; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c index ca691761c9..8017e8979f 100644 --- a/addressbook/gui/component/addressbook-migrate.c +++ b/addressbook/gui/component/addressbook-migrate.c @@ -106,7 +106,7 @@ dialog_close (MigrationContext *context) } static void -dialog_set_label (MigrationContext *context, const char *str) +dialog_set_label (MigrationContext *context, const gchar *str) { gtk_label_set_text (GTK_LABEL (context->label), str); @@ -119,9 +119,9 @@ dialog_set_label (MigrationContext *context, const char *str) } static void -dialog_set_folder_name (MigrationContext *context, const char *folder_name) +dialog_set_folder_name (MigrationContext *context, const gchar *folder_name) { - char *text; + gchar *text; text = g_strdup_printf (_("Migrating '%s':"), folder_name); gtk_label_set_text (GTK_LABEL (context->folder_label), text); @@ -140,7 +140,7 @@ dialog_set_folder_name (MigrationContext *context, const char *folder_name) static void dialog_set_progress (MigrationContext *context, double percent) { - char text[5]; + gchar text[5]; snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); @@ -156,7 +156,7 @@ dialog_set_progress (MigrationContext *context, double percent) } static gboolean -check_for_conflict (ESourceGroup *group, char *name) +check_for_conflict (ESourceGroup *group, gchar *name) { GSList *sources; GSList *s; @@ -173,16 +173,16 @@ check_for_conflict (ESourceGroup *group, char *name) return FALSE; } -static char * -get_source_name (ESourceGroup *group, const char *path) +static gchar * +get_source_name (ESourceGroup *group, const gchar *path) { #ifndef G_OS_WIN32 - char **p = g_strsplit (path, "/", 0); + gchar **p = g_strsplit (path, "/", 0); #else - char **p = g_strsplit_set (path, "\\/", 0); + gchar **p = g_strsplit_set (path, "\\/", 0); #endif - int i, j, starting_index; - int num_elements; + gint i, j, starting_index; + gint num_elements; gboolean conflict; GString *s = g_string_new (""); @@ -227,8 +227,8 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) { EBookQuery *query = e_book_query_any_field_contains (""); GList *l, *contacts; - int num_added = 0; - int num_contacts; + gint num_added = 0; + gint num_contacts; /* both books are loaded, start the actual migration */ e_book_get_contacts (old_book, query, &contacts, NULL); @@ -341,7 +341,7 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) "OTHER"); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { /* k, this is the nasty part. we glomb all the value strings back together again (if there is more than one), then work our magic */ @@ -381,9 +381,9 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) } static void -migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESource *new_source) +migrate_contact_folder_to_source (MigrationContext *context, gchar *old_path, ESource *new_source) { - char *old_uri = g_filename_to_uri (old_path, NULL, NULL); + gchar *old_uri = g_filename_to_uri (old_path, NULL, NULL); GError *e = NULL; EBook *old_book = NULL, *new_book = NULL; @@ -423,7 +423,7 @@ migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESo } static void -migrate_contact_folder (MigrationContext *context, char *old_path, ESourceGroup *dest_group, char *source_name) +migrate_contact_folder (MigrationContext *context, gchar *old_path, ESourceGroup *dest_group, gchar *source_name) { ESource *new_source; @@ -449,7 +449,7 @@ create_groups (MigrationContext *context, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; const gchar *base_dir; *on_this_computer = NULL; @@ -528,9 +528,9 @@ create_groups (MigrationContext *context, static gboolean migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer, ESource *personal_source) { - char *old_path = NULL; + gchar *old_path = NULL; GSList *dirs, *l; - char *local_contact_folder = NULL; + gchar *local_contact_folder = NULL; old_path = g_strdup_printf ("%s/evolution/local", g_get_home_dir ()); @@ -542,15 +542,15 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer NULL); for (l = dirs; l; l = l->next) { - char *source_name; + gchar *source_name; /* we handle the system folder differently */ - if (personal_source && !strcmp ((char*)l->data, local_contact_folder)) { + if (personal_source && !strcmp ((gchar *)l->data, local_contact_folder)) { g_hash_table_insert (context->folder_uid_map, g_strdup (l->data), g_strdup (e_source_peek_uid (personal_source))); migrate_contact_folder_to_source (context, local_contact_folder, personal_source); continue; } - source_name = get_source_name (on_this_computer, (char*)l->data); + source_name = get_source_name (on_this_computer, (gchar *)l->data); migrate_contact_folder (context, l->data, on_this_computer, source_name); g_free (source_name); } @@ -563,13 +563,13 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer return TRUE; } -static char * +static gchar * get_string_child (xmlNode *node, - const char *name) + const gchar *name) { xmlNode *p; xmlChar *xml_string; - char *retval; + gchar *retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -580,7 +580,7 @@ get_string_child (xmlNode *node, return g_strdup(""); xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = g_strdup ((char *) xml_string); + retval = g_strdup ((gchar *) xml_string); xmlFree (xml_string); return retval; @@ -588,12 +588,12 @@ get_string_child (xmlNode *node, static int get_integer_child (xmlNode *node, - const char *name, - int defval) + const gchar *name, + gint defval) { xmlNode *p; xmlChar *xml_string; - int retval; + gint retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -604,7 +604,7 @@ get_integer_child (xmlNode *node, return defval; xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = atoi ((char *)xml_string); + retval = atoi ((gchar *)xml_string); xmlFree (xml_string); return retval; @@ -613,7 +613,7 @@ get_integer_child (xmlNode *node, static gboolean migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) { - char *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", + gchar *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", g_get_home_dir ()); printf ("trying to migrate from %s\n", sources_xml); @@ -622,14 +622,14 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) xmlDoc *doc = xmlParseFile (sources_xml); xmlNode *root; xmlNode *child; - int num_contactservers; - int servernum; + gint num_contactservers; + gint servernum; if (!doc) return FALSE; root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "addressbooks") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "addressbooks") != 0) { xmlFreeDoc (doc); return FALSE; } @@ -637,7 +637,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) /* count the number of servers, so we can give progress */ num_contactservers = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { + if (!strcmp ((const gchar *)child->name, "contactserver")) { num_contactservers++; } } @@ -647,11 +647,11 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) servernum = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { - char *port, *host, *rootdn, *scope, *authmethod, *ssl; - char *emailaddr, *binddn, *limitstr; - int limit; - char *name, *description; + if (!strcmp ((const gchar *)child->name, "contactserver")) { + gchar *port, *host, *rootdn, *scope, *authmethod, *ssl; + gchar *emailaddr, *binddn, *limitstr; + gint limit; + gchar *name, *description; GString *uri = g_string_new (""); ESource *source; @@ -711,7 +711,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) } static ESource* -get_source_by_name (ESourceList *source_list, const char *name) +get_source_by_name (ESourceList *source_list, const gchar *name) { GSList *groups; GSList *g; @@ -731,7 +731,7 @@ get_source_by_name (ESourceList *source_list, const char *name) for (s = sources; s; s = s->next) { ESource *source = E_SOURCE (s->data); - const char *source_name = e_source_peek_name (source); + const gchar *source_name = e_source_peek_name (source); if (!strcmp (name, source_name)) return source; @@ -744,7 +744,7 @@ get_source_by_name (ESourceList *source_list, const char *name) static gboolean migrate_completion_folders (MigrationContext *context) { - char *uris_xml = gconf_client_get_string (addressbook_component_peek_gconf_client (context->component), + gchar *uris_xml = gconf_client_get_string (addressbook_component_peek_gconf_client (context->component), "/apps/evolution/addressbook/completion/uris", NULL); @@ -761,14 +761,14 @@ migrate_completion_folders (MigrationContext *context) dialog_set_folder_name (context, _("Autocompletion Settings")); root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "EvolutionFolderList") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "EvolutionFolderList") != 0) { xmlFreeDoc (doc); return FALSE; } for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "folder")) { - char *physical_uri = e_xml_get_string_prop_by_name (child, (const unsigned char *)"physical-uri"); + if (!strcmp ((const gchar *)child->name, "folder")) { + gchar *physical_uri = e_xml_get_string_prop_by_name (child, (const guchar *)"physical-uri"); ESource *source = NULL; /* if the physical uri is file://... @@ -783,8 +783,8 @@ migrate_completion_folders (MigrationContext *context) for the uri. */ if (!strncmp (physical_uri, "file://", 7)) { - char *filename = g_filename_from_uri (physical_uri, NULL, NULL); - char *uid = NULL; + gchar *filename = g_filename_from_uri (physical_uri, NULL, NULL); + gchar *uid = NULL; if (filename) uid = g_hash_table_lookup (context->folder_uid_map, @@ -794,7 +794,7 @@ migrate_completion_folders (MigrationContext *context) source = e_source_list_peek_source_by_uid (context->source_list, uid); } else { - char *name = e_xml_get_string_prop_by_name (child, (const unsigned char *)"display-name"); + gchar *name = e_xml_get_string_prop_by_name (child, (const guchar *)"display-name"); source = get_source_by_name (context->source_list, name); @@ -833,14 +833,14 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate contact lists for source %s", uri); g_free (uri); continue; @@ -864,8 +864,8 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup GList *v = e_vcard_attribute_get_values (a); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { - EDestination *dest = e_destination_import ((char*)v->data); + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { + EDestination *dest = e_destination_import ((gchar *)v->data); e_destination_export_to_vcard_attribute (dest, a); @@ -908,14 +908,14 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate company phone numbers for source %s", uri); g_free (uri); continue; @@ -932,7 +932,7 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup GError *e = NULL; GList *attrs, *attr; gboolean converted = FALSE; - int num_work_voice = 0; + gint num_work_voice = 0; attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr;) { @@ -1001,11 +1001,11 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup } static void -migrate_pilot_data (const char *old_path, const char *new_path) +migrate_pilot_data (const gchar *old_path, const gchar *new_path) { - const char *dent; - const char *ext; - char *filename; + const gchar *dent; + const gchar *ext; + gchar *filename; GDir *dir; if (!(dir = g_dir_open (old_path, 0, NULL))) @@ -1017,9 +1017,9 @@ migrate_pilot_data (const char *old_path, const char *new_path) (!strncmp (dent, "pilot-sync-evolution-addressbook-", 33) && ((ext = strrchr (dent, '.')) && !strcmp (ext, ".db")))) { /* src and dest file formats are identical for both map and changelog files */ - unsigned char inbuf[4096]; + guchar inbuf[4096]; size_t nread, nwritten; - int fd0, fd1; + gint fd0, fd1; ssize_t n; filename = g_build_filename (old_path, dent, NULL); @@ -1103,8 +1103,8 @@ migration_context_free (MigrationContext *context) g_free (context); } -int -addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision, GError **err) +gint +addressbook_migrate (AddressbookComponent *component, gint major, gint minor, gint revision, GError **err) { ESourceGroup *on_this_computer; ESourceGroup *on_ldap_servers; @@ -1165,7 +1165,7 @@ addressbook_migrate (AddressbookComponent *component, int major, int minor, int } if (minor < 5 || (minor == 5 && revision <= 10)) { - char *old_path, *new_path; + gchar *old_path, *new_path; dialog_set_label (context, _("Evolution's Palm Sync changelog and map files have changed.\n\n" "Please be patient while Evolution migrates your Pilot Sync data...")); diff --git a/addressbook/gui/component/addressbook-migrate.h b/addressbook/gui/component/addressbook-migrate.h index 5727b3d0ab..c10f29cfdd 100644 --- a/addressbook/gui/component/addressbook-migrate.h +++ b/addressbook/gui/component/addressbook-migrate.h @@ -28,6 +28,6 @@ struct _GError; -int addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision, struct _GError **err); +gint addressbook_migrate (AddressbookComponent *component, gint major, gint minor, gint revision, struct _GError **err); #endif /* _ADDRESSBOOK_MIGRATE_H_ */ diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index e6b99c6405..379660c993 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -83,7 +83,7 @@ struct _AddressbookViewPrivate { EBook *book; guint activity_id; ESourceList *source_list; - char *passwd; + gchar *passwd; EUserCreatableItemsHandler *creatable_items_handler; EABMenu *menu; @@ -101,7 +101,7 @@ static GtkTargetEntry drag_types[] = { }; static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]); -static void set_status_message (EABView *eav, const char *message, AddressbookView *view); +static void set_status_message (EABView *eav, const gchar *message, AddressbookView *view); static void search_result (EABView *eav, EBookViewStatus status, AddressbookView *view); static void activate_source (AddressbookView *view, ESource *source); @@ -115,7 +115,7 @@ static ESource *get_primary_source (AddressbookView *view); typedef struct { GtkWidget *editor; - char *uid; + gchar *uid; AddressbookView *view; } EditorUidClosure; @@ -139,7 +139,7 @@ get_current_view (AddressbookView *view) } static void -save_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) +save_all_contacts_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -149,7 +149,7 @@ save_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -save_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) +save_contact_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -158,7 +158,7 @@ save_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -view_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) +view_contact_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -167,7 +167,7 @@ view_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -delete_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) +delete_contact_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -176,7 +176,7 @@ delete_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -print_cb (BonoboUIComponent *uih, void *user_data, const char *path) +print_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -185,7 +185,7 @@ print_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -print_preview_cb (BonoboUIComponent *uih, void *user_data, const char *path) +print_preview_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -194,7 +194,7 @@ print_preview_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -stop_loading_cb (BonoboUIComponent *uih, void *user_data, const char *path) +stop_loading_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -203,7 +203,7 @@ stop_loading_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -cut_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) +cut_contacts_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -212,7 +212,7 @@ cut_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -copy_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) +copy_contacts_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -221,7 +221,7 @@ copy_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -paste_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) +paste_contacts_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -230,7 +230,7 @@ paste_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -select_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path) +select_all_contacts_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -239,7 +239,7 @@ select_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *pat } static void -send_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) +send_contact_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -248,7 +248,7 @@ send_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -send_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) +send_contact_to_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -257,7 +257,7 @@ send_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -copy_all_contacts_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) +copy_all_contacts_to_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -267,7 +267,7 @@ copy_all_contacts_to_cb (BonoboUIComponent *uih, void *user_data, const char *pa } static void -copy_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) +copy_contact_to_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -276,7 +276,7 @@ copy_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -move_all_contacts_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) +move_all_contacts_to_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -285,7 +285,7 @@ move_all_contacts_to_cb (BonoboUIComponent *uih, void *user_data, const char *pa } static void -move_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) +move_contact_to_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; EABView *v = get_current_view (view); @@ -294,7 +294,7 @@ move_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path) } static void -forget_passwords_cb (BonoboUIComponent *uih, void *user_data, const char *path) +forget_passwords_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { e_passwords_forget_passwords(); } @@ -307,7 +307,7 @@ new_addressbook_folder (AddressbookView *view) } static void -new_folder_cb (BonoboUIComponent *uih, void *user_data, const char *path) +new_folder_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; new_addressbook_folder (view); @@ -356,7 +356,7 @@ delete_addressbook_folder (AddressbookView *view) } static void -delete_folder_cb (BonoboUIComponent *uih, void *user_data, const char *path) +delete_folder_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; if (view) @@ -369,7 +369,7 @@ edit_addressbook_folder (AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; ESource *selected_source; - const char *uid; + const gchar *uid; EditorUidClosure *closure; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->selector)); @@ -380,7 +380,7 @@ edit_addressbook_folder (AddressbookView *view) closure = g_hash_table_lookup (priv->uid_to_editor, uid); if (!closure) { - char *uid_copy = g_strdup (uid); + gchar *uid_copy = g_strdup (uid); closure = g_new (EditorUidClosure, 1); closure->editor = addressbook_config_edit_source (gtk_widget_get_toplevel(priv->notebook), selected_source); @@ -400,7 +400,7 @@ edit_addressbook_folder (AddressbookView *view) } static void -edit_folder_cb (BonoboUIComponent *uih, void *user_data, const char *path) +edit_folder_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; if (view) @@ -413,8 +413,8 @@ rename_addressbook_folder (AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; ESource *source; - const char *old_name; - char *prompt, *new_name; + const gchar *old_name; + gchar *prompt, *new_name; gboolean done = FALSE; source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->selector)); @@ -441,7 +441,7 @@ rename_addressbook_folder (AddressbookView *view) } static void -rename_folder_cb (BonoboUIComponent *uih, void *user_data, const char *path) +rename_folder_cb (BonoboUIComponent *uih, gpointer user_data, const gchar *path) { AddressbookView *view = (AddressbookView *) user_data; if (view) @@ -453,7 +453,7 @@ folder_can_delete (AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; ESource *source ; - const char *source_uri; + const gchar *source_uri; source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->selector)); if(source) { @@ -468,7 +468,7 @@ folder_can_delete (AddressbookView *view) } static void -set_status_message (EABView *eav, const char *message, AddressbookView *view) +set_status_message (EABView *eav, const gchar *message, AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; EActivityHandler *activity_handler = priv->activity_handler; @@ -479,7 +479,7 @@ set_status_message (EABView *eav, const char *message, AddressbookView *view) priv->activity_id = 0; } } else if (priv->activity_id == 0) { - char *clientid = g_strdup_printf ("%p", (gpointer) view); + gchar *clientid = g_strdup_printf ("%p", (gpointer) view); priv->activity_id = e_activity_handler_operation_started ( activity_handler, clientid, message, TRUE); @@ -492,7 +492,7 @@ set_status_message (EABView *eav, const char *message, AddressbookView *view) } static void -set_folder_bar_message (EABView *eav, const char *message, AddressbookView *view) +set_folder_bar_message (EABView *eav, const gchar *message, AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; EABView *current_view = get_current_view (view); @@ -501,7 +501,7 @@ set_folder_bar_message (EABView *eav, const char *message, AddressbookView *view ESource *source = eav->source; if (source) { - const char *name = e_source_peek_name (source); + const gchar *name = e_source_peek_name (source); e_info_label_set_info((EInfoLabel*)priv->info_widget, name, message); } @@ -628,7 +628,7 @@ control_activate (BonoboControl *control, AddressbookViewPrivate *priv = view->priv; Bonobo_UIContainer remote_ui_container; EABView *v = get_current_view (view); - char *xmlfile; + gchar *xmlfile; remote_ui_container = bonobo_control_get_remote_ui_container (control, NULL); bonobo_ui_component_set_container (uic, remote_ui_container, NULL); @@ -684,7 +684,7 @@ control_activate_cb (BonoboControl *control, } static void -gather_uids_foreach (char *key, +gather_uids_foreach (gchar *key, gpointer value, GList **list) { @@ -701,7 +701,7 @@ source_list_changed_cb (ESourceList *source_list, AddressbookView *view) uids = NULL; g_hash_table_foreach (priv->uid_to_view, (GHFunc)gather_uids_foreach, &uids); for (l = uids; l; l = l->next) { - char *uid = l->data; + gchar *uid = l->data; if (e_source_list_peek_source_by_uid (source_list, uid)) { /* the source still exists, do nothing */ } @@ -721,7 +721,7 @@ source_list_changed_cb (ESourceList *source_list, AddressbookView *view) uids = NULL; g_hash_table_foreach (priv->uid_to_editor, (GHFunc)gather_uids_foreach, &uids); for (l = uids; l; l = l->next) { - char *uid = l->data; + gchar *uid = l->data; if (e_source_list_peek_source_by_uid (source_list, uid)) { /* the source still exists, do nothing */ } @@ -801,7 +801,7 @@ get_primary_source (AddressbookView *view) { AddressbookViewPrivate *priv = view->priv; ESource *source; - char *uid; + gchar *uid; uid = gconf_client_get_string (priv->gconf_client, "/apps/evolution/addressbook/display/primary_addressbook", @@ -867,7 +867,7 @@ book_removed (EBook *book, EBookStatus status, gpointer data) } static void -delete_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +delete_addressbook_cb(EPopup *ep, EPopupItem *pitem, gpointer data) { AddressbookView *view = data; AddressbookViewPrivate *priv = view->priv; @@ -903,13 +903,13 @@ delete_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) } static void -new_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +new_addressbook_cb(EPopup *ep, EPopupItem *pitem, gpointer data) { addressbook_config_create_new_source (gtk_widget_get_toplevel(ep->target->widget)); } static void -rename_addressbook_cb (EPopup *ep, EPopupItem *pitem, void *data) +rename_addressbook_cb (EPopup *ep, EPopupItem *pitem, gpointer data) { AddressbookView *view = data; ESourceSelector *selector; @@ -919,7 +919,7 @@ rename_addressbook_cb (EPopup *ep, EPopupItem *pitem, void *data) } static void -save_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +save_addressbook_cb(EPopup *ep, EPopupItem *pitem, gpointer data) { AddressbookView *view = data; EABView *v = get_current_view (view); @@ -928,7 +928,7 @@ save_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) } static void -edit_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +edit_addressbook_cb(EPopup *ep, EPopupItem *pitem, gpointer data) { AddressbookView *view = data; if (view) @@ -958,7 +958,7 @@ static EPopupItem abv_source_popups[] = { }; static void -abv_source_popup_free(EPopup *ep, GSList *list, void *data) +abv_source_popup_free(EPopup *ep, GSList *list, gpointer data) { g_slist_free(list); } @@ -969,7 +969,7 @@ popup_event_callback(ESourceSelector *selector, ESource *source, GdkEventButton EABPopup *ep; EABPopupTargetSource *t; GSList *menus = NULL; - int i; + gint i; GtkMenu *menu; /** @HookPoint-EABPopup:Addressbook Source Selector Context Menu @@ -1035,7 +1035,7 @@ removed_contact_cb (EBook *book, EBookStatus status, gpointer closure) } static void -merged_contact_cb (EBook *book, EBookStatus status, const char *id, gpointer closure) +merged_contact_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure) { MergeContext *merge_context = closure; @@ -1088,7 +1088,7 @@ selector_tree_data_dropped (ESourceSelector *selector, } e_book_open (target_book, FALSE, NULL); - eab_book_and_contact_list_from_string ((char *)data->data, &source_book, &contactlist); + eab_book_and_contact_list_from_string ((gchar *)data->data, &source_book, &contactlist); v = get_current_view (view); g_object_get (v->model, "book",&source_book, NULL); @@ -1252,7 +1252,7 @@ addressbook_view_init (AddressbookView *view) } static void -destroy_editor (char *key, +destroy_editor (gchar *key, gpointer value, gpointer nada) { @@ -1342,7 +1342,7 @@ activate_source (AddressbookView *view, ESource *source) { AddressbookViewPrivate *priv = view->priv; - const char *uid; + const gchar *uid; GtkWidget *uid_view; EBook *book; BookOpenData *data; @@ -1496,8 +1496,8 @@ addressbook_view_peek_folder_view (AddressbookView *view) void addressbook_view_edit_contact (AddressbookView* view, - const char* source_uid, - const char* contact_uid) + const gchar * source_uid, + const gchar * contact_uid) { AddressbookViewPrivate *priv = view->priv; diff --git a/addressbook/gui/component/addressbook-view.h b/addressbook/gui/component/addressbook-view.h index 08bbbb3e99..bdb37e021a 100644 --- a/addressbook/gui/component/addressbook-view.h +++ b/addressbook/gui/component/addressbook-view.h @@ -59,7 +59,7 @@ GtkWidget *addressbook_view_peek_statusbar (AddressbookView *view BonoboControl *addressbook_view_peek_folder_view (AddressbookView *view); void addressbook_view_edit_contact (AddressbookView* view, - const char* source_id, - const char* contact_id); + const gchar * source_id, + const gchar * contact_id); #endif /* _ADDRESSBOOK_VIEW_H_ */ diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index f36012ab94..45790e15c0 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -57,10 +57,10 @@ free_load_source_data (LoadSourceData *data) /*this function removes of anything present after semicolon in uri*/ -static gchar* +static gchar * remove_parameters_from_uri (const gchar *uri) { - char *euri_str; + gchar *euri_str; EUri *euri; euri = e_uri_new (uri); @@ -167,8 +167,8 @@ static void addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *source, EBookCallback cb, gpointer closure) { - const char *password = NULL; - char *pass_dup = NULL; + const gchar *password = NULL; + gchar *pass_dup = NULL; const gchar *auth; const gchar *user; gchar *uri = remove_parameters_from_uri(e_book_get_uri (book)); @@ -197,8 +197,8 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc user = ""; if (!password) { - char *prompt; - char *password_prompt; + gchar *prompt; + gchar *password_prompt; gboolean remember; const gchar *failed_auth; guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE; diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index f45f2228e1..9773f5bd5b 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -80,7 +80,7 @@ source_selection_changed (ESourceSelector *selector, } static void -config_control_destroy_notify (void *data, +config_control_destroy_notify (gpointer data, GObject *where_the_config_control_was) { AutocompletionConfig *ac = (AutocompletionConfig *) data; @@ -101,7 +101,7 @@ initialize_selection (AutocompletionConfig *ac) GSList *sources; for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); - const char *completion = e_source_get_property (source, "completion"); + const gchar *completion = e_source_get_property (source, "completion"); if (completion && !g_ascii_strcasecmp (completion, "true")) e_source_selector_select_source (E_SOURCE_SELECTOR (ac->control_widget), source); diff --git a/addressbook/gui/component/component-factory.c b/addressbook/gui/component/component-factory.c index 4d02cc3e6b..eddabd7b48 100644 --- a/addressbook/gui/component/component-factory.c +++ b/addressbook/gui/component/component-factory.c @@ -49,8 +49,8 @@ static BonoboObject * factory (BonoboGenericFactory *factory, - const char *component_id, - void *closure) + const gchar *component_id, + gpointer closure) { d(printf ("asked to activate component_id `%s'\n", component_id)); diff --git a/addressbook/gui/component/openldap-extract.h b/addressbook/gui/component/openldap-extract.h index 010589da1e..083fc0d162 100644 --- a/addressbook/gui/component/openldap-extract.h +++ b/addressbook/gui/component/openldap-extract.h @@ -48,7 +48,7 @@ #define LDAP_CALLOC(n,s) calloc((n),(s)) #define LDAP_REALLOC(p,s) realloc((p),(s)) #define LDAP_FREE(p) free((p)) -#define LDAP_VFREE(p) vfree((void **)(p)) +#define LDAP_VFREE(p) vfree((gpointer *)(p)) #define LDAP_STRDUP(s) strdup((s)) #define LDAP_RANGE(n,x,y) (((x) <= (n)) && ((n) <= (y))) @@ -87,21 +87,21 @@ #define LDAP_SCHEMA_SKIP 0x80U /* Don't malloc any result */ typedef struct ldap_objectclass { - char *oc_oid; /* REQUIRED */ - char **oc_names; /* OPTIONAL */ - char *oc_desc; /* OPTIONAL */ - int oc_obsolete; /* 0=no, 1=yes */ - char **oc_sup_oids; /* OPTIONAL */ - int oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ - char **oc_at_oids_must; /* OPTIONAL */ - char **oc_at_oids_may; /* OPTIONAL */ + gchar *oc_oid; /* REQUIRED */ + gchar **oc_names; /* OPTIONAL */ + gchar *oc_desc; /* OPTIONAL */ + gint oc_obsolete; /* 0=no, 1=yes */ + gchar **oc_sup_oids; /* OPTIONAL */ + gint oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ + gchar **oc_at_oids_must; /* OPTIONAL */ + gchar **oc_at_oids_may; /* OPTIONAL */ } LDAPObjectClass; static void -vfree(void **vec) +vfree(gpointer *vec) { - int i; + gint i; for (i = 0; vec[i] != NULL; i++) free(vec[i]); @@ -143,17 +143,17 @@ vfree(void **vec) #define TK_QDESCR TK_QDSTRING struct token { - int type; - char *sval; + gint type; + gchar *sval; }; static int -get_token( const char ** sp, char ** token_val ) +get_token( const gchar ** sp, gchar ** token_val ) { - int kind; - const char * p; - const char * q; - char * res; + gint kind; + const gchar * p; + const gchar * q; + gchar * res; *token_val = NULL; switch (**sp) { @@ -223,20 +223,20 @@ get_token( const char ** sp, char ** token_val ) /* Gobble optional whitespace */ static void -parse_whsp(const char **sp) +parse_whsp(const gchar **sp) { while (LDAP_SPACE(**sp)) (*sp)++; } /* Parse a sequence of dot-separated decimal strings */ -static char * -ldap_int_parse_numericoid(const char **sp, int *code, const int flags) +static gchar * +ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags) { - char * res = NULL; - const char * start = *sp; - int len; - int quoted = 0; + gchar * res = NULL; + const gchar * start = *sp; + gint len; + gint quoted = 0; /* Netscape puts the SYNTAX value in quotes (incorrectly) */ if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && **sp == '\'' ) { @@ -248,7 +248,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) while (**sp) { if ( !LDAP_DIGIT(**sp) ) { /* - * Initial char is not a digit or char after dot is + * Initial gchar is not a digit or gchar after dot is * not a digit */ *code = LDAP_SCHERR_NODIGIT; @@ -262,7 +262,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) /* Otherwise, gobble the dot and loop again */ (*sp)++; } - /* Now *sp points at the char past the numericoid. Perfect. */ + /* Now *sp points at the gchar past the numericoid. Perfect. */ len = *sp - start; if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && quoted ) { if ( **sp == '\'' ) { @@ -273,7 +273,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } } if (flags & LDAP_SCHEMA_SKIP) { - res = (char *)start; + res = (gchar *)start; } else { res = LDAP_MALLOC(len+1); if (!res) { @@ -287,22 +287,22 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } /* Parse a qdescr or a list of them enclosed in () */ -static char ** -parse_qdescrs(const char **sp, int *code) +static gchar ** +parse_qdescrs(const gchar **sp, gint *code) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; parse_whsp(sp); kind = get_token(sp,&sval); if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -316,7 +316,7 @@ parse_qdescrs(const char **sp, int *code) if ( kind == TK_QDESCR ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_VFREE(res); LDAP_FREE(sval); @@ -338,7 +338,7 @@ parse_qdescrs(const char **sp, int *code) parse_whsp(sp); return(res); } else if ( kind == TK_QDESCR ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -355,15 +355,15 @@ parse_qdescrs(const char **sp, int *code) } /* Parse a woid or a $-separated list of them enclosed in () */ -static char ** -parse_oids(const char **sp, int *code, const int allow_quoted) +static gchar ** +parse_oids(const gchar **sp, gint *code, const gint allow_quoted) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; /* * Strictly speaking, doing this here accepts whsp before the @@ -376,7 +376,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -407,7 +407,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) kind == TK_QDSTRING ) ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_FREE(sval); LDAP_VFREE(res); @@ -436,7 +436,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) return(res); } else if ( kind == TK_BAREWORD || ( allow_quoted && kind == TK_QDSTRING ) ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { LDAP_FREE(sval); *code = LDAP_SCHERR_OUTOFMEM; @@ -466,24 +466,24 @@ ldap_objectclass_free(LDAPObjectClass * oc) } static LDAPObjectClass * -ldap_str2objectclass( LDAP_CONST char * s, - int * code, - LDAP_CONST char ** errp, +ldap_str2objectclass( LDAP_CONST gchar * s, + gint * code, + LDAP_CONST gchar ** errp, LDAP_CONST unsigned flags ) { - int kind; - const char * ss = s; - char * sval; - int seen_name = 0; - int seen_desc = 0; - int seen_obsolete = 0; - int seen_sup = 0; - int seen_kind = 0; - int seen_must = 0; - int seen_may = 0; + gint kind; + const gchar * ss = s; + gchar * sval; + gint seen_name = 0; + gint seen_desc = 0; + gint seen_obsolete = 0; + gint seen_sup = 0; + gint seen_kind = 0; + gint seen_must = 0; + gint seen_may = 0; LDAPObjectClass * oc; - char ** ext_vals; - const char * savepos; + gchar ** ext_vals; + const gchar * savepos; if ( !s ) { *code = LDAP_SCHERR_EMPTY; @@ -539,7 +539,7 @@ ldap_str2objectclass( LDAP_CONST char * s, } else if ( flags & LDAP_SCHEMA_ALLOW_OID_MACRO ) { /* Non-numerical OID, ignore */ - int len = ss-savepos; + gint len = ss-savepos; oc->oc_oid = LDAP_MALLOC(len+1); strncpy(oc->oc_oid, savepos, len); oc->oc_oid[len] = 0; @@ -741,21 +741,21 @@ ldap_str2objectclass( LDAP_CONST char * s, #define LDAP_UTF8_INCR(p) ((p)=LDAP_UTF8_NEXT((p))) #define ldap_x_utf8_to_ucs4(str) g_utf8_get_char(str) -static char *ldap_utf8_strchr( const char *str, const char *chr ) +static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr ) { for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) { if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) { - return (char *) str; + return (gchar *) str; } } return NULL; } -static size_t ldap_utf8_strcspn( const char *str, const char *set ) +static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset) ) { @@ -768,10 +768,10 @@ static size_t ldap_utf8_strcspn( const char *str, const char *set ) return cstr - str; } -static size_t ldap_utf8_strspn( const char *str, const char *set ) +static size_t ldap_utf8_strspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; ; LDAP_UTF8_INCR(cset) ) { @@ -788,10 +788,10 @@ static size_t ldap_utf8_strspn( const char *str, const char *set ) return cstr - str; } -static char *ldap_utf8_strtok(char *str, const char *sep, char **last) +static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last) { - char *begin; - char *end; + gchar *begin; + gchar *end; if( last == NULL ) return NULL; @@ -807,7 +807,7 @@ static char *ldap_utf8_strtok(char *str, const char *sep, char **last) end = &begin[ ldap_utf8_strcspn( begin, sep ) ]; if( *end != '\0' ) { - char *next = LDAP_UTF8_NEXT( end ); + gchar *next = LDAP_UTF8_NEXT( end ); *end = '\0'; end = next; } @@ -856,17 +856,17 @@ typedef struct ldap_url_desc { /* from url.c */ -static const char* +static const gchar * skip_url_prefix( - const char *url, - int *enclosedp, - const char **scheme ) + const gchar *url, + gint *enclosedp, + const gchar **scheme ) { /* * return non-zero if this looks like a LDAP URL; zero if not * if non-zero returned, *urlp will be moved past "ldap://" part of URL */ - const char *p; + const gchar *p; if ( url == NULL ) { return( NULL ); @@ -924,7 +924,7 @@ skip_url_prefix( return( NULL ); } -static int str2scope( const char *p ) +static gint str2scope( const gchar *p ) { if ( strcasecmp( p, "one" ) == 0 ) { return LDAP_SCOPE_ONELEVEL; @@ -980,7 +980,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp ) } static int -ldap_int_unhex( int c ) +ldap_int_unhex( gint c ) { return( c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 @@ -988,7 +988,7 @@ ldap_int_unhex( int c ) } static void -ldap_pvt_hex_unescape( char *s ) +ldap_pvt_hex_unescape( gchar *s ) { /* * Remove URL hex escapes from s... done in place. The basic concept for @@ -1014,8 +1014,8 @@ ldap_pvt_hex_unescape( char *s ) *p = '\0'; } -static char ** -ldap_str2charray( const char *str_in, const char *brkstr ) +static gchar ** +ldap_str2charray( const gchar *str_in, const gchar *brkstr ) { char **res; char *str, *s; @@ -1035,7 +1035,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } } - res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) ); + res = (gchar **) LDAP_MALLOC( (i + 1) * sizeof(gchar *) ); if( res == NULL ) { LDAP_FREE( str ); @@ -1069,7 +1069,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } static int -ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { /* * Pick apart the pieces of an LDAP URL. @@ -1078,9 +1078,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) LDAPURLDesc *ludp; char *p, *q, *r; int i, enclosed; - const char *scheme = NULL; - const char *url_tmp; - char *url; + const gchar *scheme = NULL; + const gchar *url_tmp; + gchar *url; if( url_in == NULL || ludpp == NULL ) { return LDAP_URL_ERR_PARAM; @@ -1393,9 +1393,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) } static int -ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { - int rc = ldap_url_parse_ext( url_in, ludpp ); + gint rc = ldap_url_parse_ext( url_in, ludpp ); if( rc != LDAP_URL_SUCCESS ) { return rc; diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 3897d605e3..5040b96570 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -99,7 +99,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam { GladeXML *gui; GtkWidget *widget; - char *gladefile; + gchar *gladefile; gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname)); gtk_dialog_set_has_separator (GTK_DIALOG (e_contact_editor_fullname), @@ -189,7 +189,7 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, } break; case PROP_EDITABLE: { - int i; + gint i; const gchar *widget_names[] = { "comboentry-title", "comboentry-suffix", @@ -283,7 +283,7 @@ fill_in_info(EContactEditorFullname *editor) } } -static char * +static gchar * extract_field (EContactEditorFullname *editor, const gchar *field) { diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index c7ce449ec4..305511d5d5 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -93,7 +93,7 @@ static GtkWindow* e_contact_editor_get_window (EABEditor *editor); static void save_contact (EContactEditor *ce, gboolean should_close); static void entry_activated (EContactEditor *editor); -static void set_entry_text(EContactEditor *editor, GtkEntry *entry, const char *string); +static void set_entry_text(EContactEditor *editor, GtkEntry *entry, const gchar *string); static void sensitize_ok (EContactEditor *ce); static EABEditorClass *parent_class = NULL; @@ -339,7 +339,7 @@ is_field_supported (EContactEditor *editor, EContactField field_id) /* This function tells you whether name_to_style will make sense. */ static gboolean -style_makes_sense (const EContactName *name, const gchar *company, int style) +style_makes_sense (const EContactName *name, const gchar *company, gint style) { switch (style) { case 0: /* Fall Through */ @@ -368,13 +368,13 @@ style_makes_sense (const EContactName *name, const gchar *company, int style) } } -static char * -name_to_style (const EContactName *name, const gchar *company, int style) +static gchar * +name_to_style (const EContactName *name, const gchar *company, gint style) { - char *string; - char *strings[4], **stringptr; - char *midstring[4], **midstrptr; - char *substring; + gchar *string; + gchar *strings[4], **stringptr; + gchar *midstring[4], **midstrptr; + gchar *substring; switch (style) { case 0: stringptr = strings; @@ -449,11 +449,11 @@ file_as_get_style (EContactEditor *editor) { GtkEntry *file_as = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (glade_xml_get_widget(editor->gui, "combo-file-as")))); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); - char *filestring; - char *trystring; + gchar *filestring; + gchar *trystring; EContactName *name = editor->name; const gchar *company; - int i; + gint i; if (!(file_as && GTK_IS_ENTRY(file_as))) return -1; @@ -475,10 +475,10 @@ file_as_get_style (EContactEditor *editor) } static void -file_as_set_style (EContactEditor *editor, int style) +file_as_set_style (EContactEditor *editor, gint style) { - char *string; - int i; + gchar *string; + gint i; GList *strings = NULL; GtkComboBox *combo_file_as = GTK_COMBO_BOX (glade_xml_get_widget (editor->gui, "combo-file-as")); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); @@ -496,7 +496,7 @@ file_as_set_style (EContactEditor *editor, int style) for (i = 0; i < 6; i++) { if (style_makes_sense (editor->name, company, i)) { - char *u; + gchar *u; u = name_to_style (editor->name, company, i); if (!STRING_IS_EMPTY (u)) strings = g_list_append (strings, u); @@ -528,8 +528,8 @@ file_as_set_style (EContactEditor *editor, int style) static void name_entry_changed (GtkWidget *widget, EContactEditor *editor) { - int style = 0; - const char *string; + gint style = 0; + const gchar *string; style = file_as_get_style (editor); e_contact_name_free (editor->name); @@ -545,7 +545,7 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) static void file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) { - char *string = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); + gchar *string = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); if (string && *string) { gchar *title; @@ -564,7 +564,7 @@ file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) static void company_entry_changed (GtkWidget *widget, EContactEditor *editor) { - int style = 0; + gint style = 0; style = file_as_get_style (editor); file_as_set_style (editor, style); @@ -600,9 +600,9 @@ sensitize_ok (EContactEditor *ce) GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN (glade_xml_get_widget (ce->gui, "combo-file-as"))); GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company"); - const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); - const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); - const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); + const gchar *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); + const gchar *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); + const gchar *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); allow_save = ce->target_editable && ce->changed ? TRUE : FALSE; @@ -641,7 +641,7 @@ image_chooser_changed (GtkWidget *widget, EContactEditor *editor) static void set_entry_text (EContactEditor *editor, GtkEntry *entry, const gchar *string) { - const char *oldstring = gtk_entry_get_text (entry); + const gchar *oldstring = gtk_entry_get_text (entry); if (!string) string = ""; @@ -2197,7 +2197,7 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) EContactPhoto *photo = e_contact_get (contact, field_id); if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { e_image_chooser_set_image_data (E_IMAGE_CHOOSER (widget), - (char *)photo->data.inlined.data, + (gchar *)photo->data.inlined.data, photo->data.inlined.length); editor->image_set = TRUE; } @@ -2235,7 +2235,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) e_contact_set (contact, field_id, (gchar *) text); } else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { - char *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); + gchar *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); e_contact_set (contact, field_id, text); @@ -2260,9 +2260,9 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) else if (E_IS_DATE_EDIT (widget)) { EContactDate date; if (e_date_edit_get_date (E_DATE_EDIT (widget), - (int *)&date.year, - (int *)&date.month, - (int *)&date.day)) + (gint *)&date.year, + (gint *)&date.month, + (gint *)&date.day)) e_contact_set (contact, field_id, &date); else e_contact_set (contact, field_id, NULL); @@ -2280,14 +2280,14 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) GdkPixbuf *pixbuf, *new; GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); - photo.data.inlined.data = (unsigned char *)img_buff; + photo.data.inlined.data = (guchar *)img_buff; img_buff = NULL; gdk_pixbuf_loader_write (loader, photo.data.inlined.data, photo.data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); if (pixbuf) { - int width, height, prompt_response; + gint width, height, prompt_response; g_object_ref (pixbuf); @@ -2314,7 +2314,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gdk_pixbuf_save_to_buffer (new, &img_buff, &photo.data.inlined.length, format_name, NULL, NULL); - photo.data.inlined.data = (unsigned char *)img_buff; + photo.data.inlined.data = (guchar *)img_buff; img_buff = NULL; g_free (format_name); g_object_unref (new); @@ -2345,7 +2345,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) else if (GTK_IS_TOGGLE_BUTTON (widget)) { gboolean val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - e_contact_set (contact, field_id, val?(void *)1:NULL); + e_contact_set (contact, field_id, val?(gpointer)1:NULL); } else { g_warning (G_STRLOC ": Unhandled widget class in mappings!"); @@ -2599,11 +2599,11 @@ source_changed (ESourceComboBox *source_combo_box, EContactEditor *editor) } static void -full_name_response (GtkDialog *dialog, int response, EContactEditor *editor) +full_name_response (GtkDialog *dialog, gint response, EContactEditor *editor) { EContactName *name; GtkWidget *fname_widget; - int style = 0; + gint style = 0; gboolean editable = FALSE; g_object_get (dialog, @@ -2619,8 +2619,8 @@ full_name_response (GtkDialog *dialog, int response, EContactEditor *editor) fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname"); if (fname_widget && GTK_IS_ENTRY (fname_widget)) { - char *full_name = e_contact_name_to_string(name); - const char *old_full_name = gtk_entry_get_text (GTK_ENTRY(fname_widget)); + gchar *full_name = e_contact_name_to_string(name); + const gchar *old_full_name = gtk_entry_get_text (GTK_ENTRY(fname_widget)); if (strcmp (full_name, old_full_name)) gtk_entry_set_text (GTK_ENTRY (fname_widget), full_name); @@ -2677,9 +2677,9 @@ full_name_clicked (GtkWidget *button, EContactEditor *editor) static void -categories_response (GtkDialog *dialog, int response, EContactEditor *editor) +categories_response (GtkDialog *dialog, gint response, EContactEditor *editor) { - const char *categories; + const gchar *categories; GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); if (response == GTK_RESPONSE_OK) { @@ -2687,7 +2687,7 @@ categories_response (GtkDialog *dialog, int response, EContactEditor *editor) if (entry && GTK_IS_ENTRY(entry)) gtk_entry_set_text (GTK_ENTRY (entry), categories); else - e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (char *)categories); + e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (gchar *)categories); } gtk_widget_destroy(GTK_WIDGET(dialog)); editor->categories_dialog = NULL; @@ -2706,7 +2706,7 @@ categories_editor_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer static void categories_clicked (GtkWidget *button, EContactEditor *editor) { - char *categories = NULL; + gchar *categories = NULL; GtkDialog *dialog; GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); @@ -2803,7 +2803,7 @@ static void update_preview_cb (GtkFileChooser *file_chooser, gpointer data) { GtkWidget *preview; - char *filename = NULL; + gchar *filename = NULL; GdkPixbuf *pixbuf; gtk_file_chooser_set_preview_widget_active (file_chooser, TRUE); @@ -2905,7 +2905,7 @@ contact_moved_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs) } static void -contact_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs) +contact_added_cb (EBook *book, EBookStatus status, const gchar *id, EditorCloseStruct *ecs) { EContactEditor *ce = ecs->ce; gboolean should_close = ecs->should_close; @@ -2921,7 +2921,7 @@ contact_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseSt gtk_widget_set_sensitive (ce->app, TRUE); ce->in_async_call = FALSE; - e_contact_set (ce->contact, E_CONTACT_UID, (char *) id); + e_contact_set (ce->contact, E_CONTACT_UID, (gchar *) id); eab_editor_contact_added (EAB_EDITOR (ce), status, ce->contact); @@ -2998,8 +2998,8 @@ real_save_contact (EContactEditor *ce, gboolean should_close) static void save_contact (EContactEditor *ce, gboolean should_close) { - char *uid; - const char *name_entry_string, *file_as_entry_string, *company_name_string; + gchar *uid; + const gchar *name_entry_string, *file_as_entry_string, *company_name_string; GtkWidget *entry_fullname, *entry_file_as, *company_name; if (!ce->target_book) @@ -3088,8 +3088,8 @@ static const EContactField non_string_fields [] = { static gboolean is_non_string_field (EContactField id) { - int count = sizeof (non_string_fields) / sizeof (EContactField); - int i; + gint count = sizeof (non_string_fields) / sizeof (EContactField); + gint i; for (i = 0; i < count; i++) if (id == non_string_fields[i]) return TRUE; @@ -3127,7 +3127,7 @@ e_contact_editor_is_valid (EABEditor *editor) for (e_iterator_last (iter); e_iterator_is_valid (iter); e_iterator_prev (iter)) { - const char *field_name = e_iterator_get (iter); + const gchar *field_name = e_iterator_get (iter); EContactField field_id = e_contact_field_id (field_name); if (is_non_string_field (field_id)) { @@ -3140,7 +3140,7 @@ e_contact_editor_is_valid (EABEditor *editor) } } else { - const char *text = e_contact_get_const (ce->contact, field_id); + const gchar *text = e_contact_get_const (ce->contact, field_id); if (STRING_IS_EMPTY (text)) { g_string_append_printf (errmsg, _("%s'%s' is empty"), @@ -3331,7 +3331,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) GladeXML *gui; GtkWidget *widget, *label; GtkEntryCompletion *completion; - char *gladefile; + gchar *gladefile; e_contact_editor->name = e_contact_name_new(); @@ -3495,7 +3495,7 @@ required_fields_cb (EBook *book, EBookStatus status, static void -contact_editor_destroy_notify (void *data, +contact_editor_destroy_notify (gpointer data, GObject *where_the_object_was) { eab_editor_remove (EAB_EDITOR (data)); @@ -3533,7 +3533,7 @@ e_contact_editor_new (EBook *book, static void writable_changed (EBook *book, gboolean writable, EContactEditor *ce) { - int new_target_editable; + gint new_target_editable; gboolean changed = FALSE; new_target_editable = e_book_is_writable (ce->target_book); diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index e9f40507ae..c5940d96d0 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -100,7 +100,7 @@ struct _EContactEditor EBook *load_book; /* signal ids for "writable_status" */ - int target_editable_id; + gint target_editable_id; GtkWidget *fullname_dialog; GtkWidget *categories_dialog; diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index e8d7b03e6c..17ef4fb16d 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -586,7 +586,7 @@ e_contact_quick_add_vcard (const gchar *vcard, EContactQuickAddCallback cb, gpoi if (contact) { GList *emails; - char *name; + gchar *name; EContactName *contact_name; g_object_unref (qa->contact); diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index d052e42fd7..6257e3972b 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -311,11 +311,11 @@ eab_editor_get_all_editors (void) } gboolean -eab_editor_confirm_delete (GtkWindow *parent, gboolean plural, gboolean is_list, char *name) +eab_editor_confirm_delete (GtkWindow *parent, gboolean plural, gboolean is_list, gchar *name) { GtkWidget *dialog; gint result; - char *msg; + gchar *msg; if (is_list) { /* contact list(s) */ diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h index 18a11047be..6959d25801 100644 --- a/addressbook/gui/contact-editor/eab-editor.h +++ b/addressbook/gui/contact-editor/eab-editor.h @@ -91,7 +91,7 @@ gboolean eab_editor_is_changed (EABEditor *editor); GtkWindow* eab_editor_get_window (EABEditor *editor); gboolean eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window); -gboolean eab_editor_confirm_delete (GtkWindow *parent, gboolean plural, gboolean is_list, char *name); +gboolean eab_editor_confirm_delete (GtkWindow *parent, gboolean plural, gboolean is_list, gchar *name); /* these four generate EABEditor signals */ void eab_editor_contact_added (EABEditor *editor, EBookStatus status, EContact *contact); diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index e624c97987..6c3349eada 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -54,12 +54,12 @@ " " -static char * -read_file (char *name) +static gchar * +read_file (gchar *name) { - int len; - char buff[65536]; - char line[1024]; + gint len; + gchar buff[65536]; + gchar line[1024]; FILE *f; f = fopen (name, "r"); @@ -81,7 +81,7 @@ read_file (char *name) static void editor_closed_cb (EContactEditor *ce, gpointer data) { - static int count = 2; + static gint count = 2; count--; g_object_unref (ce); @@ -90,9 +90,9 @@ editor_closed_cb (EContactEditor *ce, gpointer data) exit (0); } -int main( int argc, char *argv[] ) +gint main( gint argc, gchar *argv[] ) { - char *cardstr; + gchar *cardstr; EContactEditor *ce; gtk_init (&argc, &argv); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 7a492f0c52..e62958a72e 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -1397,7 +1397,7 @@ contact_list_editor_add_destination (EVCardAttribute *attr, gint email_num = -1; GList *list, *iter; GList *values; - char *value; + gchar *value; destination = e_destination_new (); diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index 86138efb14..6c343be46b 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -476,11 +476,11 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) we find an exact match, there is no reason to keep checking. */ while (i1 && match != EAB_CONTACT_MATCH_EXACT) { - char *addr1 = (char *) i1->data; + gchar *addr1 = (gchar *) i1->data; i2 = contact2_email; while (i2 && match != EAB_CONTACT_MATCH_EXACT) { - char *addr2 = (char *) i2->data; + gchar *addr2 = (gchar *) i2->data; match = combine_comparisons (match, compare_email_addresses (addr1, addr2)); @@ -640,7 +640,7 @@ use_common_book_cb (EBook *book, gpointer closure) gint p=0; gchar *contact_file_as, *qj; EBookQuery *query = NULL; - int i; + gint i; if (book == NULL) { info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure); @@ -699,7 +699,7 @@ use_common_book_cb (EBook *book, gpointer closure) for(i = 0; query_parts[i] != NULL; i++) g_free(query_parts[i]); if (p > 1) { - char *s; + gchar *s; s = g_strdup_printf ("(or %s)", qj); query = e_book_query_from_string (s); g_free (s); diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 895e8126c6..0805ca3110 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -62,7 +62,7 @@ static void match_query_callback (EContact *contact, EContact *match, EABContact #define SIMULTANEOUS_MERGING_REQUESTS 20 static GList *merging_queue = NULL; -static int running_merge_requests = 0; +static gint running_merge_requests = 0; static void @@ -109,7 +109,7 @@ free_lookup (EContactMergingLookup *lookup) } static void -final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure) +final_id_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure) { EContactMergingLookup *lookup = closure; @@ -156,7 +156,7 @@ cancelit (EContactMergingLookup *lookup) static void dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) { - int h, w; + gint h, w; /* Spacing around the table */ w = table->allocation.width + 30; @@ -173,7 +173,7 @@ dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) static void dropdown_changed (GtkWidget *dropdown, dropdown_data *data) { - char *str; + gchar *str; str = gtk_combo_box_get_active_text (GTK_COMBO_BOX (dropdown)); if (g_ascii_strcasecmp(str, "")) @@ -190,11 +190,11 @@ mergeit (EContactMergingLookup *lookup) GtkDialog *dialog; GtkTable *table; EContactField field; - char *str = NULL, *string = NULL, *string1 = NULL; - int num_of_email; + gchar *str = NULL, *string = NULL, *string1 = NULL; + gint num_of_email; GList *email_attr_list; - int row = -1; - int value = 0, result; + gint row = -1; + gint value = 0, result; dialog = (GtkDialog *)(gtk_dialog_new_with_buttons (_("Merge Contact"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL)); gtk_container_set_border_width (GTK_CONTAINER(dialog), 5); @@ -220,8 +220,8 @@ mergeit (EContactMergingLookup *lookup) /*we match all the string fields of the already existing contact and the new contact.*/ for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) ; field++) { dropdown_data *data = NULL; - string = (char *)e_contact_get_const (lookup->contact, field); - string1 = (char *)e_contact_get_const (lookup->match, field); + string = (gchar *)e_contact_get_const (lookup->contact, field); + string1 = (gchar *)e_contact_get_const (lookup->match, field); /*the field must exist in the new as well as the duplicate contact*/ if (string && *string) { @@ -230,7 +230,7 @@ mergeit (EContactMergingLookup *lookup) if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email < 4)) { row++; - str = (char *)e_contact_get_const (lookup->contact, field); + str = (gchar *)e_contact_get_const (lookup->contact, field); switch(num_of_email) { case 0: @@ -366,8 +366,8 @@ check_if_same (EContact *contact, EContact *match) { EContactField field; GList *email_attr_list; - int num_of_email; - char *str = NULL, *string = NULL, *string1 = NULL; + gint num_of_email; + gchar *str = NULL, *string = NULL, *string1 = NULL; for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) ; field++) { email_attr_list = e_contact_get_attributes (match, E_CONTACT_EMAIL); @@ -375,7 +375,7 @@ check_if_same (EContact *contact, EContact *match) if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email<4)) { - str = (char *)e_contact_get_const (contact, field); + str = (gchar *)e_contact_get_const (contact, field); switch(num_of_email) { case 0: @@ -395,8 +395,8 @@ check_if_same (EContact *contact, EContact *match) } } else { - string = (char *)e_contact_get_const (contact, field); - string1 = (char *)e_contact_get_const (match, field); + string = (gchar *)e_contact_get_const (contact, field); + string1 = (gchar *)e_contact_get_const (match, field); if ((string && *string) && (string1 && *string1) && (g_ascii_strcasecmp(string1,string))) return FALSE; /*if the field entry exist in either of the contacts,we'll have to give the choice and thus merge button should be sensitive*/ @@ -409,9 +409,9 @@ check_if_same (EContact *contact, EContact *match) } static void -response (GtkWidget *dialog, int response, EContactMergingLookup *lookup) +response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) { - static int merge_response; + static gint merge_response; switch (response) { case 0: @@ -437,8 +437,8 @@ static void match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure) { EContactMergingLookup *lookup = closure; - char *gladefile; - int flag; + gchar *gladefile; + gint flag; if ((gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE) { doit (lookup); diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 9482a93744..2176fc3915 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -71,7 +71,7 @@ static void free_data (EABModel *model) { if (model->data) { - int i; + gint i; for ( i = 0; i < model->data_count; i++ ) { g_object_unref (model->data[i]); @@ -153,8 +153,8 @@ addressbook_dispose(GObject *object) static void update_folder_bar_message (EABModel *model) { - int count; - char *message; + gint count; + gchar *message; count = model->data_count; @@ -179,8 +179,8 @@ create_contact(EBookView *book_view, const GList *contacts, EABModel *model) { - int old_count = model->data_count; - int length = g_list_length ((GList *)contacts); + gint old_count = model->data_count; + gint length = g_list_length ((GList *)contacts); if (model->data_count + length > model->allocated_count) { while (model->data_count + length > model->allocated_count) @@ -212,7 +212,7 @@ remove_contact(EBookView *book_view, indices = g_array_new (FALSE, FALSE, sizeof (gint)); for (l = ids; l; l = l->next) { - char *id = l->data; + gchar *id = l->data; for ( i = 0; i < model->data_count; i++) { if ( !strcmp(e_contact_get_const (model->data[i], E_CONTACT_UID), id) ) { g_object_unref (model->data[i]); @@ -236,7 +236,7 @@ modify_contact(EBookView *book_view, EABModel *model) { for ( ; contacts; contacts = contacts->next) { - int i; + gint i; for ( i = 0; i < model->data_count; i++) { if ( !strcmp(e_contact_get_const(model->data[i], E_CONTACT_UID), e_contact_get_const(E_CONTACT(contacts->data), E_CONTACT_UID)) ) { @@ -253,7 +253,7 @@ modify_contact(EBookView *book_view, static void status_message (EBookView *book_view, - char* status, + gchar * status, EABModel *model) { g_signal_emit (model, @@ -508,8 +508,8 @@ get_view (EABModel *model) if (model->book && model->query) { ESource *source; - const char *limit_str; - int limit = -1; + const gchar *limit_str; + gint limit = -1; source = e_book_get_source (model->book); @@ -552,7 +552,7 @@ get_view_idle (EABModel *model) EContact * eab_model_get_contact(EABModel *model, - int row) + gint row) { if (model->data && 0 <= row && row < model->data_count) { return e_contact_duplicate (model->data[row]); @@ -643,7 +643,7 @@ eab_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe g_value_set_object (value, eab_model->book); break; case PROP_QUERY: { - char *query_string = e_book_query_to_string (eab_model->query); + gchar *query_string = e_book_query_to_string (eab_model->query); g_value_set_string (value, query_string); break; } @@ -712,14 +712,14 @@ eab_model_force_folder_bar_message (EABModel *model) update_folder_bar_message (model); } -int +gint eab_model_contact_count (EABModel *model) { return model->data_count; } const EContact * -eab_model_contact_at (EABModel *model, int index) +eab_model_contact_at (EABModel *model, gint index) { return model->data[index]; } diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h index ae1c5f4cb2..f8b448a6be 100644 --- a/addressbook/gui/widgets/e-addressbook-model.h +++ b/addressbook/gui/widgets/e-addressbook-model.h @@ -43,15 +43,15 @@ struct _EABModel { EBookQuery *query; EBookView *book_view; - int book_view_idle_id; + gint book_view_idle_id; EContact **data; - int data_count; - int allocated_count; + gint data_count; + gint allocated_count; - int create_contact_id, remove_contact_id, modify_contact_id; - int status_message_id, writable_status_id, sequence_complete_id; - int backend_died_id; + gint create_contact_id, remove_contact_id, modify_contact_id; + gint status_message_id, writable_status_id, sequence_complete_id; + gint backend_died_id; guint search_in_progress : 1; guint editable : 1; @@ -85,7 +85,7 @@ EABModel *eab_model_new (void); /* Returns object with ref count of 1. */ EContact *eab_model_get_contact (EABModel *model, - int row); + gint row); EBook *eab_model_get_ebook (EABModel *model); void eab_model_stop (EABModel *model); @@ -93,9 +93,9 @@ gboolean eab_model_can_stop (EABModel *model); void eab_model_force_folder_bar_message (EABModel *model); -int eab_model_contact_count (EABModel *model); +gint eab_model_contact_count (EABModel *model); const EContact *eab_model_contact_at (EABModel *model, - int index); + gint index); gboolean eab_model_editable (EABModel *model); #endif /* _EAB_MODEL_H_ */ diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 237838141b..6258ed28ca 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -36,8 +36,8 @@ struct _EAddressbookReflowAdapterPrivate { gboolean loading; - int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; - int search_started_id, search_result_id; + gint create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; + gint search_started_id, search_result_id; }; #define PARENT_TYPE e_reflow_model_get_type() @@ -101,7 +101,7 @@ unlink_model(EAddressbookReflowAdapter *adapter) static int text_height (PangoLayout *layout, const gchar *text) { - int height; + gint height; pango_layout_set_text (layout, text, -1); @@ -119,7 +119,7 @@ addressbook_dispose(GObject *object) } static void -addressbook_set_width (EReflowModel *erm, int width) +addressbook_set_width (EReflowModel *erm, gint width) { } @@ -135,16 +135,16 @@ addressbook_count (EReflowModel *erm) /* This function returns the height of the minicontact in question */ static int -addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) +addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContactField field; - int count = 0; - char *string; + gint count = 0; + gchar *string; EContact *contact = (EContact*)eab_model_contact_at (priv->model, i); PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (parent)->canvas), ""); - int height; + gint height; string = e_contact_get(contact, E_CONTACT_FILE_AS); height = text_height (layout, string ? string : "") + 10.0; @@ -157,8 +157,8 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) string = e_contact_get(contact, field); if (string && *string) { - int this_height; - int field_text_height; + gint this_height; + gint field_text_height; this_height = text_height (layout, e_contact_pretty_name(field)); @@ -181,7 +181,7 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) } static int -addressbook_compare (EReflowModel *erm, int n1, int n2) +addressbook_compare (EReflowModel *erm, gint n1, gint n2) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -195,8 +195,8 @@ addressbook_compare (EReflowModel *erm, int n1, int n2) contact2 = (EContact*)eab_model_contact_at (priv->model, n2); if (contact1 && contact2) { - const char *file_as1, *file_as2; - const char *uid1, *uid2; + const gchar *file_as1, *file_as2; + const gchar *uid1, *uid2; file_as1 = e_contact_get_const (contact1, E_CONTACT_FILE_AS); file_as2 = e_contact_get_const (contact2, E_CONTACT_FILE_AS); if (file_as1 && file_as2) @@ -235,7 +235,7 @@ adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter } static GnomeCanvasItem * -addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent) +addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -259,7 +259,7 @@ addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent) } static void -addressbook_reincarnate (EReflowModel *erm, int i, GnomeCanvasItem *item) +addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -285,7 +285,7 @@ remove_contacts (EABModel *model, EAddressbookReflowAdapter *adapter) { GArray *indices = (GArray *) data; - int count = indices->len; + gint count = indices->len; if (count == 1) e_reflow_model_item_removed (E_REFLOW_MODEL (adapter), g_array_index (indices, gint, 0)); @@ -536,7 +536,7 @@ e_addressbook_reflow_adapter_new (EABModel *model) EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - int index) + gint index) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h index 88ce1a7132..14803e945c 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h @@ -59,5 +59,5 @@ EReflowModel *e_addressbook_reflow_adapter_new (EABModel * /* Returns object with ref count of 1. */ EContact *e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - int index); + gint index); #endif /* _E_ADDRESSBOOK_REFLOW_ADAPTER_H_ */ diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index 9e3dfe5f5f..59e670e772 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -33,7 +33,7 @@ struct _EAddressbookTableAdapterPrivate { EABModel *model; - int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; + gint create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; GHashTable *emails; }; @@ -104,12 +104,12 @@ addressbook_row_count (ETableModel *etc) } /* This function returns the value at a particular point in our ETableModel. */ -static void * -addressbook_value_at (ETableModel *etc, int col, int row) +static gpointer +addressbook_value_at (ETableModel *etc, gint col, gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; - const char *value; + const gchar *value; if ( col >= COLS || row >= eab_model_contact_count (priv->model) ) return NULL; @@ -117,13 +117,13 @@ addressbook_value_at (ETableModel *etc, int col, int row) value = e_contact_get_const((EContact*)eab_model_contact_at (priv->model, row), col); if (value && *value && (col == E_CONTACT_EMAIL_1 || col == E_CONTACT_EMAIL_2 || col == E_CONTACT_EMAIL_3)) { - char *val = g_hash_table_lookup (priv->emails, value); + gchar *val = g_hash_table_lookup (priv->emails, value); if (val) { /* we have this already cached, so use value from the cache */ value = val; } else { - char *name = NULL, *mail = NULL; + gchar *name = NULL, *mail = NULL; if (eab_parse_qp_email (value, &name, &mail)) val = g_strdup_printf ("%s <%s>", name, mail); @@ -138,7 +138,7 @@ addressbook_value_at (ETableModel *etc, int col, int row) } } - return (void *)(value ? value : ""); + return (gpointer)(value ? value : ""); } /* This function sets the value at a particular point in our ETableModel. */ @@ -151,7 +151,7 @@ contact_modified_cb (EBook* book, EBookStatus status, } static void -addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) +addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -169,14 +169,14 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) e_table_model_pre_change(etc); if (col == E_CONTACT_EMAIL_1 || col == E_CONTACT_EMAIL_2 || col == E_CONTACT_EMAIL_3) { - const char *old_value = e_contact_get_const (contact, col); + const gchar *old_value = e_contact_get_const (contact, col); /* remove old value from cache and use new one */ if (old_value && *old_value) g_hash_table_remove (priv->emails, old_value); } - e_contact_set(contact, col, (void *) val); + e_contact_set(contact, col, (gpointer) val); eab_merging_book_commit_contact (eab_model_get_ebook (priv->model), contact, contact_modified_cb, etc); @@ -189,7 +189,7 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) /* This function returns whether a particular cell is editable. */ static gboolean -addressbook_is_cell_editable (ETableModel *etc, int col, int row) +addressbook_is_cell_editable (ETableModel *etc, gint col, gint row) { #if 0 EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); @@ -220,13 +220,13 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; EContact *contact; - int col; + gint col; contact = e_contact_new (); for (col = 1; col < E_CONTACT_LAST_SIMPLE_STRING; col++) { - const void *val = e_table_model_value_at (source, col, row); - e_contact_set (contact, col, (void *) val); + gconstpointer val = e_table_model_value_at (source, col, row); + e_contact_set (contact, col, (gpointer) val); } eab_merging_book_add_contact (eab_model_get_ebook (priv->model), contact, NULL, NULL); @@ -235,33 +235,33 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) } /* This function duplicates the value passed to it. */ -static void * -addressbook_duplicate_value (ETableModel *etc, int col, const void *value) +static gpointer +addressbook_duplicate_value (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } /* This function frees the value passed to it. */ static void -addressbook_free_value (ETableModel *etc, int col, void *value) +addressbook_free_value (ETableModel *etc, gint col, gpointer value) { g_free(value); } -static void * -addressbook_initialize_value (ETableModel *etc, int col) +static gpointer +addressbook_initialize_value (ETableModel *etc, gint col) { return g_strdup(""); } static gboolean -addressbook_value_is_empty (ETableModel *etc, int col, const void *value) +addressbook_value_is_empty (ETableModel *etc, gint col, gconstpointer value) { - return !(value && *(char *)value); + return !(value && *(gchar *)value); } -static char * -addressbook_value_to_string (ETableModel *etc, int col, const void *value) +static gchar * +addressbook_value_to_string (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } @@ -318,7 +318,7 @@ remove_contacts (EABModel *model, EAddressbookTableAdapter *adapter) { GArray *indices = (GArray *) data; - int count = indices->len; + gint count = indices->len; /* clear whole cache */ g_hash_table_remove_all (adapter->priv->emails); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 4cd151f19f..cda5c5f27c 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -100,7 +100,7 @@ static void categories_changed_cb (gpointer object, gpointer user_data); static void make_suboptions (EABView *view); static void query_changed (ESearchBar *esb, EABView *view); static void search_activated (ESearchBar *esb, EABView *view); -static void search_menu_activated (ESearchBar *esb, int id, EABView *view); +static void search_menu_activated (ESearchBar *esb, gint id, EABView *view); static GList *get_master_list (gboolean force_rebuild); static gpointer parent_class; @@ -131,14 +131,14 @@ enum DndTargetType { typedef struct EABSearchBarItem { ESearchBarItem search; - char *image; + gchar *image; }EABSearchBarItem; static GtkTargetEntry drag_types[] = { { (gchar *) SOURCE_VCARD_TYPE, 0, DND_TARGET_TYPE_SOURCE_VCARD }, { (gchar *) VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD } }; -static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]); +static const gint num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]); static guint eab_view_signals [LAST_SIGNAL] = {0, }; @@ -412,8 +412,8 @@ eab_view_new (void) GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_AB_VIEW, NULL)); EABView *eav = EAB_VIEW (widget); FilterPart *part; - char *xmlfile; - char *userfile; + gchar *xmlfile; + gchar *userfile; /* create our model */ eav->model = eab_model_new (); @@ -543,9 +543,9 @@ init_collection (void) { GalViewFactory *factory; ETableSpecification *spec; - char *galview; - char *addressbookdir; - char *etspecfile; + gchar *galview; + gchar *addressbookdir; + gchar *etspecfile; if (collection == NULL) { collection = gal_view_collection_new(); @@ -626,7 +626,7 @@ display_view(GalViewInstance *instance, } static void -view_preview(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) +view_preview(BonoboUIComponent *uic, const gchar *path, Bonobo_UIComponent_EventType type, const gchar *state, gpointer data) { /* XXX this should use the addressbook's global gconf client */ GConfClient *gconf_client; @@ -793,7 +793,7 @@ static GList * get_contact_list (EABPopupTargetSelect *t) { GList *list = NULL; - int i; + gint i; for (i=0;i<t->cards->len;i++) list = g_list_prepend(list, t->cards->pdata[i]); @@ -802,7 +802,7 @@ get_contact_list (EABPopupTargetSelect *t) } static void -save_as (EPopup *ep, EPopupItem *pitem, void *data) +save_as (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); @@ -814,7 +814,7 @@ save_as (EPopup *ep, EPopupItem *pitem, void *data) } static void -send_as (EPopup *ep, EPopupItem *pitem, void *data) +send_as (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); @@ -826,7 +826,7 @@ send_as (EPopup *ep, EPopupItem *pitem, void *data) } static void -send_to (EPopup *ep, EPopupItem *pitem, void *data) +send_to (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); @@ -838,7 +838,7 @@ send_to (EPopup *ep, EPopupItem *pitem, void *data) } static void -print (EPopup *ep, EPopupItem *pitem, void *data) +print (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ EABPopupTargetSelect *t = (EABPopupTargetSelect *)ep->target; @@ -852,7 +852,7 @@ print (EPopup *ep, EPopupItem *pitem, void *data) } static void -copy (EPopup *ep, EPopupItem *pitem, void *data) +copy (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -860,7 +860,7 @@ copy (EPopup *ep, EPopupItem *pitem, void *data) } static void -paste (EPopup *ep, EPopupItem *pitem, void *data) +paste (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -868,7 +868,7 @@ paste (EPopup *ep, EPopupItem *pitem, void *data) } static void -cut (EPopup *ep, EPopupItem *pitem, void *data) +cut (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -876,7 +876,7 @@ cut (EPopup *ep, EPopupItem *pitem, void *data) } static void -delete (EPopup *ep, EPopupItem *pitem, void *data) +delete (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -884,7 +884,7 @@ delete (EPopup *ep, EPopupItem *pitem, void *data) } static void -copy_to_folder (EPopup *ep, EPopupItem *pitem, void *data) +copy_to_folder (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -892,7 +892,7 @@ copy_to_folder (EPopup *ep, EPopupItem *pitem, void *data) } static void -move_to_folder (EPopup *ep, EPopupItem *pitem, void *data) +move_to_folder (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -900,7 +900,7 @@ move_to_folder (EPopup *ep, EPopupItem *pitem, void *data) } static void -open_contact (EPopup *ep, EPopupItem *pitem, void *data) +open_contact (EPopup *ep, EPopupItem *pitem, gpointer data) { ContactAndBook *contact_and_book = data; @@ -909,7 +909,7 @@ open_contact (EPopup *ep, EPopupItem *pitem, void *data) static void -new_card (EPopup *ep, EPopupItem *pitem, void *data) +new_card (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ EContact *contact = e_contact_new(); @@ -919,7 +919,7 @@ new_card (EPopup *ep, EPopupItem *pitem, void *data) } static void -new_list (EPopup *ep, EPopupItem *pitem, void *data) +new_list (EPopup *ep, EPopupItem *pitem, gpointer data) { /*ContactAndBook *contact_and_book = data;*/ EContact *contact = e_contact_new (); @@ -955,7 +955,7 @@ static EPopupItem eabv_popup_items[] = { }; static void -get_card_1(gint model_row, void *data) +get_card_1(gint model_row, gpointer data) { ContactAndBook *contact_and_book = data; EContact *contact; @@ -966,7 +966,7 @@ get_card_1(gint model_row, void *data) } static void -eabv_popup_free(EPopup *ep, GSList *list, void *data) +eabv_popup_free(EPopup *ep, GSList *list, gpointer data) { ContactAndBook *cab = data; ESelectionModel *selection; @@ -987,7 +987,7 @@ do_popup_menu(EABView *view, GdkEvent *event) EABPopup *ep; EABPopupTargetSelect *t; GSList *menus = NULL; - int i; + gint i; GtkMenu *menu; GPtrArray *cards = g_ptr_array_new(); ContactAndBook *contact_and_book; @@ -1025,7 +1025,7 @@ do_popup_menu(EABView *view, GdkEvent *event) } static void -render_contact (int row, EABView *view) +render_contact (gint row, EABView *view) { EContact *contact = eab_model_get_contact (view->model, row); @@ -1099,8 +1099,8 @@ table_white_space_event(ETableScrolled *table, GdkEvent *event, EABView *view) static void table_drag_data_get (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GtkSelectionData *selection_data, guint info, @@ -1117,7 +1117,7 @@ table_drag_data_get (ETable *table, switch (info) { case DND_TARGET_TYPE_VCARD: { - char *value; + gchar *value; value = eab_contact_list_to_string (contact_list); @@ -1129,7 +1129,7 @@ table_drag_data_get (ETable *table, break; } case DND_TARGET_TYPE_SOURCE_VCARD: { - char *value; + gchar *value; value = eab_book_and_contact_list_to_string (view->book, contact_list); @@ -1221,7 +1221,7 @@ static void contacts_removed (EABModel *model, gpointer data, EABView *eav) { GArray *indices = (GArray *) data; - int count = indices->len; + gint count = indices->len; gint i; for (i = 0; i < count; i ++) { @@ -1284,7 +1284,7 @@ create_table_view (EABView *view) { ETableModel *adapter; GtkWidget *table; - char *etspecfile; + gchar *etspecfile; adapter = eab_table_adapter_new(view->model); @@ -1358,9 +1358,9 @@ static void search_activated (ESearchBar *esb, EABView *v) { GList *master_list; - char *search_word, *search_query, *view_sexp; - const char *category_name; - int search_type, subid; + gchar *search_word, *search_query, *view_sexp; + const gchar *category_name; + gint search_type, subid; g_object_get(esb, "text", &search_word, @@ -1427,7 +1427,7 @@ search_activated (ESearchBar *esb, EABView *v) } static void -search_menu_activated (ESearchBar *esb, int id, EABView *view) +search_menu_activated (ESearchBar *esb, gint id, EABView *view) { if (id == E_FILTERBAR_ADVANCED_ID) e_search_bar_set_item_id (esb, id); @@ -1436,8 +1436,8 @@ search_menu_activated (ESearchBar *esb, int id, EABView *view) static void query_changed (ESearchBar *esb, EABView *view) { - int search_type; - char *query; + gint search_type; + gchar *query; search_type = e_search_bar_get_item_id(esb); if (search_type == E_FILTERBAR_ADVANCED_ID) { @@ -1448,12 +1448,12 @@ query_changed (ESearchBar *esb, EABView *view) } static int -compare_subitems (const void *a, const void *b) +compare_subitems (gconstpointer a, gconstpointer b) { const ESearchBarItem *subitem_a = a; const ESearchBarItem *subitem_b = b; - char *collate_a, *collate_b; - int ret; + gchar *collate_a, *collate_b; + gint ret; collate_a = g_utf8_collate_key (subitem_a->text, -1); collate_b = g_utf8_collate_key (subitem_b->text, -1); @@ -1476,7 +1476,7 @@ generate_viewoption_menu (EABSearchBarItem *subitems) for (i = 0; subitems[i].search.id != -1; ++i) { if (subitems[i].search.text) { - char *str = NULL; + gchar *str = NULL; str = e_str_without_underscores (subitems[i].search.text); menu_item = gtk_image_menu_item_new_with_label (str); if (subitems[i].image) { @@ -1536,10 +1536,10 @@ make_suboptions (EABView *view) subitems[2].image = NULL; for (i=0; i<N; ++i) { - const char *category = g_list_nth_data (master_list, i); + const gchar *category = g_list_nth_data (master_list, i); subitems[i+3].search.id = i+3; subitems[i+3].search.text = g_strdup (category); - subitems[i+3].image = (char *)e_categories_get_icon_file_for (category); + subitems[i+3].image = (gchar *)e_categories_get_icon_file_for (category); } subitems[N+3].search.id = -1; @@ -1571,7 +1571,7 @@ get_master_list (gboolean force_rebuild) GList *l, *p = e_categories_get_list (); for (l = p; l; l = l->next) { - if (e_categories_is_searchable ((const char *) l->data)) + if (e_categories_is_searchable ((const gchar *) l->data)) category_list = g_list_prepend (category_list, l->data); } @@ -1756,7 +1756,7 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) ETable *etable = NULL; EMinicardView *card_view; ESelectionModel *selection_model = NULL; - char *name = NULL; + gchar *name = NULL; gint row = 0, select; list = get_selected_contacts (view); @@ -1797,7 +1797,7 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) for (l=list;l;l=g_list_next(l)) { contact = l->data; - ids = g_list_prepend (ids, (char*)e_contact_get_const (contact, E_CONTACT_UID)); + ids = g_list_prepend (ids, (gchar *)e_contact_get_const (contact, E_CONTACT_UID)); } /* Remove the cards all at once. */ @@ -1864,7 +1864,7 @@ selection_get (GtkWidget *invisible, guint time_stamp, EABView *view) { - char *value; + gchar *value; value = eab_contact_list_to_string (view->clipboard_contacts); @@ -1896,14 +1896,14 @@ selection_received (GtkWidget *invisible, } else { GList *contact_list; GList *l; - char *str = NULL; + gchar *str = NULL; if (selection_data->data [selection_data->length - 1] != 0) { str = g_malloc0 (selection_data->length + 1); memcpy (str, selection_data->data, selection_data->length); contact_list = eab_contact_list_from_string (str); } else - contact_list = eab_contact_list_from_string ((char *)selection_data->data); + contact_list = eab_contact_list_from_string ((gchar *)selection_data->data); for (l = contact_list; l; l = l->next) { EContact *contact = l->data; @@ -1919,7 +1919,7 @@ selection_received (GtkWidget *invisible, } static void -add_to_list (int model_row, gpointer closure) +add_to_list (gint model_row, gpointer closure) { GList **list = closure; *list = g_list_prepend (*list, GINT_TO_POINTER (model_row)); diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index 7f796415cd..72bafaa535 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -76,7 +76,7 @@ struct _EABView EBook *book; ESource *source; - char *query; + gchar *query; guint editable : 1; gint displayed_contact; diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index a6090291bd..52110bb169 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -40,7 +40,7 @@ static void e_minicard_label_get_property (GObject *object, guint prop_id, GVal static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_unrealize (GnomeCanvasItem *item); -static void e_minicard_label_reflow(GnomeCanvasItem *item, int flags); +static void e_minicard_label_reflow(GnomeCanvasItem *item, gint flags); static void e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style); static void e_minicard_label_resize_children( EMinicardLabel *e_minicard_label ); @@ -455,7 +455,7 @@ e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style) } static void -e_minicard_label_reflow(GnomeCanvasItem *item, int flags) +e_minicard_label_reflow(GnomeCanvasItem *item, gint flags) { EMinicardLabel *e_minicard_label = E_MINICARD_LABEL(item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 9c493afa61..a48e45ca52 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -303,7 +303,7 @@ selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) } static void -selection_row_change (ESelectionModel *esm, int row, EMinicardViewWidget *widget) +selection_row_change (ESelectionModel *esm, gint row, EMinicardViewWidget *widget) { selection_change (esm, widget); } @@ -447,7 +447,7 @@ e_minicard_view_widget_real_focus_in_event(GtkWidget *widget, GdkEventFocus *eve if (!canvas->focused_item) { EReflow *reflow = E_REFLOW (view->emv); if (reflow->count) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0); if (unsorted != -1) canvas->focused_item = reflow->items [unsorted]; diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index ff9cddac24..29b8904797 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -49,7 +49,7 @@ struct _EMinicardViewWidget EAddressbookReflowAdapter *adapter; EBook *book; - char *query; + gchar *query; guint editable : 1; double column_width; diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index b716c86c80..2e9ef12507 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -87,20 +87,20 @@ e_minicard_view_drag_data_get(GtkWidget *widget, switch (info) { case DND_TARGET_TYPE_VCARD_LIST: { - char *value; + gchar *value; value = eab_contact_list_to_string (view->drag_list); gtk_selection_data_set (selection_data, selection_data->target, 8, - (unsigned char *)value, strlen (value)); + (guchar *)value, strlen (value)); g_free (value); break; } case DND_TARGET_TYPE_SOURCE_VCARD_LIST: { EBook *book; - char *value; + gchar *value; g_object_get (view->adapter, "book", &book, NULL); value = eab_book_and_contact_list_to_string (book, view->drag_list); @@ -108,7 +108,7 @@ e_minicard_view_drag_data_get(GtkWidget *widget, gtk_selection_data_set (selection_data, selection_data->target, 8, - (unsigned char *)value, strlen (value)); + (guchar *)value, strlen (value)); g_free (value); break; } @@ -155,7 +155,7 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, static void set_empty_message (EMinicardView *view) { - char *empty_message; + gchar *empty_message; gboolean editable = FALSE, perform_initial_query = FALSE, searching = FALSE; EBook *book; @@ -417,7 +417,7 @@ static gint e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) { EMinicardView *view; - int return_val = FALSE; + gint return_val = FALSE; view = E_MINICARD_VIEW (reflow); if (parent_class->selection_event) { @@ -427,7 +427,7 @@ e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEven switch (event->type) { case GDK_FOCUS_CHANGE: if (event->focus_change.in) { - int i; + gint i; for (i = 0; i < reflow->count; i++) { if (reflow->items[i] == item) { e_selection_model_maybe_do_something(reflow->selection, i, 0, 0); @@ -456,7 +456,7 @@ typedef struct { } ViewCbClosure; static void -do_remove (int i, gpointer user_data) +do_remove (gint i, gpointer user_data) { EBook *book; EContact *contact; @@ -478,7 +478,7 @@ do_remove (int i, gpointer user_data) #if 0 static int -compare_to_utf_str (EMinicard *card, const char *utf_str) +compare_to_utf_str (EMinicard *card, const gchar *utf_str) { g_return_val_if_fail(card != NULL, 0); g_return_val_if_fail(E_IS_MINICARD(card), 0); @@ -488,7 +488,7 @@ compare_to_utf_str (EMinicard *card, const char *utf_str) } if (card->card) { - char *file_as; + gchar *file_as; g_object_get(card->card, "file_as", &file_as, NULL); @@ -621,7 +621,7 @@ e_minicard_view_jump_to_letter (EMinicardView *view, gunichar letter) { #if 0 - char uft_str[6 + 1]; + gchar uft_str[6 + 1]; utf_str [g_unichar_to_utf8 (letter, utf_str)] = '\0'; e_reflow_sorted_jump (E_REFLOW_SORTED (view), @@ -636,7 +636,7 @@ typedef struct { } ModelAndList; static void -add_to_list (int index, gpointer closure) +add_to_list (gint index, gpointer closure) { ModelAndList *mal = closure; mal->list = g_list_prepend (mal->list, e_addressbook_reflow_adapter_get_contact (mal->adapter, index)); diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 0c70b12da0..da85e5fd83 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -50,7 +50,7 @@ static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_realize (GnomeCanvasItem *item); static void e_minicard_unrealize (GnomeCanvasItem *item); -static void e_minicard_reflow ( GnomeCanvasItem *item, int flags ); +static void e_minicard_reflow ( GnomeCanvasItem *item, gint flags ); static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style); static void e_minicard_resize_children( EMinicard *e_minicard ); @@ -600,7 +600,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) break; case GDK_BUTTON_PRESS: { if (1 <= event->button.button && event->button.button <= 2) { - int ret_val = e_minicard_selected(e_minicard, event); + gint ret_val = e_minicard_selected(e_minicard, event); GdkEventMask mask = ((1 << (4 + event->button.button)) | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | @@ -619,7 +619,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) e_minicard->drag_button_down = TRUE; return ret_val; } else if (event->button.button == 3) { - int ret_val = e_minicard_selected(e_minicard, event); + gint ret_val = e_minicard_selected(e_minicard, event); if (ret_val != 0) return ret_val; } @@ -675,9 +675,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) return FALSE; } else { - int row_count = e_selection_model_row_count (reflow->selection); - int model_index = e_selection_model_cursor_row (reflow->selection); - int view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); + gint row_count = e_selection_model_row_count (reflow->selection); + gint model_index = e_selection_model_cursor_row (reflow->selection); + gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == 0) view_index = row_count-1; @@ -701,9 +701,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) return FALSE; } else { - int row_count = e_selection_model_row_count(reflow->selection); - int model_index = e_selection_model_cursor_row (reflow->selection); - int view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); + gint row_count = e_selection_model_row_count(reflow->selection); + gint model_index = e_selection_model_cursor_row (reflow->selection); + gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == row_count-1) view_index = 0; @@ -768,8 +768,8 @@ add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) GnomeCanvasItem *new_item; GnomeCanvasGroup *group; EMinicardField *minicard_field; - char *name; - char *string; + gchar *name; + gchar *string; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); group = GNOME_CANVAS_GROUP( e_minicard ); @@ -817,7 +817,7 @@ add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) } -static const char * +static const gchar * get_email_location (EVCardAttribute *attr) { gint i; @@ -831,28 +831,28 @@ get_email_location (EVCardAttribute *attr) } static void -add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, int limit, gboolean is_list) +add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, gint limit, gboolean is_list) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; EMinicardField *minicard_field; - char *name; + gchar *name; GList *l, *le; - int count =0; + gint count =0; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); group = GNOME_CANVAS_GROUP( e_minicard ); for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) { const gchar *tmp; - char *email = NULL; - char *string = NULL; - char *parsed_name = NULL; + gchar *email = NULL; + gchar *string = NULL; + gchar *parsed_name = NULL; gboolean parser_check; /* do not use name for fields in the contact list */ if (is_list) { - name = (char *)""; + name = (gchar *)""; } else { tmp = get_email_location ((EVCardAttribute *) l->data); name = g_strdup_printf ("%s:", tmp); @@ -908,7 +908,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) { gchar *name; EContactField field; - int width = -1; + gint width = -1; PangoLayout *layout; if (is_list) @@ -916,7 +916,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), ""); for(field = E_CONTACT_FULL_NAME; field != E_CONTACT_LAST_SIMPLE_STRING; field++) { - int this_width; + gint this_width; if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) continue; @@ -935,14 +935,14 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) static void remodel( EMinicard *e_minicard ) { - int count = 0; + gint count = 0; if ( !(GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED) ) return; if (e_minicard->contact) { EContactField field; GList *list; - char *file_as; - int left_width = -1; + gchar *file_as; + gint left_width = -1; gboolean is_list = FALSE; gboolean email_rendered = FALSE; @@ -985,7 +985,7 @@ remodel( EMinicard *e_minicard ) minicard_field = list->data; if (minicard_field && minicard_field->field == field) { GList *this_list = list; - char *string; + gchar *string; string = e_contact_get(e_minicard->contact, field); if (string && *string) { @@ -1000,14 +1000,14 @@ remodel( EMinicard *e_minicard ) list = g_list_delete_link(list, this_list); g_free(string); } else { - char *string; + gchar *string; if (left_width == -1) { left_width = get_left_width (e_minicard, is_list); } if (is_email) { GList *email; - int limit; + gint limit; limit = 5 - count; email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL); @@ -1035,7 +1035,7 @@ remodel( EMinicard *e_minicard ) } static void -e_minicard_reflow(GnomeCanvasItem *item, int flags) +e_minicard_reflow(GnomeCanvasItem *item, gint flags) { EMinicard *e_minicard = E_MINICARD(item); if (GTK_OBJECT_FLAGS (e_minicard) & GNOME_CANVAS_ITEM_REALIZED) { @@ -1080,7 +1080,7 @@ e_minicard_reflow(GnomeCanvasItem *item, int flags) } } -const char * +const gchar * e_minicard_get_card_id (EMinicard *minicard) { g_return_val_if_fail(minicard != NULL, NULL); @@ -1093,10 +1093,10 @@ e_minicard_get_card_id (EMinicard *minicard) } } -int +gint e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) { - int cmp = 0; + gint cmp = 0; g_return_val_if_fail(minicard1 != NULL, 0); g_return_val_if_fail(E_IS_MINICARD(minicard1), 0); @@ -1104,7 +1104,7 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) g_return_val_if_fail(E_IS_MINICARD(minicard2), 0); if (minicard1->contact && minicard2->contact) { - char *file_as1, *file_as2; + gchar *file_as1, *file_as2; g_object_get(minicard1->contact, "file_as", &file_as1, NULL); @@ -1128,7 +1128,7 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) return cmp; } -int +gint e_minicard_selected (EMinicard *minicard, GdkEvent *event) { gint ret_val = 0; diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index fb8116cb9d..9ab025185c 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -119,11 +119,11 @@ struct _EMinicardField { #define E_MINICARD_FIELD(field) ((EMinicardField *)(field)) GType e_minicard_get_type (void); -const char *e_minicard_get_card_id (EMinicard *minicard); -int e_minicard_compare (EMinicard *minicard1, +const gchar *e_minicard_get_card_id (EMinicard *minicard); +gint e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2); -int e_minicard_selected (EMinicard *minicard, +gint e_minicard_selected (EMinicard *minicard, GdkEvent *event); gboolean e_minicard_activate_editor (EMinicard *minicard); diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 32ae07862f..91056e0544 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -126,7 +126,7 @@ eab_config_get_type (void) } EABConfig * -eab_config_new (int type, const char *menuid) +eab_config_new (gint type, const gchar *menuid) { EABConfig *ecp = g_object_new (eab_config_get_type(), NULL); e_config_construct (&ecp->config, type, menuid); @@ -156,7 +156,7 @@ static const EConfigHookTargetMap ecph_targets[] = { static void ecph_class_init (EPluginHookClass *klass) { - int i; + gint i; klass->id = "org.gnome.evolution.addressbook.config:1.0"; diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 330df5141b..edc13bbb1b 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -59,7 +59,7 @@ struct _EABConfigTargetSource { typedef struct _EConfigItem EABConfigItem; GType eab_config_get_type (void); -EABConfig *eab_config_new (int type, const char *menuid); +EABConfig *eab_config_new (gint type, const gchar *menuid); EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, struct _ESource *source); diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 96050b2ca4..197a91e89c 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -45,7 +45,7 @@ struct _EABContactDisplayPrivate { EContact *contact; GtkWidget *invisible; - char *selection_uri; + gchar *selection_uri; }; static struct { @@ -78,7 +78,7 @@ common_location [] = #define MAX_COMPACT_IMAGE_DIMENSION 48 static void -eab_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data) +eab_uri_popup_link_open(EPopup *ep, EPopupItem *item, gpointer data) { EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target; @@ -87,16 +87,16 @@ eab_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data) } static void -eab_uri_popup_email_address_copy(EPopup *ep, EPopupItem *item, void *data) +eab_uri_popup_email_address_copy(EPopup *ep, EPopupItem *item, gpointer data) { EABContactDisplay *display = data; struct _EABContactDisplayPrivate *p = display->priv; EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target; - const char *url = t->uri; - char *html=NULL; - int i=0; + const gchar *url = t->uri; + gchar *html=NULL; + gint i=0; GList *email_list, *l; - int email_num = atoi (url + strlen ("internal-mailto:")); + gint email_num = atoi (url + strlen ("internal-mailto:")); email_list = e_contact_get (p->contact, E_CONTACT_EMAIL); for (l = email_list; l; l=l->next) { @@ -114,7 +114,7 @@ eab_uri_popup_email_address_copy(EPopup *ep, EPopupItem *item, void *data) } static void -eab_uri_popup_link_copy(EPopup *ep, EPopupItem *pitem, void *data) +eab_uri_popup_link_copy(EPopup *ep, EPopupItem *pitem, gpointer data) { EABContactDisplay *display = data; struct _EABContactDisplayPrivate *p = display->priv; @@ -127,14 +127,14 @@ eab_uri_popup_link_copy(EPopup *ep, EPopupItem *pitem, void *data) } static void -eab_uri_popup_address_send(EPopup *ep, EPopupItem *item, void *data) +eab_uri_popup_address_send(EPopup *ep, EPopupItem *item, gpointer data) { EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target; - const char *url = t->uri; + const gchar *url = t->uri; EABContactDisplay *display = data; struct _EABContactDisplayPrivate *p = display->priv; - int mail_num = atoi (url + strlen ("internal-mailto:")); + gint mail_num = atoi (url + strlen ("internal-mailto:")); if (mail_num == -1) return; @@ -174,7 +174,7 @@ static EPopupItem eab_uri_popups[] = { static void -eab_uri_popup_free(EPopup *ep, GSList *list, void *data) +eab_uri_popup_free(EPopup *ep, GSList *list, gpointer data) { while (list){ GSList *n = list->next; @@ -189,13 +189,13 @@ eab_uri_popup_free(EPopup *ep, GSList *list, void *data) } static int -eab_uri_popup_event(EABContactDisplay *display, GdkEvent *event, const char *uri) +eab_uri_popup_event(EABContactDisplay *display, GdkEvent *event, const gchar *uri) { EABPopup *emp; EABPopupTargetURI *t ; GtkMenu *menu; GSList *menus = NULL; - int i; + gint i; emp = eab_popup_new("org.gnome.evolution.addressbook.contactdisplay.popup"); @@ -220,7 +220,7 @@ eab_uri_popup_event(EABContactDisplay *display, GdkEvent *event, const char *uri } static void -on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, +on_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EABContactDisplay *display) { if (!strcmp (url, "internal-contact-photo:")) { @@ -230,7 +230,7 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, if (!photo) photo = e_contact_get (display->priv->contact, E_CONTACT_LOGO); - gtk_html_stream_write (handle, (char *)photo->data.inlined.data, photo->data.inlined.length); + gtk_html_stream_write (handle, (gchar *)photo->data.inlined.data, photo->data.inlined.length); gtk_html_end (html, handle, GTK_HTML_STREAM_OK); @@ -254,11 +254,11 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle, } static void -on_link_clicked (GtkHTML *html, const char *uri, EABContactDisplay *display) +on_link_clicked (GtkHTML *html, const gchar *uri, EABContactDisplay *display) { #ifdef HANDLE_MAILTO_INTERNALLY if (!strncmp (uri, "internal-mailto:", strlen ("internal-mailto:"))) { - int mail_num = atoi (uri + strlen ("internal-mailto:")); + gint mail_num = atoi (uri + strlen ("internal-mailto:")); if (mail_num == -1) return; @@ -275,14 +275,14 @@ on_link_clicked (GtkHTML *html, const char *uri, EABContactDisplay *display) #if 0 static void -render_address (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField adr_field, EContactField label_field) +render_address (GtkHTMLStream *html_stream, EContact *contact, const gchar *html_label, EContactField adr_field, EContactField label_field) { EContactAddress *adr; - const char *label; + const gchar *label; label = e_contact_get_const (contact, label_field); if (label) { - char *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); + gchar *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); gtk_html_stream_printf (html_stream, "<tr><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\"></td><td valign=\"top\" width=\"100\"><font color=" HEADER_COLOR ">%s:</font><br><a href=\"http://www.mapquest.com/\">%s</a></td><td valign=\"top\">%s</td></tr>", html_label, _("(map)"), html); @@ -312,9 +312,9 @@ This shoul g_free (html); #endif static void -render_name_value (GtkHTMLStream *html_stream, const char *label, const char *str, const char *icon, unsigned int html_flags) +render_name_value (GtkHTMLStream *html_stream, const gchar *label, const gchar *str, const gchar *icon, guint html_flags) { - char *value = e_text_to_html (str, html_flags); + gchar *value = e_text_to_html (str, html_flags); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { gtk_html_stream_printf (html_stream, "<tr><td align=\"right\" valign=\"top\">%s</td> <td align=\"right\" valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td>", value, label); @@ -334,9 +334,9 @@ render_name_value (GtkHTMLStream *html_stream, const char *label, const char *st } static void -render_attribute (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +render_attribute (GtkHTMLStream *html_stream, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { - const char *str; + const gchar *str; str = e_contact_get_const (contact, field); @@ -346,15 +346,15 @@ render_attribute (GtkHTMLStream *html_stream, EContact *contact, const char *htm } static void -accum_address (GString *gstr, EContact *contact, const char *html_label, EContactField adr_field, EContactField label_field) +accum_address (GString *gstr, EContact *contact, const gchar *html_label, EContactField adr_field, EContactField label_field) { EContactAddress *adr; - const char *label; + const gchar *label; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); label = e_contact_get_const (contact, label_field); if (label) { - char *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); + gchar *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); #ifdef mapping_works if (is_rtl) @@ -399,9 +399,9 @@ accum_address (GString *gstr, EContact *contact, const char *html_label, EContac } static void -accum_name_value (GString *gstr, const char *label, const char *str, const char *icon, unsigned int html_flags) +accum_name_value (GString *gstr, const gchar *label, const gchar *str, const gchar *icon, guint html_flags) { - char *value = e_text_to_html (str, html_flags); + gchar *value = e_text_to_html (str, html_flags); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { g_string_append_printf (gstr, "<tr><td valign=\"top\" align=\"right\">%s</td> <td align=\"right\" valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td>", value, label); @@ -422,9 +422,9 @@ accum_name_value (GString *gstr, const char *label, const char *str, const char static void -accum_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { - const char *str; + const gchar *str; str = e_contact_get_const (contact, field); @@ -434,11 +434,11 @@ accum_attribute (GString *gstr, EContact *contact, const char *html_label, ECont } static void -accum_time_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_time_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { EContactDate *date; GDate *gdate = NULL; - char sdate[100]; + gchar sdate[100]; date = e_contact_get (contact, field); if (date) { @@ -453,13 +453,13 @@ accum_time_attribute (GString *gstr, EContact *contact, const char *html_label, } static void -accum_multival_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_multival_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { GList *val_list, *l; val_list = e_contact_get (contact, field); for (l = val_list; l; l = l->next) { - const char *str = (const char *) l->data; + const gchar *str = (const gchar *) l->data; accum_name_value (gstr, html_label, str, icon, html_flags); } g_list_foreach (val_list, (GFunc) g_free, NULL); @@ -495,7 +495,7 @@ render_contact_list (GtkHTMLStream *html_stream, EContact *contact) } static void -start_block (GtkHTMLStream *html_stream, const char *label) +start_block (GtkHTMLStream *html_stream, const gchar *label) { gtk_html_stream_printf (html_stream, "<tr><td height=\"20\" colspan=\"3\"><font color=" HEADER_COLOR "><b>%s</b></font></td></tr>", label); } @@ -506,7 +506,7 @@ end_block (GtkHTMLStream *html_stream) gtk_html_stream_printf (html_stream, "<tr><td height=\"20\"> </td></tr>"); } -static const char * +static const gchar * get_email_location (EVCardAttribute *attr) { gint i; @@ -526,10 +526,10 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) GList *email_list, *l, *email_attr_list, *al; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); #ifdef HANDLE_MAILTO_INTERNALLY - int email_num = 0; + gint email_num = 0; #endif const gchar *nl; - char *nick=NULL; + gchar *nick=NULL; gtk_html_stream_printf (html_stream, "<table border=\"0\">"); @@ -542,8 +542,8 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) email_attr_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); for (l = email_list, al=email_attr_list; l && al; l = l->next, al = al->next) { - char *html = NULL, *name = NULL, *mail = NULL; - char *attr_str = (char *)get_email_location ((EVCardAttribute *) al->data); + gchar *html = NULL, *name = NULL, *mail = NULL; + gchar *attr_str = (gchar *)get_email_location ((EVCardAttribute *) al->data); #ifdef HANDLE_MAILTO_INTERNALLY if (!eab_parse_qp_email (l->data, &name, &mail)) @@ -681,8 +681,8 @@ eab_contact_display_render_normal (EABContactDisplay *display, EContact *contact gtk_html_stream_printf (html_stream, "<body><table width=\"100%%\"><tr><td %s>\n", is_rtl ? " align=\"right\" " : ""); if (contact) { - const char *str; - char *html; + const gchar *str; + gchar *html; EContactPhoto *photo; gtk_html_stream_printf (html_stream, "<table cellspacing=\"20\" border=\"0\"><td %s valign=\"top\">", is_rtl ? " align=\"right\" " : ""); @@ -741,8 +741,8 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac gtk_html_stream_write (html_stream, "<body>\n", 7); if (contact) { - const char *str; - char *html; + const gchar *str; + gchar *html; EContactPhoto *photo; guint bg_frame = 0x000000, bg_body = 0xEEEEEE; GtkStyle *style; @@ -776,7 +776,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac if (!photo) photo = e_contact_get (contact, E_CONTACT_LOGO); if (photo) { - int calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION; + gint calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION; GdkPixbufLoader *loader = gdk_pixbuf_loader_new (); GdkPixbuf *pixbuf; @@ -791,7 +791,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac g_object_ref (pixbuf); g_object_unref (loader); if (pixbuf) { - int max_dimension; + gint max_dimension; calced_width = gdk_pixbuf_get_width (pixbuf); calced_height = gdk_pixbuf_get_height (pixbuf); @@ -926,7 +926,7 @@ eab_contact_display_render (EABContactDisplay *display, EContact *contact, static int eab_html_press_event (GtkWidget *widget, GdkEvent *event,EABContactDisplay *display) { - char *uri; + gchar *uri; gboolean res = FALSE; 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; diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h index b5129d1637..f29f2292f8 100644 --- a/addressbook/gui/widgets/eab-gui-util.h +++ b/addressbook/gui/widgets/eab-gui-util.h @@ -56,11 +56,11 @@ void eab_transfer_contacts (EBook *source, gboolean delete_from_source, GtkWindow *parent_window); -void eab_contact_save (char *title, +void eab_contact_save (gchar *title, EContact *contact, GtkWindow *parent_window); -void eab_contact_list_save (char *title, +void eab_contact_list_save (gchar *title, GList *list, GtkWindow *parent_window); @@ -70,7 +70,7 @@ typedef enum { } EABDisposition; void eab_send_contact (EContact *contact, - int email_num, + gint email_num, EABDisposition disposition); void eab_send_contact_list (GList *contacts, EABDisposition disposition); @@ -83,7 +83,7 @@ ESource *eab_select_source (const gchar *title, const gch /* To parse quoted printable address & return email & name fields */ gboolean eab_parse_qp_email (const gchar *string, gchar **name, gchar **email); -char *eab_parse_qp_email_to_html (const gchar *string); +gchar *eab_parse_qp_email_to_html (const gchar *string); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-menu.c b/addressbook/gui/widgets/eab-menu.c index e07489b003..e26e621437 100644 --- a/addressbook/gui/widgets/eab-menu.c +++ b/addressbook/gui/widgets/eab-menu.c @@ -33,7 +33,7 @@ #include "eab-menu.h" -static void eabm_standard_menu_factory(EMenu *emp, void *data); +static void eabm_standard_menu_factory(EMenu *emp, gpointer data); static GObjectClass *eabm_parent; @@ -55,7 +55,7 @@ eabm_target_free(EMenu *ep, EMenuTarget *t) switch (t->type) { case EAB_MENU_TARGET_SELECT: { EABMenuTargetSelect *s = (EABMenuTargetSelect *)t; - int i; + gint i; for (i=0;i<s->cards->len;i++) g_object_unref(s->cards->pdata[i]); @@ -98,7 +98,7 @@ eab_menu_get_type(void) return type; } -EABMenu *eab_menu_new(const char *menuid) +EABMenu *eab_menu_new(const gchar *menuid) { EABMenu *emp = g_object_new(eab_menu_get_type(), NULL); @@ -119,11 +119,11 @@ EABMenu *eab_menu_new(const char *menuid) * Return value: **/ EABMenuTargetSelect * -eab_menu_target_new_select(EABMenu *eabp, struct _EBook *book, int readonly, GPtrArray *cards) +eab_menu_target_new_select(EABMenu *eabp, struct _EBook *book, gint readonly, GPtrArray *cards) { EABMenuTargetSelect *t = e_menu_target_new(&eabp->menu, EAB_MENU_TARGET_SELECT, sizeof(*t)); guint32 mask = ~0; - int has_email = FALSE, i; + gint has_email = FALSE, i; /* FIXME: duplicated in eab-popup.c */ @@ -166,7 +166,7 @@ eab_menu_target_new_select(EABMenu *eabp, struct _EBook *book, int readonly, GPt } static void -eabm_standard_menu_factory(EMenu *emp, void *data) +eabm_standard_menu_factory(EMenu *emp, gpointer data) { /* noop */ } @@ -199,7 +199,7 @@ eabm_standard_menu_factory(EMenu *emp, void *data) */ -static void *eabmph_parent_class; +static gpointer eabmph_parent_class; #define eabmph ((EABMenuHook *)eph) static const EMenuHookTargetMask eabmph_select_masks[] = { @@ -227,7 +227,7 @@ eabmph_finalise(GObject *o) static void eabmph_class_init(EPluginHookClass *klass) { - int i; + gint i; ((GObjectClass *)klass)->finalize = eabmph_finalise; ((EPluginHookClass *)klass)->id = "org.gnome.evolution.addressbook.bonobomenu:1.0"; diff --git a/addressbook/gui/widgets/eab-menu.h b/addressbook/gui/widgets/eab-menu.h index 7bea32efa4..53e2e88b25 100644 --- a/addressbook/gui/widgets/eab-menu.h +++ b/addressbook/gui/widgets/eab-menu.h @@ -84,9 +84,9 @@ struct _EABMenuClass { GType eab_menu_get_type(void); -EABMenu *eab_menu_new(const char *menuid); +EABMenu *eab_menu_new(const gchar *menuid); -EABMenuTargetSelect *eab_menu_target_new_select(EABMenu *eabp, struct _EBook *book, int readonly, GPtrArray *cards); +EABMenuTargetSelect *eab_menu_target_new_select(EABMenu *eabp, struct _EBook *book, gint readonly, GPtrArray *cards); /* ********************************************************************** */ diff --git a/addressbook/gui/widgets/eab-popup-control.c b/addressbook/gui/widgets/eab-popup-control.c index d520108db4..e56b816af2 100644 --- a/addressbook/gui/widgets/eab-popup-control.c +++ b/addressbook/gui/widgets/eab-popup-control.c @@ -316,7 +316,7 @@ eab_popup_new (void) } static void -emit_event (EABPopupControl *pop, const char *event) +emit_event (EABPopupControl *pop, const gchar *event) { if (pop->es) { BonoboArg *arg; diff --git a/addressbook/gui/widgets/eab-popup.c b/addressbook/gui/widgets/eab-popup.c index 1b5cde4b5c..2957c483a6 100644 --- a/addressbook/gui/widgets/eab-popup.c +++ b/addressbook/gui/widgets/eab-popup.c @@ -53,7 +53,7 @@ eabp_target_free(EPopup *ep, EPopupTarget *t) switch (t->type) { case EAB_POPUP_TARGET_SELECT: { EABPopupTargetSelect *s = (EABPopupTargetSelect *)t; - int i; + gint i; for (i=0;i<s->cards->len;i++) g_object_unref(s->cards->pdata[i]); @@ -115,7 +115,7 @@ eab_popup_get_type(void) return type; } -EABPopup *eab_popup_new(const char *menuid) +EABPopup *eab_popup_new(const gchar *menuid) { EABPopup *eabp = g_object_new(eab_popup_get_type(), NULL); @@ -138,7 +138,7 @@ EABPopup *eab_popup_new(const char *menuid) EABPopupTargetURI * -eab_popup_target_new_uri(EABPopup *emp, const char *uri) +eab_popup_target_new_uri(EABPopup *emp, const gchar *uri) { EABPopupTargetURI *t = e_popup_target_new(&emp->popup, EAB_POPUP_TARGET_URI, sizeof(*t)); guint32 mask = ~0; @@ -162,11 +162,11 @@ eab_popup_target_new_uri(EABPopup *emp, const char *uri) EABPopupTargetSelect * -eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, int readonly, GPtrArray *cards) +eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, gint readonly, GPtrArray *cards) { EABPopupTargetSelect *t = e_popup_target_new(&eabp->popup, EAB_POPUP_TARGET_SELECT, sizeof(*t)); guint32 mask = ~0; - int has_email = FALSE, i; + gint has_email = FALSE, i; /* FIXME: duplicated in eab-menu.c */ @@ -219,7 +219,7 @@ eab_popup_target_new_source(EABPopup *eabp, ESourceSelector *selector) { EABPopupTargetSource *t = e_popup_target_new(&eabp->popup, EAB_POPUP_TARGET_SOURCE, sizeof(*t)); guint32 mask = ~0; - const char *source_uri; + const gchar *source_uri; ESource *source; /* TODO: this is duplicated for calendar and tasks too */ @@ -247,7 +247,7 @@ eab_popup_target_new_source(EABPopup *eabp, ESourceSelector *selector) #ifdef ADAPTED_TO_E_NAME_SELECTOR EABPopupTargetSelectNames * -eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, int row) +eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, gint row) { EABPopupTargetSelectNames *t = e_popup_target_new(&eabp->popup, EAB_POPUP_TARGET_SELECT_NAMES, sizeof(*t)); @@ -290,7 +290,7 @@ eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *mod */ -static void *eabph_parent_class; +static gpointer eabph_parent_class; #define eabph ((EABPopupHook *)eph) static const EPopupHookTargetMask eabph_select_masks[] = { @@ -338,7 +338,7 @@ eabph_finalise(GObject *o) static void eabph_class_init(EPluginHookClass *klass) { - int i; + gint i; ((GObjectClass *)klass)->finalize = eabph_finalise; ((EPluginHookClass *)klass)->id = "org.gnome.evolution.addressbook.popup:1.0"; diff --git a/addressbook/gui/widgets/eab-popup.h b/addressbook/gui/widgets/eab-popup.h index 86deff7f9c..2be355cf25 100644 --- a/addressbook/gui/widgets/eab-popup.h +++ b/addressbook/gui/widgets/eab-popup.h @@ -114,7 +114,7 @@ struct _EABPopupTargetSelect { struct _EABPopupTargetURI { EPopupTarget target; - char *uri; + gchar *uri; }; /** @@ -147,7 +147,7 @@ struct _EABPopupTargetSelectNames { EPopupTarget target; struct _ESelectNamesModel *model; - int row; + gint row; }; #endif @@ -167,15 +167,15 @@ struct _EABPopupClass { GType eab_popup_get_type(void); -EABPopup *eab_popup_new(const char *menuid); +EABPopup *eab_popup_new(const gchar *menuid); -EABPopupTargetSelect *eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, int readonly, GPtrArray *cards); -EABPopupTargetURI *eab_popup_target_new_uri(EABPopup *emp, const char *uri); +EABPopupTargetSelect *eab_popup_target_new_select(EABPopup *eabp, struct _EBook *book, gint readonly, GPtrArray *cards); +EABPopupTargetURI *eab_popup_target_new_uri(EABPopup *emp, const gchar *uri); EABPopupTargetSource *eab_popup_target_new_source(EABPopup *eabp, struct _ESourceSelector *selector); #ifdef ADAPTED_TO_E_NAME_SELECTOR -EABPopupTargetSelectNames *eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, int row); +EABPopupTargetSelectNames *eab_popup_target_new_select_names(EABPopup *eabp, struct _ESelectNamesModel *model, gint row); #endif diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c index 0240dddb60..2e9accaeac 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.c +++ b/addressbook/gui/widgets/gal-view-factory-minicard.c @@ -31,7 +31,7 @@ G_DEFINE_TYPE (GalViewFactoryMinicard, gal_view_factory_minicard, GAL_VIEW_FACTORY_TYPE) -static const char * +static const gchar * gal_view_factory_minicard_get_title (GalViewFactory *factory) { return _("Card View"); @@ -39,12 +39,12 @@ gal_view_factory_minicard_get_title (GalViewFactory *factory) static GalView * gal_view_factory_minicard_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { return gal_view_minicard_new(name); } -static const char * +static const gchar * gal_view_factory_minicard_get_type_code (GalViewFactory *factory) { return "minicard"; diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 0a2fac9262..ae9b916e54 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -40,34 +40,34 @@ static GalViewClass *gal_view_minicard_parent_class; static void gal_view_minicard_load (GalView *view, - const char *filename) + const gchar *filename) { xmlDoc *doc; doc = e_xml_parse_file (filename); if (doc) { xmlNode *root = xmlDocGetRootElement(doc); - GAL_VIEW_MINICARD (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, (const unsigned char *)"column_width", 150); + GAL_VIEW_MINICARD (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, (const guchar *)"column_width", 150); xmlFreeDoc(doc); } } static void gal_view_minicard_save (GalView *view, - const char *filename) + const gchar *filename) { xmlDoc *doc; xmlNode *root; - doc = xmlNewDoc((const unsigned char *)"1.0"); - root = xmlNewNode (NULL, (const unsigned char *)"EMinicardViewState"); - e_xml_set_double_prop_by_name (root, (const unsigned char *)"column_width", GAL_VIEW_MINICARD (view)->column_width); + doc = xmlNewDoc((const guchar *)"1.0"); + root = xmlNewNode (NULL, (const guchar *)"EMinicardViewState"); + e_xml_set_double_prop_by_name (root, (const guchar *)"column_width", GAL_VIEW_MINICARD (view)->column_width); xmlDocSetRootElement(doc, root); e_xml_save_file (filename, doc); xmlFreeDoc(doc); } -static const char * +static const gchar * gal_view_minicard_get_title (GalView *view) { return GAL_VIEW_MINICARD(view)->title; @@ -75,13 +75,13 @@ gal_view_minicard_get_title (GalView *view) static void gal_view_minicard_set_title (GalView *view, - const char *title) + const gchar *title) { g_free(GAL_VIEW_MINICARD(view)->title); GAL_VIEW_MINICARD(view)->title = g_strdup(title); } -static const char * +static const gchar * gal_view_minicard_get_type_code (GalView *view) { return "minicard"; diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h index cf3faaec56..f5681fcca5 100644 --- a/addressbook/gui/widgets/gal-view-minicard.h +++ b/addressbook/gui/widgets/gal-view-minicard.h @@ -38,7 +38,7 @@ typedef struct { GalView base; - char *title; + gchar *title; double column_width; EMinicardViewWidget *emvw; diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 164f9f5fe2..0456f81b19 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -53,7 +53,7 @@ typedef struct { guint idle_id; - int state; + gint state; FILE *file; gulong size; gint count; @@ -63,7 +63,7 @@ typedef struct { } CSVImporter; static gint importer; -static char delimiter; +static gchar delimiter; static void csv_import_done(CSVImporter *gci); @@ -85,7 +85,7 @@ typedef struct { #define FLAG_BIRTH_MONTH 0x50 #define FLAG_DATE_ANNIVERSARY 0x30 #define FLAG_INVALID 0xff - int flags; + gint flags; }import_fields; static import_fields csv_fields_outlook[] = { @@ -263,7 +263,7 @@ static import_fields csv_fields_evolution[] = { }; static void -add_to_notes(EContact *contact, gint i, char *val) { +add_to_notes(EContact *contact, gint i, gchar *val) { const gchar *old_text; const gchar *field_text = NULL; GString *new_text; @@ -296,12 +296,12 @@ add_to_notes(EContact *contact, gint i, char *val) { /* @str: a date string in the format MM-DD-YYYY or MMDDYYYY */ static EContactDate* -date_from_string (const char *str) +date_from_string (const gchar *str) { EContactDate* date; - int length; - char *t; - int i = 0; + gint length; + gchar *t; + gint i = 0; g_return_val_if_fail (str != NULL, NULL); @@ -335,13 +335,13 @@ date_from_string (const char *str) } static gboolean -parseLine (CSVImporter *gci, EContact *contact, char *buf) { +parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { - char *ptr = buf, *do_free = NULL; + gchar *ptr = buf, *do_free = NULL; GString *value; gint i = 0; - int flags = 0; - int contact_field; + gint flags = 0; + gint contact_field; EContactAddress *home_address = NULL, *work_address = NULL, *other_address = NULL; EContactDate *bday = NULL; GString *home_street, *work_street, *other_street; @@ -554,8 +554,8 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { EContact *contact = NULL; GString *line; GString *str; - char *buf; - char c; + gchar *buf; + gchar c; /* if(!fgets(line, sizeof(line),f)) @@ -642,7 +642,7 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { } static gboolean -csv_import_contacts(void *d) { +csv_import_contacts(gpointer d) { CSVImporter *gci = d; EContact *contact = NULL; @@ -711,8 +711,8 @@ static const gchar *supported_extensions[4] = { static gboolean csv_supported(EImport *ei, EImportTarget *target, EImportImporter *im) { - char *ext; - int i; + gchar *ext; + gint i; EImportTargetURI *s; if (target->type != E_IMPORT_TARGET_URI) diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 75f30a2359..544bb485fb 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -58,7 +58,7 @@ typedef struct { GHashTable *dn_contact_hash; - int state; /* 0 - initial scan, 1 - list cards, 2 - cancelled/complete */ + gint state; /* 0 - initial scan, 1 - list cards, 2 - cancelled/complete */ FILE *file; gulong size; @@ -79,7 +79,7 @@ static struct { #define FLAG_WORK_ADDRESS 0x02 #define FLAG_LIST 0x04 #define FLAG_BOOLEAN 0x08 - int flags; + gint flags; } ldif_fields[] = { { "cn", E_CONTACT_FULL_NAME }, @@ -128,13 +128,13 @@ ldif_fields[] = { { "nsAIMid", E_CONTACT_IM_AIM, FLAG_LIST }, { "mozilla_AimScreenName", E_CONTACT_IM_AIM, FLAG_LIST } }; -static int num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]); +static gint num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]); static GString * -getValue( char **src ) +getValue( gchar **src ) { GString *dest = g_string_new(""); - char *s = *src; + gchar *s = *src; gboolean need_base64 = (*s == ':'); copy_line: @@ -167,7 +167,7 @@ getValue( char **src ) } static void -populate_contact_address (EContactAddress *address, char *attr, char *value) +populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) { if (!g_ascii_strcasecmp (attr, "locality") || !g_ascii_strcasecmp (attr, "l") || @@ -188,7 +188,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) else if (!g_ascii_strcasecmp (attr, "mozillaPostalAddress2") || !g_ascii_strcasecmp (attr, "mozillaHomePostalAddress2")) { if (address->ext && *address->ext) { - char *temp = g_strdup (address->ext); + gchar *temp = g_strdup (address->ext); g_free (address->ext); address->ext = g_strconcat (temp, ",\n", value, NULL); g_free (temp); @@ -199,7 +199,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) } else if (!g_ascii_strcasecmp (attr, "postalAddress") || !g_ascii_strcasecmp (attr, "homepostalAddress")) { - char *c, *i, *addr_field; + gchar *c, *i, *addr_field; addr_field = g_strdup (value); i = addr_field; @@ -210,7 +210,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) } } if (address->ext && *address->ext) { - char *temp = g_strdup (address->ext); + gchar *temp = g_strdup (address->ext); g_free (address->ext); address->ext = g_strconcat (addr_field, ",\n", temp, NULL); g_free (temp); @@ -225,10 +225,10 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) static gboolean parseLine (LDIFImporter *gci, EContact *contact, EContactAddress *work_address, EContactAddress *home_address, - char **buf) + gchar **buf) { - char *ptr; - char *colon, *value; + gchar *ptr; + gchar *colon, *value; gboolean field_handled; GString *ldif_value; @@ -256,9 +256,9 @@ parseLine (LDIFImporter *gci, EContact *contact, return FALSE; } - colon = (char *)strchr( ptr, ':' ); + colon = (gchar *)strchr( ptr, ':' ); if (colon) { - int i; + gint i; *colon = 0; value = colon + 1; @@ -345,8 +345,8 @@ getNextLDIFEntry(LDIFImporter *gci, FILE *f ) EContact *contact; EContactAddress *work_address, *home_address; GString *str; - char line[1024]; - char *buf; + gchar line[1024]; + gchar *buf; str = g_string_new (""); /* read from the file until we get to a blank line (or eof) */ @@ -402,7 +402,7 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) { GList *email, *l; GList *email_attrs = NULL; - char *full_name; + gchar *full_name; /* set file_as to full_name so we don't later try and figure out a first/last name for the list. */ @@ -415,7 +415,7 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) email = e_contact_get (contact, E_CONTACT_EMAIL); for (l = email; l; l = l->next) { /* mozilla stuffs dn's in the EMAIL list for contact lists */ - char *dn = l->data; + gchar *dn = l->data; EContact *dn_contact = g_hash_table_lookup (gci->dn_contact_hash, dn); /* break list chains here, since we don't support them just yet */ @@ -467,12 +467,12 @@ add_to_notes (EContact *contact, EContactField field) } static gboolean -ldif_import_contacts(void *d) +ldif_import_contacts(gpointer d) { LDIFImporter *gci = d; EContact *contact; GSList *iter; - int count = 0; + gint count = 0; /* We process all normal cards immediately and keep the list ones till the end */ @@ -563,8 +563,8 @@ static const gchar *supported_extensions[2] = { static gboolean ldif_supported(EImport *ei, EImportTarget *target, EImportImporter *im) { - char *ext; - int i; + gchar *ext; + gint i; EImportTargetURI *s; if (target->type != E_IMPORT_TARGET_URI) diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 1ec623d098..169c6413d1 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -51,9 +51,9 @@ typedef struct { guint idle_id; - int state; /* 0 - importing, 1 - cancelled/complete */ - int total; - int count; + gint state; /* 0 - importing, 1 - cancelled/complete */ + gint total; + gint count; ESource *primary; @@ -115,8 +115,8 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) GList *v = e_vcard_attribute_get_values (a); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { - EDestination *dest = e_destination_import ((char*)v->data); + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { + EDestination *dest = e_destination_import ((gchar *)v->data); e_destination_export_to_vcard_attribute (dest, a); @@ -155,9 +155,9 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) vs = e_vcard_attribute_param_get_values (p); for (v = vs; v; v = v->next) { - if (!g_ascii_strcasecmp ((char*)v->data, "WORK") || - !g_ascii_strcasecmp ((char*)v->data, "HOME") || - !g_ascii_strcasecmp ((char*)v->data, "OTHER")) + if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") || + !g_ascii_strcasecmp ((gchar *)v->data, "HOME") || + !g_ascii_strcasecmp ((gchar *)v->data, "OTHER")) no_location = FALSE; else location_only = FALSE; @@ -204,8 +204,8 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) vs = e_vcard_attribute_param_get_values (p); for (v = vs; v; v = v->next) { - if (!g_ascii_strcasecmp ((char*)v->data, "WORK") || - !g_ascii_strcasecmp ((char*)v->data, "HOME")) + if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") || + !g_ascii_strcasecmp ((gchar *)v->data, "HOME")) no_location = FALSE; } } @@ -228,10 +228,10 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) } static gboolean -vcard_import_contacts(void *data) +vcard_import_contacts(gpointer data) { VCardImporter *gci = data; - int count = 0; + gint count = 0; GList *iterator = gci->iterator; if (gci->state == 0) { @@ -319,11 +319,11 @@ typedef enum _VCardEncoding VCardEncoding; /* Actually check the contents of this file */ static VCardEncoding -guess_vcard_encoding (const char *filename) +guess_vcard_encoding (const gchar *filename) { FILE *handle; - char line[4096]; - char *line_utf8; + gchar line[4096]; + gchar *line_utf8; VCardEncoding encoding = VCARD_ENCODING_NONE; handle = g_fopen (filename, "r"); @@ -455,7 +455,7 @@ static void vcard_import(EImport *ei, EImportTarget *target, EImportImporter *im) { VCardImporter *gci; - char *contents; + gchar *contents; VCardEncoding encoding; EBook *book; EImportTargetURI *s = (EImportTargetURI *)target; diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index cc3affeb2c..e57e5d175e 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -225,9 +225,9 @@ e_contact_start_new_page (EContactPrintContext *ctxt) static void e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt) { - char *file_as; + gchar *file_as; cairo_t *cr; - int field; + gint field; cr = gtk_print_context_get_cairo_context (ctxt->context); cairo_save(cr); @@ -444,70 +444,70 @@ e_contact_build_style (EContactPrintStyle *style) xmlNodePtr stylenode = xmlDocGetRootElement(styledoc); xmlNodePtr node; for (node = stylenode->children; node; node = node->next) { - char *data = (char *)xmlNodeGetContent ( node ); - if ( !strcmp( (char *)node->name, "title" ) ) { + gchar *data = (gchar *)xmlNodeGetContent ( node ); + if ( !strcmp( (gchar *)node->name, "title" ) ) { get_string(data, &(style->title)); - } else if ( !strcmp( (char *)node->name, "type" ) ) { + } else if ( !strcmp( (gchar *)node->name, "type" ) ) { if (g_ascii_strcasecmp (data, "cards") == 0) style->type = E_CONTACT_PRINT_TYPE_CARDS; else if (g_ascii_strcasecmp (data, "memo_style") == 0) style->type = E_CONTACT_PRINT_TYPE_MEMO_STYLE; else if (g_ascii_strcasecmp (data, "phone_list") == 0) style->type = E_CONTACT_PRINT_TYPE_PHONE_LIST; - } else if ( !strcmp( (char *)node->name, "sections_start_new_page" ) ) { + } else if ( !strcmp( (gchar *)node->name, "sections_start_new_page" ) ) { style->sections_start_new_page = get_bool(data); - } else if ( !strcmp( (char *)node->name, "num_columns" ) ) { + } else if ( !strcmp( (gchar *)node->name, "num_columns" ) ) { style->num_columns = get_integer(data); - } else if ( !strcmp( (char *)node->name, "blank_forms" ) ) { + } else if ( !strcmp( (gchar *)node->name, "blank_forms" ) ) { style->blank_forms = get_integer(data); - } else if ( !strcmp( (char *)node->name, "letter_headings" ) ) { + } else if ( !strcmp( (gchar *)node->name, "letter_headings" ) ) { style->letter_headings = get_bool(data); - } else if ( !strcmp( (char *)node->name, "headings_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "headings_font" ) ) { get_font( data, &(style->headings_font) ); - } else if ( !strcmp( (char *)node->name, "body_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "body_font" ) ) { get_font( data, &(style->body_font) ); - } else if ( !strcmp( (char *)node->name, "print_using_grey" ) ) { + } else if ( !strcmp( (gchar *)node->name, "print_using_grey" ) ) { style->print_using_grey = get_bool(data); - } else if ( !strcmp( (char *)node->name, "paper_width" ) ) { + } else if ( !strcmp( (gchar *)node->name, "paper_width" ) ) { style->paper_width = get_float(data); - } else if ( !strcmp( (char *)node->name, "paper_height" ) ) { + } else if ( !strcmp( (gchar *)node->name, "paper_height" ) ) { style->paper_height = get_float(data); - } else if ( !strcmp( (char *)node->name, "top_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "top_margin" ) ) { style->top_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "left_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_margin" ) ) { style->left_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "bottom_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "bottom_margin" ) ) { style->bottom_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "right_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_margin" ) ) { style->right_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "page_width" ) ) { + } else if ( !strcmp( (gchar *)node->name, "page_width" ) ) { style->page_width = get_float(data); - } else if ( !strcmp( (char *)node->name, "page_height" ) ) { + } else if ( !strcmp( (gchar *)node->name, "page_height" ) ) { style->page_height = get_float(data); - } else if ( !strcmp( (char *)node->name, "orientation" ) ) { + } else if ( !strcmp( (gchar *)node->name, "orientation" ) ) { if ( data ) { style->orientation_portrait = (g_ascii_strcasecmp (data, "landscape") != 0); } else { style->orientation_portrait = TRUE; } - } else if ( !strcmp( (char *)node->name, "header_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "header_font" ) ) { get_font( data, &(style->header_font) ); - } else if ( !strcmp( (char *)node->name, "left_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_header" ) ) { get_string(data, &(style->left_header)); - } else if ( !strcmp( (char *)node->name, "center_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "center_header" ) ) { get_string(data, &(style->center_header)); - } else if ( !strcmp( (char *)node->name, "right_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_header" ) ) { get_string(data, &(style->right_header)); - } else if ( !strcmp( (char *)node->name, "footer_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "footer_font" ) ) { get_font( data, &(style->footer_font) ); - } else if ( !strcmp( (char *)node->name, "left_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_footer" ) ) { get_string(data, &(style->left_footer)); - } else if ( !strcmp( (char *)node->name, "center_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "center_footer" ) ) { get_string(data, &(style->center_footer)); - } else if ( !strcmp( (char *)node->name, "right_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_footer" ) ) { get_string(data, &(style->right_footer)); - } else if ( !strcmp( (char *)node->name, "reverse_on_even_pages" ) ) { + } else if ( !strcmp( (gchar *)node->name, "reverse_on_even_pages" ) ) { style->reverse_on_even_pages = get_bool(data); } if ( data ) diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c index c38d2129a0..58ff940f03 100644 --- a/addressbook/printing/test-print.c +++ b/addressbook/printing/test-print.c @@ -27,8 +27,8 @@ #include <glade/glade.h> #include "e-contact-print.h" -int -main (int argc, char *argv[]) +gint +main (gint argc, gchar *argv[]) { GList *shown_fields = NULL; diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c index 72fa8a07e3..2b418345ae 100644 --- a/addressbook/tools/evolution-addressbook-export-list-cards.c +++ b/addressbook/tools/evolution-addressbook-export-list-cards.c @@ -242,7 +242,7 @@ gchar *e_contact_get_csv (EContact * contact, GSList * csv_all_fields); gchar *delivery_address_get_sub_field (const EContactAddress * delivery_address, DeliveryAddressField sub_field); gchar *check_null_pointer (gchar * orig); gchar *escape_string (gchar * orig); -int output_n_cards_file (FILE * outputfile, GList *contacts, int size, int begin_no, CARD_FORMAT format); +gint output_n_cards_file (FILE * outputfile, GList *contacts, gint size, gint begin_no, CARD_FORMAT format); static void fork_to_background (void); void set_pre_defined_field (GSList ** pre_defined_fields); @@ -566,10 +566,10 @@ escape_string (gchar *orig) return dest; } -int -output_n_cards_file (FILE * outputfile, GList *contacts, int size, int begin_no, CARD_FORMAT format) +gint +output_n_cards_file (FILE * outputfile, GList *contacts, gint size, gint begin_no, CARD_FORMAT format) { - int i; + gint i; if (format == CARD_FORMAT_VCARD) { for (i = begin_no; i < size + begin_no; i++) { EContact *contact = g_list_nth_data (contacts, i); @@ -628,11 +628,11 @@ action_list_cards (GList *contacts, ActionContext * p_actctx) { FILE *outputfile; long length; - int IsFirstOne; - int series_no; + gint IsFirstOne; + gint series_no; gchar *file_series_name; CARD_FORMAT format; - int size; + gint size; length = g_list_length (contacts); diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c index e93748861d..1f18686242 100644 --- a/addressbook/tools/evolution-addressbook-export-list-folders.c +++ b/addressbook/tools/evolution-addressbook-export-list-folders.c @@ -61,8 +61,8 @@ action_list_folders_init (ActionContext * p_actctx) EBook *book; EBookQuery *query; GList *contacts; - char *uri; - const char *name; + gchar *uri; + const gchar *name; book = e_book_new (s, NULL); if (!book diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index 1a7f86142b..c8ae956081 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -64,16 +64,16 @@ static GOptionEntry entries[] = { { NULL } }; -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { ActionContext actctx; GOptionContext *context; GError *error = NULL; - int current_action = ACTION_NOTHING; - int IsCSV = FALSE; - int IsVCard = FALSE; + gint current_action = ACTION_NOTHING; + gint IsCSV = FALSE; + gint IsVCard = FALSE; /*i18n-lize */ bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); @@ -162,7 +162,7 @@ main (int argc, char **argv) exit (-1); } - /*FIXME:should free actctx's some char* field, such as output_file! but since the program will end, so that will not cause mem leak. */ + /*FIXME:should free actctx's some gchar * field, such as output_file! but since the program will end, so that will not cause mem leak. */ exit (0); } diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c index 8d08a3e88f..ec8fccb5ba 100644 --- a/addressbook/util/eab-book-util.c +++ b/addressbook/util/eab-book-util.c @@ -46,11 +46,11 @@ eab_get_config_database (void) * */ -static char* -escape (const char *str) +static gchar * +escape (const gchar *str) { GString *s = g_string_new (NULL); - const char *p = str; + const gchar *p = str; while (*p) { if (*p == '\\') @@ -76,7 +76,7 @@ eab_name_and_email_query (EBook *book, gchar *email_query=NULL, *name_query=NULL; EBookQuery *query; guint tag; - char *escaped_name, *escaped_email; + gchar *escaped_name, *escaped_email; g_return_val_if_fail (book && E_IS_BOOK (book), 0); g_return_val_if_fail (cb != NULL, 0); @@ -118,7 +118,7 @@ eab_name_and_email_query (EBook *book, /* Assemble our e-mail & name queries */ if (email_query && name_query) { - char *full_query = g_strdup_printf ("(and %s %s)", email_query, name_query); + gchar *full_query = g_strdup_printf ("(and %s %s)", email_query, name_query); query = e_book_query_from_string (full_query); g_free (full_query); } @@ -147,12 +147,12 @@ eab_name_and_email_query (EBook *book, */ guint eab_nickname_query (EBook *book, - const char *nickname, + const gchar *nickname, EBookListCallback cb, gpointer closure) { EBookQuery *query; - char *query_string; + gchar *query_string; guint retval; g_return_val_if_fail (E_IS_BOOK (book), 0); @@ -175,11 +175,11 @@ eab_nickname_query (EBook *book, } /* Copied from camel_strstrcase */ -static char * -eab_strstrcase (const char *haystack, const char *needle) +static gchar * +eab_strstrcase (const gchar *haystack, const gchar *needle) { /* find the needle in the haystack neglecting case */ - const char *ptr; + const gchar *ptr; guint len; g_return_val_if_fail (haystack != NULL, NULL); @@ -190,24 +190,24 @@ eab_strstrcase (const char *haystack, const char *needle) return NULL; if (len == 0) - return (char *) haystack; + return (gchar *) haystack; for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++) if (!g_ascii_strncasecmp (ptr, needle, len)) - return (char *) ptr; + return (gchar *) ptr; return NULL; } GList* -eab_contact_list_from_string (const char *str) +eab_contact_list_from_string (const gchar *str) { GList *contacts = NULL; GString *gstr = g_string_new (NULL); - char *str_stripped; - char *p = (char*)str; - char *q; + gchar *str_stripped; + gchar *p = (gchar *)str; + gchar *q; if (!p) return NULL; @@ -270,7 +270,7 @@ eab_contact_list_from_string (const char *str) return contacts; } -char* +gchar * eab_contact_list_to_string (GList *contacts) { GString *str = g_string_new (""); @@ -278,7 +278,7 @@ eab_contact_list_to_string (GList *contacts) for (l = contacts; l; l = l->next) { EContact *contact = l->data; - char *vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); + gchar *vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); g_string_append (str, vcard_str); if (l->next) @@ -289,10 +289,10 @@ eab_contact_list_to_string (GList *contacts) } gboolean -eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **contacts) +eab_book_and_contact_list_from_string (const gchar *str, EBook **book, GList **contacts) { - const char *s0, *s1; - char *uri; + const gchar *s0, *s1; + gchar *uri; g_return_val_if_fail (str != NULL, FALSE); g_return_val_if_fail (book != NULL, FALSE); @@ -323,10 +323,10 @@ eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **co return *book ? TRUE : FALSE; } -char * +gchar * eab_book_and_contact_list_to_string (EBook *book, GList *contacts) { - char *s0, *s1; + gchar *s0, *s1; s0 = eab_contact_list_to_string (contacts); if (!s0) @@ -406,12 +406,12 @@ eab_query_address_default (const gchar *email, #endif /* bad place for this i know. */ -int -e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len) +gint +e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len) { gchar *s1 = g_utf8_casefold(str1, len); gchar *s2 = g_utf8_casefold(str2, len); - int rv; + gint rv; rv = g_utf8_collate (s1, s2); @@ -421,7 +421,7 @@ e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len) return rv; } -int +gint e_utf8_casefold_collate (const gchar *str1, const gchar *str2) { return e_utf8_casefold_collate_len (str1, str2, -1); diff --git a/addressbook/util/eab-book-util.h b/addressbook/util/eab-book-util.h index 0cded9c662..8a9df33e40 100644 --- a/addressbook/util/eab-book-util.h +++ b/addressbook/util/eab-book-util.h @@ -38,20 +38,20 @@ EConfigListener *eab_get_config_database (void); /* Specialized Name/Email Queries */ guint eab_name_and_email_query (EBook *book, - const char *name, - const char *email, + const gchar *name, + const gchar *email, EBookListCallback cb, gpointer closure); guint eab_nickname_query (EBook *book, - const char *nickname, + const gchar *nickname, EBookListCallback cb, gpointer closure); -GList *eab_contact_list_from_string (const char *str); -char *eab_contact_list_to_string (GList *contacts); +GList *eab_contact_list_from_string (const gchar *str); +gchar *eab_contact_list_to_string (GList *contacts); -gboolean eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **contacts); -char *eab_book_and_contact_list_to_string (EBook *book, GList *contacts); +gboolean eab_book_and_contact_list_from_string (const gchar *str, EBook **book, GList **contacts); +gchar *eab_book_and_contact_list_to_string (EBook *book, GList *contacts); /* Returns the EContact associated to email in the callback, or NULL if no match is found in the default address book. */ @@ -59,8 +59,8 @@ void eab_query_address_default (const gchar * EABHaveAddressCallback cb, gpointer closure); -int e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len); -int e_utf8_casefold_collate (const gchar *str1, const gchar *str2); +gint e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len); +gint e_utf8_casefold_collate (const gchar *str1, const gchar *str2); G_END_DECLS |