aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-04-11 00:58:14 +0800
committerDan Winship <danw@src.gnome.org>2002-04-11 00:58:14 +0800
commit6ee39cc8619bf63082159433397875df30180fb1 (patch)
tree4b083f4d0cf306a95bfcc82916df9c341a595932 /calendar/gui
parentc5ac2a9e510fa9e53683e4f270c82e0296da8043 (diff)
downloadgsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar.gz
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar.bz2
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar.lz
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar.xz
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.tar.zst
gsoc2013-evolution-6ee39cc8619bf63082159433397875df30180fb1.zip
Use new-and-improved default folder URI config paths.
* cal-client/cal-client.c (get_default_uri): Use new-and-improved default folder URI config paths. * gui/calendar-config.c (calendar_config_{get,set}_default_uri, calendar_config_{get,set}_default_tasks_uri): Remove these. The shell owns this information now. (Weren't being used anyway.) * gui/component-factory.c (get_data_uri): Fix another place that hardcoded tacking foo.ics on to the end of URLs. svn path=/trunk/; revision=16421
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-component.c2
-rw-r--r--calendar/gui/calendar-config.c86
-rw-r--r--calendar/gui/calendar-config.h7
-rw-r--r--calendar/gui/component-factory.c2
4 files changed, 4 insertions, 93 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index a9cc8a89f9..b4a2b3ab89 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -506,6 +506,8 @@ static char *
get_data_uri (const char *uri, CalComponentVType vtype)
{
if (uri) {
+ if (*uri != '/' && strncmp (uri, "file:", 5) != 0)
+ return g_strdup (uri);
if (vtype == CAL_COMPONENT_EVENT)
return g_concat_dir_and_file (uri, "calendar.ics");
else if (vtype == CAL_COMPONENT_TODO)
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 80f7f856d8..0237766ea8 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -45,8 +45,6 @@
typedef struct
{
- gchar *default_uri;
- gchar *default_tasks_uri;
gchar *timezone;
CalWeekdays working_days;
gboolean use_24_hour_format;
@@ -129,26 +127,6 @@ config_read (void)
CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
- config->default_uri = bonobo_config_get_string (db,
- "/Calendar/DefaultUri", &ev);
- if (BONOBO_USER_EX (&ev, ex_Bonobo_ConfigDatabase_NotFound))
- config->default_uri = NULL;
- else if (BONOBO_EX (&ev))
- g_message ("config_read(): Could not get the /Calendar/DefaultUri");
-
- CORBA_exception_free (&ev);
-
- CORBA_exception_init (&ev);
- config->default_tasks_uri = bonobo_config_get_string (db,
- "/Calendar/DefaultTasksUri", &ev);
- if (BONOBO_USER_EX (&ev, ex_Bonobo_ConfigDatabase_NotFound))
- config->default_tasks_uri = NULL;
- else if (BONOBO_EX (&ev))
- g_message ("config_read(): Could not get the /Calendar/DefaultTasksUri");
-
- CORBA_exception_free (&ev);
-
/* Default to UTC if the timezone is not set or is "". */
config->timezone = bonobo_config_get_string_with_default (db,
"/Calendar/Display/Timezone", "UTC", NULL);
@@ -309,14 +287,6 @@ calendar_config_write (void)
return;
}
- if (config->default_uri)
- bonobo_config_set_string (db, "/Calendar/DefaultUri",
- config->default_uri, NULL);
-
- if (config->default_tasks_uri)
- bonobo_config_set_string (db, "/Calendar/DefaultTasksUri",
- config->default_tasks_uri, NULL);
-
if (config->timezone)
bonobo_config_set_string (db, "/Calendar/Display/Timezone",
config->timezone, NULL);
@@ -422,62 +392,6 @@ calendar_config_write_on_exit (void)
* Calendar Settings.
*/
-/* The default URI is the one that will be used in places where there
- might be some action on a calendar from outside, such as adding
- a meeting request. */
-gchar *
-calendar_config_get_default_uri (void)
-{
- static gchar *default_uri = NULL;
-
- if (config->default_uri)
- return config->default_uri;
-
- if (!default_uri)
- default_uri = g_strdup_printf ("%s/evolution/local/Calendar/calendar.ics",
- g_get_home_dir ());
-
- return default_uri;
-}
-
-/* Sets the default calendar URI */
-void
-calendar_config_set_default_uri (gchar *default_uri)
-{
- g_free (config->default_uri);
-
- if (default_uri && default_uri[0])
- config->default_uri = g_strdup (default_uri);
- else
- config->default_uri = NULL;
-}
-
-gchar *
-calendar_config_get_default_tasks_uri (void)
-{
- static gchar *default_tasks_uri = NULL;
-
- if (config->default_tasks_uri)
- return config->default_tasks_uri;
-
- if (!default_tasks_uri)
- default_tasks_uri = g_strdup_printf ("%s/evolution/local/Tasks/tasks.ics",
- g_get_home_dir ());
-
- return default_tasks_uri;
-}
-
-void
-calendar_config_set_default_tasks_uri (gchar *default_tasks_uri)
-{
- g_free (config->default_tasks_uri);
-
- if (default_tasks_uri && default_tasks_uri[0])
- config->default_tasks_uri = g_strdup (default_tasks_uri);
- else
- config->default_tasks_uri = NULL;
-}
-
/* The current timezone, e.g. "Europe/London". It may be NULL, in which case
you should assume UTC (though Evolution will show the timezone-setting
dialog the next time a calendar or task folder is selected). */
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
index 83f21d3f0b..8c5f867a38 100644
--- a/calendar/gui/calendar-config.h
+++ b/calendar/gui/calendar-config.h
@@ -69,13 +69,6 @@ void calendar_config_write_on_exit (void);
* Calendar Settings.
*/
-/* The default calendar URI to be used when no specified (~/evolution/local/Calendar) */
-gchar* calendar_config_get_default_uri (void);
-void calendar_config_set_default_uri (gchar *default_uri);
-
-gchar* calendar_config_get_default_tasks_uri (void);
-void calendar_config_set_default_tasks_uri (gchar *default_tasks_uri);
-
/* The current timezone, e.g. "Europe/London". */
gchar* calendar_config_get_timezone (void);
void calendar_config_set_timezone (gchar *timezone);
diff --git a/calendar/gui/component-factory.c b/calendar/gui/component-factory.c
index a9cc8a89f9..b4a2b3ab89 100644
--- a/calendar/gui/component-factory.c
+++ b/calendar/gui/component-factory.c
@@ -506,6 +506,8 @@ static char *
get_data_uri (const char *uri, CalComponentVType vtype)
{
if (uri) {
+ if (*uri != '/' && strncmp (uri, "file:", 5) != 0)
+ return g_strdup (uri);
if (vtype == CAL_COMPONENT_EVENT)
return g_concat_dir_and_file (uri, "calendar.ics");
else if (vtype == CAL_COMPONENT_TODO)