aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar-commands.c')
-rw-r--r--calendar/gui/calendar-commands.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 850b5d95d9..a052b8ebf7 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -617,17 +617,14 @@ void calendar_set_uri (GnomeCalendar *gcal, char *calendar_file)
{
gboolean success;
- printf ("calendar_set_uri: calendar_file is '%s'\n",
- calendar_file ? calendar_file : "NULL");
+ g_return_if_fail (gcal);
+ g_return_if_fail (calendar_file);
- if (calendar_file && g_file_exists (calendar_file)) {
- printf ("loading calendar\n");
- success = gnome_calendar_load (gcal, calendar_file);
- }
- else {
- printf ("creating calendar\n");
- success = gnome_calendar_create (gcal, calendar_file);
- }
+ printf ("calendar_set_uri: calendar_file is '%s'\n", calendar_file);
+
+ success = gnome_calendar_open (gcal,
+ calendar_file,
+ CALENDAR_OPEN_OR_CREATE);
printf (" load or create returned %d\n", success);
}