diff options
author | JP Rosevear <jpr@ximian.com> | 2002-05-08 04:17:07 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-05-08 04:17:07 +0800 |
commit | 65d69a92f1ee494743b9207a38ff7285848f37d3 (patch) | |
tree | 9d48dadc2138ce3a878ea289162f5a7192fc56e6 /calendar/cal-util/cal-util.c | |
parent | 2017b2dcec910cc90d771fc2c124828e3c122014 (diff) | |
download | gsoc2013-evolution-65d69a92f1ee494743b9207a38ff7285848f37d3.tar.gz gsoc2013-evolution-65d69a92f1ee494743b9207a38ff7285848f37d3.tar.zst gsoc2013-evolution-65d69a92f1ee494743b9207a38ff7285848f37d3.zip |
start a server a uri (start_default_server): start a default server
2002-05-07 JP Rosevear <jpr@ximian.com>
* gui/e-itip-control.c (start_calendar_server): start a server a
uri
(start_default_server): start a default server
(get_servers): get all clients for all folders of the given
type(s)
(find_server): locate a server for a particular uid
(init): get_servers, listen for object_requested signal
(destroy): destroy all clients
(write_html): put options is there own cell
(get_publish_options): place selector in if param is true
(get_request_options): ditto
(get_real_item): only try and look up the item if we know its in
the server
(show_current_event): find the server (if any) for the current
comp
(show_current_todo): ditto
(update_attendee_status): if there is no server for the comp, it
doesn't exist
(remove_item): ditto
(button_selected_cb): get a client for the selected folder
(object_requested_cb): draw the folder button in
* gui/calendar-config.h: new protos
* gui/calendar-config.c (calendar_config_default_tasks_folder):
get default tasks uri
(calendar_config_default_calendar_folder): get default calendar
uri
* cal-client/cal-client.c (get_default_uri): use
cal_util_expand_uri
* cal-util/cal-util.h: new proto
* cal-util/cal-util.c (cal_util_expand_uri): tack on the file name
if its a file uri
svn path=/trunk/; revision=16709
Diffstat (limited to 'calendar/cal-util/cal-util.c')
-rw-r--r-- | calendar/cal-util/cal-util.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c index a30329c638..8ba1ff7d63 100644 --- a/calendar/cal-util/cal-util.c +++ b/calendar/cal-util/cal-util.c @@ -21,9 +21,11 @@ #include <config.h> #include <stdlib.h> +#include <string.h> #include <glib.h> #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> +#include <libgnome/gnome-util.h> #include "cal-util.h" @@ -528,3 +530,31 @@ cal_util_priority_from_string (const char *string) return priority; } + +char * +cal_util_expand_uri (char *uri, gboolean tasks) +{ + char *file_uri, *file_name; + + if (!strncmp (uri, "file://", 7)) { + file_uri = uri + 7; + if (strlen (file_uri) > 4 + && !strcmp (file_uri + strlen (file_uri) - 4, ".ics")) { + + /* it's a .ics file */ + return g_strdup (uri); + } + + /* we assume it's a dir and glom <type>.ics onto the end. */ + if (tasks) + file_name = g_concat_dir_and_file (file_uri, "tasks.ics"); + else + file_name = g_concat_dir_and_file (file_uri, "calendar.ics"); + file_uri = g_strdup_printf("file://%s", file_name); + g_free(file_name); + } else { + file_uri = g_strdup (uri); + } + + return file_uri; +} |