commit b5f2347058a0a06a0bd0b9abbe12d336e3d7c05b
parent bf8d5e1be36fdb69c3c83cec6c602e768dee14f7
Author: Dominik Schmidt <das1993@hotmail.com>
Date: Thu, 3 Sep 2015 00:22:48 +0200
Make CalendarList.run return true if there has been some entries.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dcalendar.d b/dcalendar.d
@@ -36,13 +36,16 @@ struct CalendarList{
void add(string filename){
calendars~=new Calendar(filename);
}
- void run(inout SysTime t, void delegate(char[]) f){
+ bool run(inout SysTime t, void delegate(char[]) f){
+ bool ret=false;
foreach(ref Calendar c; calendars){
c.open();
foreach(char[] s; c.getEntries(t)){
+ ret=true;
f(s);
}
c.close();
}
+ return ret;
}
}