[evolution] Use gal_view_collection_get_user_directory() where needed.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Use gal_view_collection_get_user_directory() where needed.
- Date: Fri, 5 Jul 2013 20:43:04 +0000 (UTC)
commit f6de38811c202186415e6647ef43511525c80572
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Jul 5 10:24:43 2013 -0400
Use gal_view_collection_get_user_directory() where needed.
GalViewInstance and EMailPanedView need access. Currently they're just
using the public GalViewCollection members directly, but those are about
to be sealed up.
e-util/gal-view-instance.c | 10 ++++++++--
mail/e-mail-paned-view.c | 12 ++++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/e-util/gal-view-instance.c b/e-util/gal-view-instance.c
index 3eac358..651408d 100644
--- a/e-util/gal-view-instance.c
+++ b/e-util/gal-view-instance.c
@@ -348,6 +348,7 @@ gal_view_instance_construct (GalViewInstance *instance,
{
gchar *filename;
gchar *safe_id;
+ const gchar *user_directory;
g_return_val_if_fail (gal_view_collection_loaded (collection), NULL);
@@ -366,12 +367,17 @@ gal_view_instance_construct (GalViewInstance *instance,
safe_id = g_strdup (instance->instance_id);
e_filename_make_safe (safe_id);
+ user_directory =
+ gal_view_collection_get_user_directory (instance->collection);
+
filename = g_strdup_printf ("custom_view-%s.xml", safe_id);
- instance->custom_filename = g_build_filename (instance->collection->local_dir, filename, NULL);
+ instance->custom_filename =
+ g_build_filename (user_directory, filename, NULL);
g_free (filename);
filename = g_strdup_printf ("current_view-%s.xml", safe_id);
- instance->current_view_filename = g_build_filename (instance->collection->local_dir, filename, NULL);
+ instance->current_view_filename =
+ g_build_filename (user_directory, filename, NULL);
g_free (filename);
g_free (safe_id);
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 2aa602b..f8b008a 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -882,6 +882,7 @@ mail_paned_view_update_view_instance (EMailView *view)
(orientation == GTK_ORIENTATION_HORIZONTAL);
if (show_vertical_view) {
+ const gchar *user_directory;
gchar *filename;
/* Force the view instance into vertical view. */
@@ -889,16 +890,19 @@ mail_paned_view_update_view_instance (EMailView *view)
g_free (view_instance->custom_filename);
g_free (view_instance->current_view_filename);
+ user_directory = gal_view_collection_get_user_directory (
+ view_collection);
+
filename = g_strdup_printf (
"custom_wide_view-%s.xml", view_id);
- view_instance->custom_filename = g_build_filename (
- view_collection->local_dir, filename, NULL);
+ view_instance->custom_filename =
+ g_build_filename (user_directory, filename, NULL);
g_free (filename);
filename = g_strdup_printf (
"current_wide_view-%s.xml", view_id);
- view_instance->current_view_filename = g_build_filename (
- view_collection->local_dir, filename, NULL);
+ view_instance->current_view_filename =
+ g_build_filename (user_directory, filename, NULL);
g_free (filename);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]