commit f657f6afabd4265f77093424ba004f6927636640
parent 3e50482cef55c10e65fe381d5db2bb4a05535e2f
Author: William Casarin <jb55@jb55.com>
Date: Wed, 18 Sep 2019 14:34:28 -0700
move save_calendar
Diffstat:
M | viscal.c | | | 34 | ++++++++++++++++++---------------- |
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/viscal.c b/viscal.c
@@ -1206,6 +1206,24 @@ static void open_below(struct cal *cal)
insert_event(cal, et, push_to, ev->ical);
}
+
+static void save_calendar(struct ical *calendar)
+{
+ // TODO: caldav saving
+ assert(calendar->source == SOURCE_FILE);
+ printf("DEBUG saving %s\n", calendar->source_location);
+
+ const char *str =
+ icalcomponent_as_ical_string_r(calendar->calendar);
+
+ FILE *fd = fopen(calendar->source_location, "w+");
+
+ fwrite(str, strlen(str), 1, fd);
+
+ fclose(fd);
+}
+
+
static void finish_editing(struct cal *cal)
{
struct event *event = get_selected_event(cal);
@@ -1301,22 +1319,6 @@ static void move_event_action(struct cal *cal, int direction)
move_event(event, direction * cal->repeat * SMALLEST_TIMEBLOCK);
}
-static void save_calendar(struct ical *calendar)
-{
- // TODO: caldav saving
- assert(calendar->source == SOURCE_FILE);
- printf("DEBUG saving %s\n", calendar->source_location);
-
- const char *str =
- icalcomponent_as_ical_string_r(calendar->calendar);
-
- FILE *fd = fopen(calendar->source_location, "w+");
-
- fwrite(str, strlen(str), 1, fd);
-
- fclose(fd);
-}
-
static void save_calendars(struct cal *cal)
{
printf("DEBUG saving calendars\n");