aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-02-14 21:02:59 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-02-14 21:02:59 +0800
commit378a7c56b720dd4240d192c859737ea19e709fbf (patch)
tree45f82ede882ca6ad9fa16e0a059e4a0140e7ec03 /calendar/gui/gnome-cal.c
parentde5b206ef73db4f87f19ae4e5b943c28334425a8 (diff)
downloadgsoc2013-evolution-378a7c56b720dd4240d192c859737ea19e709fbf.tar.gz
gsoc2013-evolution-378a7c56b720dd4240d192c859737ea19e709fbf.tar.zst
gsoc2013-evolution-378a7c56b720dd4240d192c859737ea19e709fbf.zip
don't append 'calendar.ics' to the URI. (get_prop): finished.
2002-02-13 Rodrigo Moya <rodrigo@ximian.com> * gui/control-factory.c (set_prop): don't append 'calendar.ics' to the URI. (get_prop): finished. * gui/tasks-control.c (tasks_control_set_property): don't append 'tasks.ics' to the URI. (tasks_control_get_property): finished. * gui/gnome-cal.c (gnome_calendar_open): * gui/e-tasks.c (e_tasks_open): append $filename.ics to the uri to be opened if the uri is local. Leave intact in other cases. svn path=/trunk/; revision=15724
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 8d75a39c75..0799c6a218 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1847,6 +1847,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
gboolean success;
EUri *uri;
char *message;
+ char *real_uri;
g_return_val_if_fail (gcal != NULL, FALSE);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
@@ -1862,20 +1863,28 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
cal_client_get_load_state (priv->task_pad_client) == CAL_CLIENT_LOAD_NOT_LOADED,
FALSE);
- message = g_strdup_printf (_("Opening calendar at %s"), str_uri);
+ uri = e_uri_new (str_uri);
+ if (!uri || !g_strncasecmp (uri->protocol, "file", 4))
+ real_uri = g_concat_dir_and_file (str_uri, "calendar.ics");
+ else
+ real_uri = g_strdup (str_uri);
+
+ message = g_strdup_printf (_("Opening calendar at %s"), real_uri);
e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), message);
g_free (message);
- if (!cal_client_open_calendar (priv->client, str_uri, FALSE)) {
+ if (!cal_client_open_calendar (priv->client, real_uri, FALSE)) {
g_message ("gnome_calendar_open(): Could not issue the request");
+ g_free (real_uri);
+ e_uri_free (uri);
+
return FALSE;
}
- add_alarms (str_uri);
+ add_alarms (real_uri);
/* Open the appropriate Tasks folder to show in the TaskPad */
- uri = e_uri_new (str_uri);
if (!uri) {
tasks_uri = g_strdup_printf ("%s/local/Tasks/tasks.ics", evolution_dir);
success = cal_client_open_calendar (priv->task_pad_client, tasks_uri, FALSE);
@@ -1912,9 +1921,11 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
success = TRUE;
}
- e_uri_free (uri);
}
+ g_free (real_uri);
+ e_uri_free (uri);
+
if (!success) {
g_message ("gnome_calendar_open(): Could not issue the request");
return FALSE;