aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-04-20 00:55:59 +0800
committerSeth Alves <alves@src.gnome.org>2000-04-20 00:55:59 +0800
commitd8e30fdcb380d2a715a915c8278a024c07c12815 (patch)
tree02b3d0230362f550ed5197663922e65e6d67879a /calendar/gui/calendar-commands.c
parentd3a3dd69a846a5642d7b66294410fb671a498ec0 (diff)
downloadgsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar.gz
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar.bz2
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar.lz
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar.xz
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.tar.zst
gsoc2013-evolution-d8e30fdcb380d2a715a915c8278a024c07c12815.zip
calls gnome_calendar_open instead of checking on disk and calling load or
* gui/calendar-commands.c (calendar_set_uri): calls gnome_calendar_open instead of checking on disk and calling load or create. * gui/gnome-cal.c (gnome_calendar_open): collapsed gnome_calendar_load and gnome_calendar_create into this function. added new type GnomeCalendarOpenMode which has the value CALENDAR_OPEN or CALENDAR_OPEN_OR_CREATE. svn path=/trunk/; revision=2506
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);
}