aboutsummaryrefslogtreecommitdiff
path: root/src/planner-eds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/planner-eds.cpp')
-rw-r--r--src/planner-eds.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index a9eecf2..8eeca43 100644
--- a/src/planner-eds.cpp
+++ b/src/planner-eds.cpp
@@ -42,9 +42,12 @@ class PlannerEds::Impl
{
public:
- Impl(PlannerEds& owner, const std::shared_ptr<Clock>& clock):
+ Impl(PlannerEds& owner,
+ const std::shared_ptr<Clock>& clock,
+ const std::shared_ptr<Timezones>& timezones):
m_owner(owner),
m_clock(clock),
+ m_timezones(timezones),
m_cancellable(g_cancellable_new())
{
e_source_registry_new(m_cancellable, on_source_registry_ready, this);
@@ -363,7 +366,7 @@ private:
void rebuild_upcoming()
{
const auto ref = m_clock->localtime();
- const auto begin = g_date_time_add_minutes(ref.get(),-10);
+ const auto begin = g_date_time_add_days(ref.get(),-1);
const auto end = g_date_time_add_months(begin,1);
get_appointments(begin, end, [this](const std::vector<Appointment>& appointments) {
@@ -391,9 +394,7 @@ private:
**/
icaltimezone * default_timezone = nullptr;
-
- const auto tz = g_date_time_get_timezone_abbreviation(m_owner.time.get().get());
- g_debug("%s tz is %s", G_STRLOC, tz);
+ const auto tz = m_timezones->timezone.get().c_str();
if (tz && *tz)
{
default_timezone = icaltimezone_get_builtin_timezone(tz);
@@ -545,6 +546,7 @@ private:
PlannerEds& m_owner;
std::shared_ptr<Clock> m_clock;
+ std::shared_ptr<Timezones> m_timezones;
std::set<ESource*> m_sources;
std::map<ESource*,ECalClient*> m_clients;
std::map<ESource*,ECalClientView*> m_views;
@@ -555,7 +557,9 @@ private:
enum { UPCOMING=(1<<0), MONTH=(1<<1), ALL=UPCOMING|MONTH };
};
-PlannerEds::PlannerEds(const std::shared_ptr<Clock>& clock): p(new Impl(*this, clock)) {}
+PlannerEds::PlannerEds(const std::shared_ptr<Clock>& clock,
+ const std::shared_ptr<Timezones>& timezones):
+ p(new Impl(*this, clock, timezones)) {}
PlannerEds::~PlannerEds() =default;