/*
- * Display today's events.
+ * Display today's events. Returns the number of items displayed.
*/
-void calendar_summary_view(void) {
+int calendar_summary_view(void) {
long hklen;
const char *HashKey;
void *vCal;
int all_day_event = 0;
char timestring[SIZ];
wcsession *WCC = WC;
+ int num_displayed = 0;
if (GetCount(WC->disp_cal_items) == 0) {
- return;
+ return(0);
}
now = time(NULL);
wprintf(" (%s)", timestring);
}
wprintf("</a><br />\n");
+ ++num_displayed;
}
}
}
}
DeleteHashPos(&Pos);
DeleteHash(&WC->disp_cal_items);
+ return(num_displayed);
}
/*
num_msgs = load_msg_ptrs("MSGS ALL", 0);
}
- if (num_msgs < 1) {
- wprintf("<i>");
- wprintf(_("(None)"));
- wprintf("</i><br />\n");
- }
- else {
+ if (num_msgs > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
}
}
- calendar_summary_view();
+ if (calendar_summary_view() < 1) {
+ wprintf("<i>");
+ wprintf(_("(None)"));
+ wprintf("</i><br />\n");
+ }
}
parse_calendar_view_request(&c);
- if (num_msgs < 1) {
- wprintf("<i>");
- wprintf(_("(Nothing)"));
- wprintf("</i><br />\n");
- }
- else {
+ if (num_msgs > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
load_calendar_item(Msg, 0, &c);
}
- calendar_summary_view();
+ }
+ if (calendar_summary_view() < 1) {
+ wprintf("<i>");
+ wprintf(_("(Nothing)"));
+ wprintf("</i><br />\n");
}
}
void parse_calendar_view_request(struct calview *c);
void render_calendar_view(struct calview *c);
void do_tasks_view(void);
-void calendar_summary_view(void);
+int calendar_summary_view(void);
void free_march_list(wcsession *wcf);
void display_rules_editor_inner_div(void);
void generate_uuid(char *);