aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2007-04-20 02:53:33 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-04-20 02:53:33 +0800
commit64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6 (patch)
tree4ebe95239bef43cb97c0e46aa8194d44e6c88be6 /widgets/menus
parentbb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb (diff)
downloadgsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.gz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.bz2
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.lz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.xz
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.zst
gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.zip
Massive code cleanup (bug #429422)
svn path=/trunk/; revision=33432
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-define-views-dialog.c4
-rw-r--r--widgets/menus/gal-view-collection.c15
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c4
-rw-r--r--widgets/menus/gal-view-instance.c4
-rw-r--r--widgets/menus/gal-view-new-dialog.c4
5 files changed, 17 insertions, 14 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 104e706b6d..3630780817 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -258,12 +258,12 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
if (!widget) {
return;
}
- gtk_widget_ref(widget);
+ g_object_ref(widget);
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
gtk_window_set_default_size(GTK_WINDOW(dialog), 360, 270);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 6);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
+ g_object_unref(widget);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 848b789235..36f9cea25c 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -166,7 +166,10 @@ gal_view_collection_dispose (GObject *object)
collection->view_data = NULL;
collection->view_count = 0;
- e_free_object_list (collection->factory_list);
+ g_list_foreach (
+ collection->factory_list,
+ (GFunc) g_object_unref, NULL);
+ g_list_free (collection->factory_list);
collection->factory_list = NULL;
for (i = 0; i < collection->removed_view_count; i++) {
@@ -375,7 +378,7 @@ load_single_file (GalViewCollection *collection,
if (item->filename) {
char *fullpath;
- fullpath = g_concat_dir_and_file(dir, item->filename);
+ 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);
if (item->view) {
@@ -395,7 +398,7 @@ load_single_dir (GalViewCollection *collection,
xmlDoc *doc = NULL;
xmlNode *root;
xmlNode *child;
- char *filename = g_concat_dir_and_file(dir, "galview.xml");
+ char *filename = g_build_filename(dir, "galview.xml", NULL);
char *default_view;
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
@@ -488,7 +491,7 @@ gal_view_collection_load (GalViewCollection *collection)
g_return_if_fail (collection->system_dir != NULL);
g_return_if_fail (!collection->loaded);
- if ((e_create_directory(collection->local_dir) == -1) && (errno != EEXIST))
+ if ((g_mkdir_with_parents (collection->local_dir, 0777) == -1) && (errno != EEXIST))
g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno));
load_single_dir(collection, collection->local_dir, TRUE);
@@ -539,7 +542,7 @@ gal_view_collection_save (GalViewCollection *collection)
e_xml_set_string_prop_by_name(child, "type", item->type);
if (item->changed) {
- filename = g_concat_dir_and_file(collection->local_dir, item->filename);
+ filename = g_build_filename(collection->local_dir, item->filename, NULL);
gal_view_save(item->view, filename);
g_free(filename);
}
@@ -556,7 +559,7 @@ gal_view_collection_save (GalViewCollection *collection)
e_xml_set_string_prop_by_name(child, "title", item->title);
e_xml_set_string_prop_by_name(child, "type", item->type);
}
- filename = g_concat_dir_and_file(collection->local_dir, "galview.xml");
+ filename = g_build_filename(collection->local_dir, "galview.xml", NULL);
if (e_xml_save_file (filename, doc) == -1)
g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno));
xmlFreeDoc(doc);
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index 663097567f..622b99a049 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -205,10 +205,10 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
if (!widget) {
return;
}
- gtk_widget_ref(widget);
+ g_object_ref(widget);
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
+ g_object_unref(widget);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index df84a38948..821a299afb 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -349,11 +349,11 @@ gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *colle
e_filename_make_safe (safe_id);
filename = g_strdup_printf ("custom_view-%s.xml", safe_id);
- instance->custom_filename = g_concat_dir_and_file (instance->collection->local_dir, filename);
+ instance->custom_filename = g_build_filename (instance->collection->local_dir, filename, NULL);
g_free (filename);
filename = g_strdup_printf ("current_view-%s.xml", safe_id);
- instance->current_view_filename = g_concat_dir_and_file (instance->collection->local_dir, filename);
+ instance->current_view_filename = g_build_filename (instance->collection->local_dir, filename, NULL);
g_free (filename);
g_free (safe_id);
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
index a256baccdb..c41ce03123 100644
--- a/widgets/menus/gal-view-new-dialog.c
+++ b/widgets/menus/gal-view-new-dialog.c
@@ -100,10 +100,10 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog)
if (!widget) {
return;
}
- gtk_widget_ref(widget);
+ g_object_ref(widget);
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
+ g_object_unref(widget);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,