aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2008-03-11 23:20:59 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-03-11 23:20:59 +0800
commite0d5ae3e97f318fb60674de189c8eff91477bac9 (patch)
treedf85497e700d8794604fe7730369fe93b16829db /calendar
parent9427d2336925fd6cfd0bff849b6d9ac69411c09f (diff)
downloadgsoc2013-evolution-e0d5ae3e97f318fb60674de189c8eff91477bac9.tar.gz
gsoc2013-evolution-e0d5ae3e97f318fb60674de189c8eff91477bac9.tar.zst
gsoc2013-evolution-e0d5ae3e97f318fb60674de189c8eff91477bac9.zip
** Fixes bug #513951
2008-03-11 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #513951 * addressbook/gui/component/addressbook-component.c (ensure_sources): * addressbook/gui/component/addressbook-migrate.c (addressbook_migrate): * calendar/gui/cal-search-bar.c (cal_search_bar_construct): * calendar/gui/migration.c (create_calendar_sources), (create_task_sources), (migrate_calendars), (migrate_tasks), (create_memo_sources): * calendar/gui/e-memos.c (e_memos_setup_view_menus): * calendar/gui/tasks-component.c (ensure_sources): * calendar/gui/gnome-cal.c (gnome_calendar_setup_view_menus): * calendar/gui/calendar-component.c (ensure_sources): * calendar/gui/memos-component.c (ensure_sources): * mail/mail-config.c (gconf_mime_types_changed): Adapt to new meaning of xxx_component_peek_base_directory(). * addressbook/gui/component/addressbook-component.c (addressbook_component_init): * addressbook/gui/component/addressbook-migrate.c (create_groups): * calendar/gui/tasks-component.c (tasks_component_init): * calendar/gui/calendar-component.c (calendar_component_init): * calendar/gui/memos-component.c (memos_component_init): * composer/e-msg-composer.c (autosave_manager_query_load_orphans), (autosave_init_file): * e-util/e-mktemp.c (get_dir): * e-util/e-util.c (get_lock_filename): * mail/mail-component.c: * plugins/face/face.c (org_gnome_composer_face): * smime/lib/e-cert-db.c (initialize_nss): Use e_get_user_data_dir() instead of constructing the full path. * calendar/gui/migration.c (add_gw_esource): * composer/e-msg-composer.c (e_msg-composer_unrealize), (e_msg_composer_set_view_from), (e_msg_composer_set_view_replyto), (e_msg_composer_set_view_to), (e_msg_composer_set_view_postto), (e_msg_composer_set_view_cc), (e_msg_composer_set_view_bcc): * e-util/e-util.c (e_file_update_save_path), (e_file_get_save_path): Emit warnings if saving to GConf fails. * e-util/e-util.c (e_get_user_data_dir): New function returns the base directory for Evolution user data. This should be the /only/ place in the application where this directory is hard-coded. svn path=/trunk/; revision=35175
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog22
-rw-r--r--calendar/gui/cal-search-bar.c12
-rw-r--r--calendar/gui/calendar-component.c12
-rw-r--r--calendar/gui/e-memos.c2
-rw-r--r--calendar/gui/gnome-cal.c2
-rw-r--r--calendar/gui/memos-component.c12
-rw-r--r--calendar/gui/migration.c27
-rw-r--r--calendar/gui/tasks-component.c12
8 files changed, 65 insertions, 36 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c6f28fdebc..cf258abccc 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,25 @@
+2008-03-11 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #513951
+
+ * gui/cal-search-bar.c (cal_search_bar_construct):
+ * gui/migration.c (create_calendar_sources), (create_task_sources),
+ (migrate_calendars), (migrate_tasks), (create_memo_sources):
+ * gui/e-memos.c (e_memos_setup_view_menus):
+ * gui/tasks-component.c (ensure_sources):
+ * gui/gnome-cal.c (gnome_calendar_setup_view_menus):
+ * gui/calendar-component.c (ensure_sources):
+ * gui/memos-component.c (ensure_sources):
+ Adapt to new meaning of xxx_component_peek_base_directory().
+
+ * gui/tasks-component.c (tasks_component_init):
+ * gui/calendar-component.c (calendar_component_init):
+ * gui/memos-component.c (memos_component_init):
+ Use e_get_user_data_dir() instead of constructing the full path.
+
+ * gui/migration.c (add_gw_esource):
+ Emit warnings when saving to GConf fails.
+
2008-02-25 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #516498
diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c
index fdaa0ff791..58ba068355 100644
--- a/calendar/gui/cal-search-bar.c
+++ b/calendar/gui/cal-search-bar.c
@@ -37,6 +37,9 @@
#include <filter/rule-editor.h>
#include "cal-search-bar.h"
+#include "calendar-component.h"
+#include "memos-component.h"
+#include "tasks-component.h"
#include "e-util/e-util.h"
#include "e-util/e-error.h"
@@ -736,6 +739,7 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags)
FilterPart *part;
RuleContext *search_context;
FilterRule *search_rule;
+ const gchar *base_dir;
g_return_val_if_fail (IS_CAL_SEARCH_BAR (cal_search), NULL);
@@ -760,16 +764,18 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags)
rule_context_add_rule, rule_context_next_rule);
if (flags == CAL_SEARCH_MEMOS_DEFAULT) {
- userfile = g_build_filename (g_get_home_dir (), ".evolution", "memos", "searches.xml", NULL);
+ base_dir = memos_component_peek_base_directory (memos_component_peek ());
xmlfile = g_build_filename (SEARCH_RULE_DIR, "memotypes.xml", NULL);
} else if (flags == CAL_SEARCH_TASKS_DEFAULT) {
- userfile = g_build_filename (g_get_home_dir (), ".evolution", "tasks", "searches.xml", NULL);
+ base_dir = tasks_component_peek_base_directory (tasks_component_peek ());
xmlfile = g_build_filename (SEARCH_RULE_DIR, "tasktypes.xml", NULL);
} else {
- userfile = g_build_filename (g_get_home_dir (), ".evolution", "calendar", "searches.xml", NULL);
+ base_dir = calendar_component_peek_base_directory (calendar_component_peek ());
xmlfile = g_build_filename (SEARCH_RULE_DIR, "caltypes.xml", NULL);
}
+ userfile = g_build_filename (base_dir, "searches.xml", NULL);
+
g_object_set_data_full (G_OBJECT (search_context), "user", userfile, g_free);
g_object_set_data_full (G_OBJECT (search_context), "system", xmlfile, g_free);
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 067fadd21d..9dffb61b43 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -161,6 +161,7 @@ ensure_sources (CalendarComponent *component)
ESource *personal_source;
ESource *birthdays_source;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
gchar *create_source;
on_this_computer = NULL;
@@ -175,9 +176,8 @@ ensure_sources (CalendarComponent *component)
return;
}
- base_uri = g_build_filename (calendar_component_peek_base_directory (component),
- "calendar", "local",
- NULL);
+ base_dir = calendar_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -1726,10 +1726,8 @@ calendar_component_init (CalendarComponent *component)
priv = g_new0 (CalendarComponentPrivate, 1);
- priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL);
- priv->config_directory = g_build_filename (g_get_home_dir (),
- ".evolution", "calendar", "config",
- NULL);
+ priv->base_directory = g_build_filename (e_get_user_data_dir (), "calendar", NULL);
+ priv->config_directory = g_build_filename (priv->base_directory, "config", NULL);
/* EPFIXME: Should use a custom one instead? Also we should add
* calendar_component_peek_gconf_client(). */
diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c
index ab2a90f825..c62205fff5 100644
--- a/calendar/gui/e-memos.c
+++ b/calendar/gui/e-memos.c
@@ -1155,7 +1155,7 @@ e_memos_setup_view_menus (EMemos *memos, BonoboUIComponent *uic)
"memos",
NULL);
dir1 = g_build_filename (memos_component_peek_base_directory (memos_component_peek ()),
- "memos", "views", NULL);
+ "views", NULL);
gal_view_collection_set_storage_directories (collection,
dir0,
dir1);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index e955b7be32..5108164c98 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2386,7 +2386,7 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
"calendar",
NULL);
path1 = g_build_filename (calendar_component_peek_base_directory (calendar_component_peek ()),
- "calendar", "views", NULL);
+ "views", NULL);
gal_view_collection_set_storage_directories (collection,
path0,
path1);
diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c
index 2aa4d7313e..aed668e825 100644
--- a/calendar/gui/memos-component.c
+++ b/calendar/gui/memos-component.c
@@ -132,6 +132,7 @@ ensure_sources (MemosComponent *component)
ESourceGroup *on_the_web;
ESource *personal_source;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
on_this_computer = NULL;
on_the_web = NULL;
@@ -142,9 +143,8 @@ ensure_sources (MemosComponent *component)
return;
}
- base_uri = g_build_filename (memos_component_peek_base_directory (component),
- "memos", "local",
- NULL);
+ base_dir = memos_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -1388,10 +1388,8 @@ memos_component_init (MemosComponent *component, MemosComponentClass *klass)
priv = g_new0 (MemosComponentPrivate, 1);
- priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL);
- priv->config_directory = g_build_filename (g_get_home_dir (),
- ".evolution", "memos", "config",
- NULL);
+ priv->base_directory = g_build_filename (e_get_user_data_dir (), "memos", NULL);
+ priv->config_directory = g_build_filename (priv->base_directory, "config", NULL);
component->priv = priv;
ensure_sources (component);
diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c
index 5a798c8e74..5ac2547d9d 100644
--- a/calendar/gui/migration.c
+++ b/calendar/gui/migration.c
@@ -424,15 +424,15 @@ create_calendar_sources (CalendarComponent *component,
GSList *groups;
ESourceGroup *group;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
*on_this_computer = NULL;
*on_the_web = NULL;
*contacts = NULL;
*personal_source = NULL;
- base_uri = g_build_filename (calendar_component_peek_base_directory (component),
- "calendar", "local",
- NULL);
+ base_dir = calendar_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -535,13 +535,14 @@ create_task_sources (TasksComponent *component,
GSList *groups;
ESourceGroup *group;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
*on_this_computer = NULL;
*on_the_web = NULL;
*personal_source = NULL;
- base_uri = g_build_filename (tasks_component_peek_base_directory (component),
- "tasks", "local", NULL);
+ base_dir = tasks_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -851,7 +852,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis
old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Calendar", NULL);
new_path = g_build_filename (calendar_component_peek_base_directory (component),
- "calendar", "local", "system", NULL);
+ "local", "system", NULL);
migrate_pilot_data ("calendar", "calendar", old_path, new_path);
g_free (new_path);
g_free (old_path);
@@ -993,7 +994,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE
old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Tasks", NULL);
new_path = g_build_filename (tasks_component_peek_base_directory (component),
- "tasks", "local", "system", NULL);
+ "local", "system", NULL);
migrate_pilot_data ("tasks", "todo", old_path, new_path);
g_free (new_path);
g_free (old_path);
@@ -1048,13 +1049,14 @@ create_memo_sources (MemosComponent *component,
GSList *groups;
ESourceGroup *group;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
*on_this_computer = NULL;
*on_the_web = NULL;
*personal_source = NULL;
- base_uri = g_build_filename (memos_component_peek_base_directory (component),
- "memos", "local", NULL);
+ base_dir = memos_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -1146,6 +1148,7 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s
ESourceGroup *group;
ESource *source;
GSList *ids, *temp ;
+ GError *error = NULL;
char *relative_uri;
const char *soap_port;
const char * use_ssl;
@@ -1180,7 +1183,11 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s
e_source_set_color_spec (source, "#EEBC60");
e_source_group_add_source (group, source, -1);
- ids = gconf_client_get_list (client, CALENDAR_CONFIG_MEMOS_SELECTED_MEMOS, GCONF_VALUE_STRING, NULL);
+ ids = gconf_client_get_list (client, CALENDAR_CONFIG_MEMOS_SELECTED_MEMOS, GCONF_VALUE_STRING, &error);
+ if ( error != NULL ) {
+ g_warning("%s (%s) %s\n", G_STRLOC, G_STRFUNC, error->message);
+ g_error_free(error);
+ }
ids = g_slist_append (ids, g_strdup (e_source_peek_uid (source)));
gconf_client_set_list (client, CALENDAR_CONFIG_MEMOS_SELECTED_MEMOS, GCONF_VALUE_STRING, ids, NULL);
temp = ids;
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index e1b364c9fa..d843ffef1d 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -128,6 +128,7 @@ ensure_sources (TasksComponent *component)
ESourceGroup *on_the_web;
ESource *personal_source;
char *base_uri, *base_uri_proto;
+ const gchar *base_dir;
on_this_computer = NULL;
on_the_web = NULL;
@@ -138,9 +139,8 @@ ensure_sources (TasksComponent *component)
return;
}
- base_uri = g_build_filename (tasks_component_peek_base_directory (component),
- "tasks", "local",
- NULL);
+ base_dir = tasks_component_peek_base_directory (component);
+ base_uri = g_build_filename (base_dir, "local", NULL);
base_uri_proto = g_filename_to_uri (base_uri, NULL, NULL);
@@ -1449,10 +1449,8 @@ tasks_component_init (TasksComponent *component, TasksComponentClass *klass)
priv = g_new0 (TasksComponentPrivate, 1);
- priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL);
- priv->config_directory = g_build_filename (g_get_home_dir (),
- ".evolution", "tasks", "config",
- NULL);
+ priv->base_directory = g_build_filename (e_get_user_data_dir (), "tasks", NULL);
+ priv->config_directory = g_build_filename (priv->base_directory, "config", NULL);
component->priv = priv;
ensure_sources (component);