diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
commit | 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch) | |
tree | 4133b1adfd94d8f889ca7ad4ad851346518f4171 /widgets/menus | |
parent | cc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff) | |
download | gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'widgets/menus')
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 18 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-model.c | 36 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-model.h | 6 | ||||
-rw-r--r-- | widgets/menus/gal-view-collection.c | 114 | ||||
-rw-r--r-- | widgets/menus/gal-view-collection.h | 58 | ||||
-rw-r--r-- | widgets/menus/gal-view-etable.c | 10 | ||||
-rw-r--r-- | widgets/menus/gal-view-etable.h | 2 | ||||
-rw-r--r-- | widgets/menus/gal-view-factory-etable.c | 6 | ||||
-rw-r--r-- | widgets/menus/gal-view-factory.c | 6 | ||||
-rw-r--r-- | widgets/menus/gal-view-factory.h | 12 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.c | 10 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance.c | 40 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance.h | 26 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.c | 2 | ||||
-rw-r--r-- | widgets/menus/gal-view.c | 10 | ||||
-rw-r--r-- | widgets/menus/gal-view.h | 20 |
16 files changed, 188 insertions, 188 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index e820a51a6a..8ecbcba061 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -48,7 +48,7 @@ enum { }; typedef struct { - char *title; + gchar *title; GtkTreeView *treeview; GtkTreeModel *model; @@ -80,7 +80,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) /* Button callbacks */ static void -gdvd_button_new_dialog_callback (GtkWidget *widget, int id, GalDefineViewsDialog *dialog) +gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialog *dialog) { gchar *name; GtkTreeIter iter; @@ -146,7 +146,7 @@ gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) static void gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) { - int row; + gint row; GtkTreeIter iter; GtkTreePath *path; GtkTreeSelection *selection; @@ -182,7 +182,7 @@ gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) static void gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) { - int row; + gint row; GtkWidget *scrolled; ETable *etable; @@ -219,7 +219,7 @@ gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_connect_signal(GalDefineViewsDialog *dialog, const char *widget_name, const char *signal, GCallback handler) +gdvd_connect_signal(GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler) { GtkWidget *widget; @@ -230,7 +230,7 @@ gdvd_connect_signal(GalDefineViewsDialog *dialog, const char *widget_name, const } static void -dialog_response (GalDefineViewsDialog *dialog, int response_id, gpointer data) +dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data) { gal_view_collection_save (dialog->collection); } @@ -303,7 +303,7 @@ static void gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, GalViewCollection *collection) { - int i; + gint i; GtkListStore *store; GtkCellRenderer *renderer; dialog->collection = collection; @@ -318,7 +318,7 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, /*if (item->built_in == 1) continue;*/ - char *title = NULL; + gchar *title = NULL; title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); @@ -353,7 +353,7 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views"); if (widget && GTK_IS_LABEL (widget)) { if (collection->title) { - char *text = g_strdup_printf (_("Define Views for %s"), + gchar *text = g_strdup_printf (_("Define Views for %s"), collection->title); gtk_label_set_text (GTK_LABEL (widget), text); diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 9f67473c32..82ab22eedc 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -78,20 +78,20 @@ gdvm_row_count (ETableModel *etc) } /* This function returns the value at a particular point in our ETableModel. */ -static void * -gdvm_value_at (ETableModel *etc, int col, int row) +static gpointer +gdvm_value_at (ETableModel *etc, gint col, gint row) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); - const char *value; + const gchar *value; value = gal_view_get_title (gal_view_collection_get_view(views->collection, row)); - return (void *)(value ? value : ""); + return (gpointer)(value ? value : ""); } /* This function sets the value at a particular point in our ETableModel. */ static void -gdvm_set_value_at (ETableModel *etc, int col, int row, const void *val) +gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); if (views->editable) { @@ -103,7 +103,7 @@ gdvm_set_value_at (ETableModel *etc, int col, int row, const void *val) /* This function returns whether a particular cell is editable. */ static gboolean -gdvm_is_cell_editable (ETableModel *etc, int col, int row) +gdvm_is_cell_editable (ETableModel *etc, gint col, gint row) { return GAL_DEFINE_VIEWS_MODEL(etc)->editable; } @@ -114,33 +114,33 @@ gdvm_append_row (ETableModel *etm, ETableModel *source, gint row) } /* This function duplicates the value passed to it. */ -static void * -gdvm_duplicate_value (ETableModel *etc, int col, const void *value) +static gpointer +gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } /* This function frees the value passed to it. */ static void -gdvm_free_value (ETableModel *etc, int col, void *value) +gdvm_free_value (ETableModel *etc, gint col, gpointer value) { g_free(value); } -static void * -gdvm_initialize_value (ETableModel *etc, int col) +static gpointer +gdvm_initialize_value (ETableModel *etc, gint col) { return g_strdup(""); } static gboolean -gdvm_value_is_empty (ETableModel *etc, int col, const void *value) +gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value) { - return !(value && *(char *)value); + return !(value && *(gchar *)value); } -static char * -gdvm_value_to_string (ETableModel *etc, int col, const void *value) +static gchar * +gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } @@ -279,7 +279,7 @@ gal_define_views_model_new (void) */ GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, - int n) + gint n) { return gal_view_collection_get_view(model->collection, n); } @@ -293,7 +293,7 @@ gal_define_views_model_get_view (GalDefineViewsModel *model, */ void gal_define_views_model_delete_view (GalDefineViewsModel *model, - int n) + gint n) { e_table_model_pre_change(E_TABLE_MODEL(model)); gal_view_collection_delete_view(model->collection, n); @@ -309,7 +309,7 @@ gal_define_views_model_delete_view (GalDefineViewsModel *model, */ void gal_define_views_model_copy_view (GalDefineViewsModel *model, - int n) + gint n) { ETableModel *etm = E_TABLE_MODEL(model); e_table_model_pre_change(etm); diff --git a/widgets/menus/gal-define-views-model.h b/widgets/menus/gal-define-views-model.h index d0ccfb16b9..2441cf7654 100644 --- a/widgets/menus/gal-define-views-model.h +++ b/widgets/menus/gal-define-views-model.h @@ -59,11 +59,11 @@ ETableModel *gal_define_views_model_new (void); void gal_define_views_model_append (GalDefineViewsModel *model, GalView *view); GalView *gal_define_views_model_get_view (GalDefineViewsModel *model, - int i); + gint i); void gal_define_views_model_delete_view (GalDefineViewsModel *model, - int i); + gint i); void gal_define_views_model_copy_view (GalDefineViewsModel *model, - int i); + gint i); #ifdef __cplusplus } diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index fae91fce7e..a854d4bffa 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -92,13 +92,13 @@ gal_view_collection_item_free (GalViewCollectionItem *item) g_free(item); } -static char * +static gchar * gal_view_generate_string (GalViewCollection *collection, GalView *view, - int which) + gint which) { - char *ret_val; - char *pointer; + gchar *ret_val; + gchar *pointer; if (which == 1) ret_val = g_strdup(gal_view_get_title(view)); @@ -106,7 +106,7 @@ gal_view_generate_string (GalViewCollection *collection, ret_val = g_strdup_printf("%s_%d", gal_view_get_title(view), which); for (pointer = ret_val; *pointer; pointer = g_utf8_next_char(pointer)) { if (!g_unichar_isalnum(g_utf8_get_char(pointer))) { - char *ptr = pointer; + gchar *ptr = pointer; for (; ptr < g_utf8_next_char(pointer); *ptr = '_', ptr++) ; } @@ -116,9 +116,9 @@ gal_view_generate_string (GalViewCollection *collection, static gint gal_view_check_string (GalViewCollection *collection, - char *string) + gchar *string) { - int i; + gint i; if (!strcmp (string, "current_view")) return FALSE; @@ -134,13 +134,13 @@ gal_view_check_string (GalViewCollection *collection, return TRUE; } -static char * +static gchar * gal_view_generate_id (GalViewCollection *collection, GalView *view) { - int i; + gint i; for (i = 1; TRUE; i++) { - char *try; + gchar *try; try = gal_view_generate_string(collection, view, i); if (gal_view_check_string(collection, try)) @@ -153,7 +153,7 @@ static void gal_view_collection_dispose (GObject *object) { GalViewCollection *collection = GAL_VIEW_COLLECTION(object); - int i; + gint i; for (i = 0; i < collection->view_count; i++) { gal_view_collection_item_free (collection->view_data[i]); @@ -253,7 +253,7 @@ gal_view_collection_new (void) void gal_view_collection_set_title (GalViewCollection *collection, - const char *title) + const gchar *title) { g_free (collection->title); collection->title = g_strdup (title); @@ -269,8 +269,8 @@ gal_view_collection_set_title (GalViewCollection *collection, */ void gal_view_collection_set_storage_directories (GalViewCollection *collection, - const char *system_dir, - const char *local_dir) + const gchar *system_dir, + const gchar *local_dir) { g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); @@ -322,7 +322,7 @@ view_changed (GalView *view, /* Use factory list to load a GalView file. */ static GalView * -gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const char *type, const char *title, const char *dir, const char *filename) +gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *title, const gchar *dir, const gchar *filename) { GalViewFactory *factory; GList *factories; @@ -346,7 +346,7 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con } GalView * -gal_view_collection_load_view_from_file (GalViewCollection *collection, const char *type, const char *filename) +gal_view_collection_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *filename) { return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename); } @@ -362,15 +362,15 @@ load_single_file (GalViewCollection *collection, item->ever_changed = local; item->changed = FALSE; item->built_in = !local; - item->id = e_xml_get_string_prop_by_name(node, (const unsigned char *)"id"); - item->filename = e_xml_get_string_prop_by_name(node, (const unsigned char *)"filename"); - item->title = e_xml_get_translated_utf8_string_prop_by_name(node, (const unsigned char *)"title"); - item->type = e_xml_get_string_prop_by_name(node, (const unsigned char *)"type"); + item->id = e_xml_get_string_prop_by_name(node, (const guchar *)"id"); + item->filename = e_xml_get_string_prop_by_name(node, (const guchar *)"filename"); + item->title = e_xml_get_translated_utf8_string_prop_by_name(node, (const guchar *)"title"); + item->type = e_xml_get_string_prop_by_name(node, (const guchar *)"type"); item->collection = collection; item->view_changed_id = 0; if (item->filename) { - char *fullpath; + gchar *fullpath; fullpath = g_build_filename(dir, item->filename, NULL); item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath); g_free(fullpath); @@ -385,14 +385,14 @@ load_single_file (GalViewCollection *collection, static void load_single_dir (GalViewCollection *collection, - char *dir, + gchar *dir, gboolean local) { xmlDoc *doc = NULL; xmlNode *root; xmlNode *child; - char *filename = g_build_filename(dir, "galview.xml", NULL); - char *default_view; + gchar *filename = g_build_filename(dir, "galview.xml", NULL); + gchar *default_view; if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { #ifdef G_OS_WIN32 @@ -413,12 +413,12 @@ load_single_dir (GalViewCollection *collection, for (child = root->xmlChildrenNode; child; child = child->next) { gchar *id; gboolean found = FALSE; - int i; + gint i; - if (!strcmp ((char *)child->name, "text")) + if (!strcmp ((gchar *)child->name, "text")) continue; - id = e_xml_get_string_prop_by_name(child, (const unsigned char *)"id"); + id = e_xml_get_string_prop_by_name(child, (const guchar *)"id"); for (i = 0; i < collection->view_count; i++) { if (!strcmp(id, collection->view_data[i]->id)) { if (!local) @@ -453,7 +453,7 @@ load_single_dir (GalViewCollection *collection, g_free(id); } - default_view = e_xml_get_string_prop_by_name (root, (const unsigned char *)"default-view"); + default_view = e_xml_get_string_prop_by_name (root, (const guchar *)"default-view"); if (default_view) { if (local) collection->default_view_built_in = FALSE; @@ -505,21 +505,21 @@ gal_view_collection_load (GalViewCollection *collection) void gal_view_collection_save (GalViewCollection *collection) { - int i; + gint i; xmlDoc *doc; xmlNode *root; - char *filename; + gchar *filename; g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); - doc = xmlNewDoc((const unsigned char *)"1.0"); - root = xmlNewNode(NULL, (const unsigned char *)"GalViewCollection"); + doc = xmlNewDoc((const guchar *)"1.0"); + root = xmlNewNode(NULL, (const guchar *)"GalViewCollection"); xmlDocSetRootElement(doc, root); if (collection->default_view && !collection->default_view_built_in) { - e_xml_set_string_prop_by_name(root, (const unsigned char *)"default-view", collection->default_view); + e_xml_set_string_prop_by_name(root, (const guchar *)"default-view", collection->default_view); } for (i = 0; i < collection->view_count; i++) { @@ -528,11 +528,11 @@ gal_view_collection_save (GalViewCollection *collection) item = collection->view_data[i]; if (item->ever_changed) { - child = xmlNewChild(root, NULL, (const unsigned char *)"GalView", NULL); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"id", item->id); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"title", item->title); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"filename", item->filename); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"type", item->type); + child = xmlNewChild(root, NULL, (const guchar *)"GalView", NULL); + e_xml_set_string_prop_by_name(child, (const guchar *)"id", item->id); + e_xml_set_string_prop_by_name(child, (const guchar *)"title", item->title); + e_xml_set_string_prop_by_name(child, (const guchar *)"filename", item->filename); + e_xml_set_string_prop_by_name(child, (const guchar *)"type", item->type); if (item->changed) { filename = g_build_filename(collection->local_dir, item->filename, NULL); @@ -547,10 +547,10 @@ gal_view_collection_save (GalViewCollection *collection) item = collection->removed_view_data[i]; - child = xmlNewChild(root, NULL, (const unsigned char *)"GalView", NULL); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"id", item->id); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"title", item->title); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"type", item->type); + child = xmlNewChild(root, NULL, (const guchar *)"GalView", NULL); + e_xml_set_string_prop_by_name(child, (const guchar *)"id", item->id); + e_xml_set_string_prop_by_name(child, (const guchar *)"title", item->title); + e_xml_set_string_prop_by_name(child, (const guchar *)"type", item->type); } filename = g_build_filename(collection->local_dir, "galview.xml", NULL); if (e_xml_save_file (filename, doc) == -1) @@ -585,7 +585,7 @@ gal_view_collection_get_count (GalViewCollection *collection) */ GalView * gal_view_collection_get_view (GalViewCollection *collection, - int n) + gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -604,7 +604,7 @@ gal_view_collection_get_view (GalViewCollection *collection, */ GalViewCollectionItem * gal_view_collection_get_view_item (GalViewCollection *collection, - int n) + gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -614,10 +614,10 @@ gal_view_collection_get_view_item (GalViewCollection *collection, return collection->view_data[n]; } -int -gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const char *view_id) +gint +gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const gchar *view_id) { - int i; + gint i; for (i = 0; i < collection->view_count; i++) { if (!strcmp (collection->view_data[i]->id, view_id)) return i; @@ -625,8 +625,8 @@ gal_view_collection_get_view_index_by_id (GalViewCollection *collection, con return -1; } -char * -gal_view_collection_get_view_id_by_index (GalViewCollection *collection, int n) +gchar * +gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -673,7 +673,7 @@ gal_view_collection_append (GalViewCollection *collection, void gal_view_collection_delete_view (GalViewCollection *collection, - int i) + gint i) { GalViewCollectionItem *item; @@ -700,7 +700,7 @@ gal_view_collection_delete_view (GalViewCollection *collection, void gal_view_collection_copy_view (GalViewCollection *collection, - int i) + gint i) { GalViewCollectionItem *item; GalView *view; @@ -739,8 +739,8 @@ gal_view_collection_loaded (GalViewCollection *collection) return collection->loaded; } -const char * -gal_view_collection_append_with_title (GalViewCollection *collection, const char *title, GalView *view) +const gchar * +gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view) { GalViewCollectionItem *item; @@ -777,8 +777,8 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const char return item->id; } -const char * -gal_view_collection_set_nth_view (GalViewCollection *collection, int i, GalView *view) +const gchar * +gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView *view) { GalViewCollectionItem *item; @@ -814,14 +814,14 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, int i, GalView return item->id; } -const char * +const gchar * gal_view_collection_get_default_view (GalViewCollection *collection) { return collection->default_view; } void -gal_view_collection_set_default_view (GalViewCollection *collection, const char *id) +gal_view_collection_set_default_view (GalViewCollection *collection, const gchar *id) { g_free (collection->default_view); collection->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h index 83e5217131..d443aa9bc2 100644 --- a/widgets/menus/gal-view-collection.h +++ b/widgets/menus/gal-view-collection.h @@ -41,22 +41,22 @@ typedef struct { GObject base; GalViewCollectionItem **view_data; - int view_count; + gint view_count; GList *factory_list; GalViewCollectionItem **removed_view_data; - int removed_view_count; + gint removed_view_count; guint loaded : 1; guint default_view_built_in : 1; - char *system_dir; - char *local_dir; + gchar *system_dir; + gchar *local_dir; - char *default_view; + gchar *default_view; - char *title; + gchar *title; } GalViewCollection; typedef struct { @@ -72,13 +72,13 @@ typedef struct { struct GalViewCollectionItem { GalView *view; - char *id; + gchar *id; guint changed : 1; guint ever_changed : 1; guint built_in : 1; - char *filename; - char *title; - char *type; + gchar *filename; + gchar *title; + gchar *type; GalViewCollection *collection; guint view_changed_id; }; @@ -88,11 +88,11 @@ GType gal_view_collection_get_type (void); GalViewCollection *gal_view_collection_new (void); void gal_view_collection_set_title (GalViewCollection *collection, - const char *title); + const gchar *title); /* Set up the view collection. Call these two functions before ever doing load or save and never call them again. */ void gal_view_collection_set_storage_directories (GalViewCollection *collection, - const char *system_dir, - const char *local_dir); + const gchar *system_dir, + const gchar *local_dir); void gal_view_collection_add_factory (GalViewCollection *collection, GalViewFactory *factory); @@ -104,21 +104,21 @@ void gal_view_collection_display_view (GalViewColl /* Query the view collection. */ gint gal_view_collection_get_count (GalViewCollection *collection); GalView *gal_view_collection_get_view (GalViewCollection *collection, - int n); + gint n); GalViewCollectionItem *gal_view_collection_get_view_item (GalViewCollection *collection, - int n); -int gal_view_collection_get_view_index_by_id (GalViewCollection *collection, - const char *view_id); -char *gal_view_collection_get_view_id_by_index (GalViewCollection *collection, - int n); + gint n); +gint gal_view_collection_get_view_index_by_id (GalViewCollection *collection, + const gchar *view_id); +gchar *gal_view_collection_get_view_id_by_index (GalViewCollection *collection, + gint n); /* Manipulate the view collection */ void gal_view_collection_append (GalViewCollection *collection, GalView *view); void gal_view_collection_delete_view (GalViewCollection *collection, - int i); + gint i); void gal_view_collection_copy_view (GalViewCollection *collection, - int i); + gint i); /* Call set_storage_directories and add factories for anything that * might be found there before doing either of these. */ void gal_view_collection_load (GalViewCollection *collection); @@ -127,21 +127,21 @@ gboolean gal_view_collection_loaded (GalViewColl /* Use factory list to load a GalView file. */ GalView *gal_view_collection_load_view_from_file (GalViewCollection *collection, - const char *type, - const char *filename); + const gchar *type, + const gchar *filename); /* Returns id of the new view. These functions are used for GalViewInstanceSaveAsDialog. */ -const char *gal_view_collection_append_with_title (GalViewCollection *collection, - const char *title, +const gchar *gal_view_collection_append_with_title (GalViewCollection *collection, + const gchar *title, GalView *view); -const char *gal_view_collection_set_nth_view (GalViewCollection *collection, - int i, +const gchar *gal_view_collection_set_nth_view (GalViewCollection *collection, + gint i, GalView *view); -const char *gal_view_collection_get_default_view (GalViewCollection *collection); +const gchar *gal_view_collection_get_default_view (GalViewCollection *collection); void gal_view_collection_set_default_view (GalViewCollection *collection, - const char *id); + const gchar *id); G_END_DECLS diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 89ce837686..688e833aeb 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -88,19 +88,19 @@ gal_view_etable_edit (GalView *view, GtkWindow *parent) static void gal_view_etable_load (GalView *view, - const char *filename) + const gchar *filename) { e_table_state_load_from_file(GAL_VIEW_ETABLE(view)->state, filename); } static void gal_view_etable_save (GalView *view, - const char *filename) + const gchar *filename) { e_table_state_save_to_file(GAL_VIEW_ETABLE(view)->state, filename); } -static const char * +static const gchar * gal_view_etable_get_title (GalView *view) { return GAL_VIEW_ETABLE(view)->title; @@ -108,13 +108,13 @@ gal_view_etable_get_title (GalView *view) static void gal_view_etable_set_title (GalView *view, - const char *title) + const gchar *title) { g_free(GAL_VIEW_ETABLE(view)->title); GAL_VIEW_ETABLE(view)->title = g_strdup(title); } -static const char * +static const gchar * gal_view_etable_get_type_code (GalView *view) { return "etable"; diff --git a/widgets/menus/gal-view-etable.h b/widgets/menus/gal-view-etable.h index fdc34b2710..201c1573ef 100644 --- a/widgets/menus/gal-view-etable.h +++ b/widgets/menus/gal-view-etable.h @@ -44,7 +44,7 @@ typedef struct { ETableSpecification *spec; ETableState *state; - char *title; + gchar *title; ETable *table; guint table_state_changed_id; diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c index 52f759ab37..def35a82b4 100644 --- a/widgets/menus/gal-view-factory-etable.c +++ b/widgets/menus/gal-view-factory-etable.c @@ -31,7 +31,7 @@ G_DEFINE_TYPE (GalViewFactoryEtable, gal_view_factory_etable, GAL_VIEW_FACTORY_TYPE) -static const char * +static const gchar * gal_view_factory_etable_get_title (GalViewFactory *factory) { return _("Table"); @@ -39,12 +39,12 @@ gal_view_factory_etable_get_title (GalViewFactory *factory) static GalView * gal_view_factory_etable_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { return gal_view_etable_new(GAL_VIEW_FACTORY_ETABLE(factory)->spec, name); } -static const char * +static const gchar * gal_view_factory_etable_get_type_code (GalViewFactory *factory) { return "etable"; diff --git a/widgets/menus/gal-view-factory.c b/widgets/menus/gal-view-factory.c index 5b100654de..d58a1545d0 100644 --- a/widgets/menus/gal-view-factory.c +++ b/widgets/menus/gal-view-factory.c @@ -38,7 +38,7 @@ d(static gint depth = 0;) * * Returns: The title of the factory. */ -const char * +const gchar * gal_view_factory_get_title (GalViewFactory *factory) { g_return_val_if_fail (factory != NULL, NULL); @@ -59,7 +59,7 @@ gal_view_factory_get_title (GalViewFactory *factory) */ GalView * gal_view_factory_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { g_return_val_if_fail (factory != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL); @@ -76,7 +76,7 @@ gal_view_factory_new_view (GalViewFactory *factory, * * Returns: The type code */ -const char * +const gchar * gal_view_factory_get_type_code (GalViewFactory *factory) { g_return_val_if_fail (factory != NULL, NULL); diff --git a/widgets/menus/gal-view-factory.h b/widgets/menus/gal-view-factory.h index d2c4b4aa45..59f46a20e9 100644 --- a/widgets/menus/gal-view-factory.h +++ b/widgets/menus/gal-view-factory.h @@ -48,10 +48,10 @@ typedef struct { /* * Virtual methods */ - const char *(*get_title) (GalViewFactory *factory); - const char *(*get_type_code) (GalViewFactory *factory); + const gchar *(*get_title) (GalViewFactory *factory); + const gchar *(*get_type_code) (GalViewFactory *factory); GalView *(*new_view) (GalViewFactory *factory, - const char *name); + const gchar *name); } GalViewFactoryClass; /* Standard functions */ @@ -59,17 +59,17 @@ GType gal_view_factory_get_type (void); /* Query functions */ /* Returns already translated title. */ -const char *gal_view_factory_get_title (GalViewFactory *factory); +const gchar *gal_view_factory_get_title (GalViewFactory *factory); /* Returns the code for use in identifying this type of object in the * view list. This identifier should identify this as being the * unique factory for xml files which were written out with this * identifier. Thus each factory should have a unique type code. */ -const char *gal_view_factory_get_type_code (GalViewFactory *factory); +const gchar *gal_view_factory_get_type_code (GalViewFactory *factory); /* Create a new view */ GalView *gal_view_factory_new_view (GalViewFactory *factory, - const char *name); + const gchar *name); #ifdef __cplusplus } diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 02283c630e..610c03a663 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -48,7 +48,7 @@ static void gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog, GalViewInstance *instance) { - int i; + gint i; GtkListStore *store; GtkCellRenderer *renderer; dialog->instance = instance; @@ -58,7 +58,7 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial for (i=0; i<instance->collection->view_count; i++) { GalViewCollectionItem *item = instance->collection->view_data[i]; GtkTreeIter iter; - char *title = NULL; + gchar *title = NULL; /* hide built in views */ /*if (item->built_in == 1) @@ -304,9 +304,9 @@ void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog) { GalView *view = gal_view_instance_get_current_view (dialog->instance); - const char *title; - int n; - const char *id = NULL; + const gchar *title; + gint n; + const gchar *id = NULL; GalViewCollectionItem *item; view = gal_view_clone (view); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 07dab81336..bd93b64034 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -83,14 +83,14 @@ save_current_view (GalViewInstance *instance) xmlDoc *doc; xmlNode *root; - doc = xmlNewDoc((const unsigned char *)"1.0"); - root = xmlNewNode (NULL, (const unsigned char *)"GalViewCurrentView"); + doc = xmlNewDoc((const guchar *)"1.0"); + root = xmlNewNode (NULL, (const guchar *)"GalViewCurrentView"); xmlDocSetRootElement(doc, root); if (instance->current_id) - e_xml_set_string_prop_by_name (root, (const unsigned char *)"current_view", instance->current_id); + e_xml_set_string_prop_by_name (root, (const guchar *)"current_view", instance->current_id); if (instance->current_type) - e_xml_set_string_prop_by_name (root, (const unsigned char *)"current_view_type", instance->current_type); + e_xml_set_string_prop_by_name (root, (const guchar *)"current_view_type", instance->current_type); if (e_xml_save_file (instance->current_view_filename, doc) == -1) g_warning ("Unable to save view to %s - %s", instance->current_view_filename, g_strerror(errno)); @@ -225,7 +225,7 @@ static void collection_changed (GalView *view, GalViewInstance *instance) { if (instance->current_id) { - char *view_id = instance->current_id; + gchar *view_id = instance->current_id; instance->current_id = NULL; gal_view_instance_set_current_view_id (instance, view_id); g_free (view_id); @@ -254,7 +254,7 @@ load_current_view (GalViewInstance *instance) instance->current_id = g_strdup (gal_view_instance_get_default_view (instance)); if (instance->current_id) { - int index = gal_view_collection_get_view_index_by_id (instance->collection, + gint index = gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id); if (index != -1) { @@ -268,10 +268,10 @@ load_current_view (GalViewInstance *instance) } root = xmlDocGetRootElement(doc); - instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const unsigned char *)"current_view", NULL); + instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view", NULL); if (instance->current_id != NULL) { - int index = gal_view_collection_get_view_index_by_id (instance->collection, + gint index = gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id); if (index != -1) { @@ -281,8 +281,8 @@ load_current_view (GalViewInstance *instance) } } if (view == NULL) { - char *type; - type = e_xml_get_string_prop_by_name_with_default (root, (const unsigned char *)"current_view_type", NULL); + gchar *type; + type = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view_type", NULL); view = gal_view_collection_load_view_from_file (instance->collection, type, instance->custom_filename); @@ -304,7 +304,7 @@ load_current_view (GalViewInstance *instance) * Return value: The new %GalViewInstance. **/ GalViewInstance * -gal_view_instance_new (GalViewCollection *collection, const char *instance_id) +gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) { GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL); if (gal_view_instance_construct (instance, collection, instance_id)) @@ -316,10 +316,10 @@ gal_view_instance_new (GalViewCollection *collection, const char *instance_id) } GalViewInstance * -gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const char *instance_id) +gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const gchar *instance_id) { - char *filename; - char *safe_id; + gchar *filename; + gchar *safe_id; g_return_val_if_fail (gal_view_collection_loaded (collection), NULL); @@ -352,7 +352,7 @@ gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *colle } /* Manipulate the current view. */ -char * +gchar * gal_view_instance_get_current_view_id (GalViewInstance *instance) { if (instance->current_id && gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id) != -1) @@ -362,10 +362,10 @@ gal_view_instance_get_current_view_id (GalViewInstance *instance) } void -gal_view_instance_set_current_view_id (GalViewInstance *instance, const char *view_id) +gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *view_id) { GalView *view; - int index; + gint index; g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); @@ -408,7 +408,7 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) } static void -dialog_response(GtkWidget *dialog, int id, GalViewInstance *instance) +dialog_response(GtkWidget *dialog, gint id, GalViewInstance *instance) { if (id == GTK_RESPONSE_OK) { gal_view_instance_save_as_dialog_save (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (dialog)); @@ -436,7 +436,7 @@ gal_view_instance_load (GalViewInstance *instance) } /* These only mean anything before gal_view_instance_load is called the first time. */ -const char * +const gchar * gal_view_instance_get_default_view (GalViewInstance *instance) { if (instance->default_view) @@ -446,7 +446,7 @@ gal_view_instance_get_default_view (GalViewInstance *instance) } void -gal_view_instance_set_default_view (GalViewInstance *instance, const char *id) +gal_view_instance_set_default_view (GalViewInstance *instance, const gchar *id) { g_free (instance->default_view); instance->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-instance.h b/widgets/menus/gal-view-instance.h index 88c2c3c39d..960bf940c6 100644 --- a/widgets/menus/gal-view-instance.h +++ b/widgets/menus/gal-view-instance.h @@ -40,13 +40,13 @@ typedef struct { GalViewCollection *collection; - char *instance_id; - char *current_view_filename; - char *custom_filename; + gchar *instance_id; + gchar *current_view_filename; + gchar *custom_filename; - char *current_title; - char *current_type; - char *current_id; + gchar *current_title; + gchar *current_type; + gchar *current_id; GalView *current_view; @@ -54,7 +54,7 @@ typedef struct { guint collection_changed_id; guint loaded : 1; - char *default_view; + gchar *default_view; } GalViewInstance; typedef struct { @@ -75,15 +75,15 @@ GType gal_view_instance_get_type (void); /*collection should be loaded when you call this. instance_id: Which instance of this type of object is this (for most of evo, this is the folder id.) */ GalViewInstance *gal_view_instance_new (GalViewCollection *collection, - const char *instance_id); + const gchar *instance_id); GalViewInstance *gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, - const char *instance_id); + const gchar *instance_id); /* Manipulate the current view. */ -char *gal_view_instance_get_current_view_id (GalViewInstance *instance); +gchar *gal_view_instance_get_current_view_id (GalViewInstance *instance); void gal_view_instance_set_current_view_id (GalViewInstance *instance, - const char *view_id); + const gchar *view_id); GalView *gal_view_instance_get_current_view (GalViewInstance *instance); /* Sets the current view to the given custom view. */ @@ -102,9 +102,9 @@ void gal_view_instance_save_as (GalViewInstance *inst void gal_view_instance_load (GalViewInstance *instance); /* These only mean anything before gal_view_instance_load is called the first time. */ -const char *gal_view_instance_get_default_view (GalViewInstance *instance); +const gchar *gal_view_instance_get_default_view (GalViewInstance *instance); void gal_view_instance_set_default_view (GalViewInstance *instance, - const char *id); + const gchar *id); G_END_DECLS diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 39c5411dfb..b61f1ac155 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -132,7 +132,7 @@ static void sensitize_ok_response (GalViewNewDialog *dialog) { gboolean ok = TRUE; - const char *text; + const gchar *text; text = gtk_entry_get_text (GTK_ENTRY (dialog->entry)); if (!text || !text[0]) diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c index fd3cdc2a5e..7b52d74864 100644 --- a/widgets/menus/gal-view.c +++ b/widgets/menus/gal-view.c @@ -65,7 +65,7 @@ gal_view_edit (GalView *view, */ void gal_view_load (GalView *view, - const char *filename) + const gchar *filename) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -81,7 +81,7 @@ gal_view_load (GalView *view, */ void gal_view_save (GalView *view, - const char *filename) + const gchar *filename) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -96,7 +96,7 @@ gal_view_save (GalView *view, * * Returns: The title of the view. */ -const char * +const gchar * gal_view_get_title (GalView *view) { g_return_val_if_fail (view != NULL, NULL); @@ -115,7 +115,7 @@ gal_view_get_title (GalView *view) */ void gal_view_set_title (GalView *view, - const char *title) + const gchar *title) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -130,7 +130,7 @@ gal_view_set_title (GalView *view, * * Returns: The type of the view. */ -const char * +const gchar * gal_view_get_type_code (GalView *view) { g_return_val_if_fail (view != NULL, NULL); diff --git a/widgets/menus/gal-view.h b/widgets/menus/gal-view.h index b0ac4f3176..ce73400033 100644 --- a/widgets/menus/gal-view.h +++ b/widgets/menus/gal-view.h @@ -50,13 +50,13 @@ typedef struct { */ void (*edit) (GalView *view, GtkWindow *parent_window); void (*load) (GalView *view, - const char *filename); + const gchar *filename); void (*save) (GalView *view, - const char *filename); - const char *(*get_title) (GalView *view); + const gchar *filename); + const gchar *(*get_title) (GalView *view); void (*set_title) (GalView *view, - const char *title); - const char *(*get_type_code) (GalView *view); + const gchar *title); + const gchar *(*get_type_code) (GalView *view); GalView *(*clone) (GalView *view); /* Signals */ @@ -72,17 +72,17 @@ void gal_view_edit (GalView *view, /* xml load and save functions */ void gal_view_load (GalView *view, - const char *filename); + const gchar *filename); void gal_view_save (GalView *view, - const char *filename); + const gchar *filename); /* Title functions */ -const char *gal_view_get_title (GalView *view); +const gchar *gal_view_get_title (GalView *view); void gal_view_set_title (GalView *view, - const char *title); + const gchar *title); /* View type. */ -const char *gal_view_get_type_code (GalView *view); +const gchar *gal_view_get_type_code (GalView *view); /* Cloning the view */ GalView *gal_view_clone (GalView *view); |