diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/planner.cpp | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2852a75..512cc5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,6 +25,7 @@ set (SERVICE_CXX_SOURCES locations-settings.cpp menu.cpp notifications.cpp + planner.cpp planner-aggregate.cpp planner-snooze.cpp planner-month.cpp diff --git a/src/planner.cpp b/src/planner.cpp index 3f73030..15dab52 100644 --- a/src/planner.cpp +++ b/src/planner.cpp @@ -19,6 +19,8 @@ #include <datetime/planner.h> +#include <algorithm> + namespace unity { namespace indicator { namespace datetime { @@ -35,6 +37,7 @@ Planner::~Planner() { } +#if 0 void Planner::set_range_to_calendar_month(const DateTime& dt) { @@ -59,6 +62,7 @@ Planner::set_range_to_upcoming_month(const DateTime& begin) end.format(fmt).c_str()); range().set(std::make_pair(begin,end)); } +#endif void Planner::sort(std::vector<Appointment>& appts) @@ -73,9 +77,9 @@ Planner::trim(std::vector<Appointment>& appts, const DateTime& begin, const DateTime& end) { - decltype(appts) tmp; - auto predicate = [begin,end](const Appointment& a){return begin<=a.begin && a.begin<=end;} - std::copy(std::begin(appts), std::end(appts), std::back_inserter(tmp), predicate); + std::vector<Appointment> tmp; + auto predicate = [begin,end](const Appointment& a){return begin<=a.begin && a.begin<=end;}; + std::copy_if(std::begin(appts), std::end(appts), std::back_inserter(tmp), predicate); appts.swap(tmp); } |