From fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 11:13:25 -0400 Subject: Prefer GLib basic types over C types. --- calendar/gui/migration.c | 102 +++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'calendar/gui/migration.c') diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c index 97cc575b20..b2552a5a27 100644 --- a/calendar/gui/migration.c +++ b/calendar/gui/migration.c @@ -188,9 +188,9 @@ dialog_close (void) } static void -dialog_set_folder_name (const char *folder_name) +dialog_set_folder_name (const gchar *folder_name) { - char *text; + gchar *text; text = g_strdup_printf (_("Migrating '%s':"), folder_name); gtk_label_set_text (label, text); @@ -205,7 +205,7 @@ dialog_set_folder_name (const char *folder_name) static void dialog_set_progress (double percent) { - char text[5]; + gchar text[5]; snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); @@ -217,7 +217,7 @@ dialog_set_progress (double percent) } static gboolean -check_for_conflict (ESourceGroup *group, char *name) +check_for_conflict (ESourceGroup *group, gchar *name) { GSList *sources; GSList *s; @@ -234,12 +234,12 @@ 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) { - char **p = g_strsplit (path, "/", 0); - int i, j, starting_index; - int num_elements; + gchar **p = g_strsplit (path, "/", 0); + gint i, j, starting_index; + gint num_elements; gboolean conflict; GString *s = g_string_new (NULL); @@ -281,8 +281,8 @@ static gboolean migrate_ical (ECal *old_ecal, ECal *new_ecal) { GList *l, *objects; - int num_added = 0; - int num_objects; + gint num_added = 0; + gint num_objects; gboolean retval = TRUE; /* both ecals are loaded, start the actual migration */ @@ -312,12 +312,12 @@ migrate_ical (ECal *old_ecal, ECal *new_ecal) } static gboolean -migrate_ical_folder_to_source (char *old_path, ESource *new_source, ECalSourceType type) +migrate_ical_folder_to_source (gchar *old_path, ESource *new_source, ECalSourceType type) { ECal *old_ecal = NULL, *new_ecal = NULL; ESource *old_source; ESourceGroup *group; - char *old_uri = g_filename_to_uri (old_path, NULL, NULL); + gchar *old_uri = g_filename_to_uri (old_path, NULL, NULL); GError *error = NULL; gboolean retval = FALSE; @@ -362,7 +362,7 @@ finish: } static gboolean -migrate_ical_folder (char *old_path, ESourceGroup *dest_group, char *source_name, ECalSourceType type) +migrate_ical_folder (gchar *old_path, ESourceGroup *dest_group, gchar *source_name, ECalSourceType type) { ESource *new_source; gboolean retval; @@ -416,7 +416,7 @@ create_calendar_sources (CalendarComponent *component, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; const gchar *base_dir; *on_this_computer = NULL; @@ -479,7 +479,7 @@ create_calendar_sources (CalendarComponent *component, } if (!*personal_source) { - char *primary_calendar = calendar_config_get_primary_calendar (); + gchar *primary_calendar = calendar_config_get_primary_calendar (); /* Create the default Person calendar */ ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); @@ -527,7 +527,7 @@ create_task_sources (TasksComponent *component, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; const gchar *base_dir; *on_this_computer = NULL; @@ -614,7 +614,7 @@ create_task_sources (TasksComponent *component, #ifndef G_OS_WIN32 static void -migrate_pilot_db_key (const char *key, gpointer user_data) +migrate_pilot_db_key (const gchar *key, gpointer user_data) { EXmlHash *xmlhash = user_data; @@ -622,12 +622,12 @@ migrate_pilot_db_key (const char *key, gpointer user_data) } static void -migrate_pilot_data (const char *component, const char *conduit, const char *old_path, const char *new_path) +migrate_pilot_data (const gchar *component, const gchar *conduit, const gchar *old_path, const gchar *new_path) { - char *changelog, *map; - const char *dent; - const char *ext; - char *filename; + gchar *changelog, *map; + const gchar *dent; + const gchar *ext; + gchar *filename; GDir *dir; if (!(dir = g_dir_open (old_path, 0, NULL))) @@ -643,9 +643,9 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ if (!strncmp (dent, map, strlen (map)) && ((ext = strrchr (dent, '.')) && !strcmp (ext, ".xml"))) { /* pilot map file - src and dest file formats are identical */ - 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); @@ -733,7 +733,7 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ #endif gboolean -migrate_calendars (CalendarComponent *component, int major, int minor, int revision, GError **err) +migrate_calendars (CalendarComponent *component, gint major, gint minor, gint revision, GError **err) { ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL; ESource *personal_source = NULL; @@ -749,7 +749,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis #ifndef G_OS_WIN32 if (major == 1) { xmlDocPtr config_doc = NULL; - char *conf_file; + gchar *conf_file; struct stat st; conf_file = g_build_filename (g_get_home_dir (), "evolution", "config.xmldb", NULL); @@ -759,7 +759,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis if (config_doc && minor <= 2) { GConfClient *gconf; - int res = 0; + gint res = 0; /* move bonobo config to gconf */ gconf = gconf_client_get_default (); @@ -779,7 +779,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis if (minor <= 4) { GSList *migration_dirs, *l; - char *path, *local_cal_folder; + gchar *path, *local_cal_folder; setup_progress_dialog (FALSE); @@ -792,12 +792,12 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis migrate_ical_folder_to_source (local_cal_folder, personal_source, E_CAL_SOURCE_TYPE_EVENT); for (l = migration_dirs; l; l = l->next) { - char *source_name; + gchar *source_name; - if (personal_source && !strcmp ((char*)l->data, local_cal_folder)) + if (personal_source && !strcmp ((gchar *)l->data, local_cal_folder)) continue; - source_name = get_source_name (on_this_computer, (char*)l->data); + source_name = get_source_name (on_this_computer, (gchar *)l->data); if (!migrate_ical_folder (l->data, on_this_computer, source_name, E_CAL_SOURCE_TYPE_EVENT)) { /* FIXME: domain/code */ @@ -817,8 +817,8 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis if (minor <= 4 || (minor == 5 && revision < 5)) { GConfClient *gconf; GConfValue *gconf_val; - int i; - const char *keys[] = { + gint i; + const gchar *keys[] = { CALENDAR_CONFIG_HPANE_POS, CALENDAR_CONFIG_VPANE_POS, CALENDAR_CONFIG_MONTH_HPANE_POS, @@ -841,7 +841,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis } if (minor < 5 || (minor == 5 && revision <= 10)) { - char *old_path, *new_path; + gchar *old_path, *new_path; old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Calendar", NULL); new_path = g_build_filename (calendar_component_peek_base_directory (component), @@ -904,7 +904,7 @@ fail: } gboolean -migrate_tasks (TasksComponent *component, int major, int minor, int revision, GError **err) +migrate_tasks (TasksComponent *component, gint major, gint minor, gint revision, GError **err) { ESourceGroup *on_this_computer = NULL; ESourceGroup *on_the_web = NULL; @@ -919,7 +919,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE #ifndef G_OS_WIN32 if (major == 1) { xmlDocPtr config_doc = NULL; - char *conf_file; + gchar *conf_file; conf_file = g_build_filename (g_get_home_dir (), "evolution", "config.xmldb", NULL); if (g_file_test (conf_file, G_FILE_TEST_IS_REGULAR)) @@ -928,7 +928,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE if (config_doc && minor <= 2) { GConfClient *gconf; - int res = 0; + gint res = 0; /* move bonobo config to gconf */ gconf = gconf_client_get_default (); @@ -947,7 +947,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE if (minor <= 4) { GSList *migration_dirs, *l; - char *path, *local_task_folder; + gchar *path, *local_task_folder; setup_progress_dialog (TRUE); @@ -960,12 +960,12 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE migrate_ical_folder_to_source (local_task_folder, personal_source, E_CAL_SOURCE_TYPE_TODO); for (l = migration_dirs; l; l = l->next) { - char *source_name; + gchar *source_name; - if (personal_source && !strcmp ((char*)l->data, local_task_folder)) + if (personal_source && !strcmp ((gchar *)l->data, local_task_folder)) continue; - source_name = get_source_name (on_this_computer, (char*)l->data); + source_name = get_source_name (on_this_computer, (gchar *)l->data); if (!migrate_ical_folder (l->data, on_this_computer, source_name, E_CAL_SOURCE_TYPE_TODO)) { /* FIXME: domain/code */ @@ -983,7 +983,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE } if (minor < 5 || (minor == 5 && revision <= 10)) { - char *old_path, *new_path; + gchar *old_path, *new_path; old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Tasks", NULL); new_path = g_build_filename (tasks_component_peek_base_directory (component), @@ -1041,7 +1041,7 @@ create_memo_sources (MemosComponent *component, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; const gchar *base_dir; *on_this_computer = NULL; @@ -1136,17 +1136,17 @@ is_groupwise_account (EAccount *account) } static void -add_gw_esource (ESourceList *source_list, const char *group_name, const char *source_name, CamelURL *url, GConfClient *client) +add_gw_esource (ESourceList *source_list, const gchar *group_name, const gchar *source_name, CamelURL *url, GConfClient *client) { ESourceGroup *group; ESource *source; GSList *ids, *temp ; GError *error = NULL; - char *relative_uri; - const char *soap_port; - const char * use_ssl; - const char *poa_address; - const char *offline_sync; + gchar *relative_uri; + const gchar *soap_port; + const gchar * use_ssl; + const gchar *poa_address; + const gchar *offline_sync; poa_address = url->host; @@ -1194,7 +1194,7 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s } gboolean -migrate_memos (MemosComponent *component, int major, int minor, int revision, struct _GError **err) +migrate_memos (MemosComponent *component, gint major, gint minor, gint revision, struct _GError **err) { ESourceGroup *on_this_computer = NULL; ESourceGroup *on_the_web = NULL; -- cgit