~khurshid-alam/indicator-datetime/zesty

« back to all changes in this revision

Viewing changes to debian/patches/show_in-progress_events.patch

  • Committer: Khurshid Alam
  • Date: 2017-03-08 04:24:30 UTC
  • Revision ID: khurshid.alam@linuxmail.org-20170308042430-171mwzi0k70qfgta
Trying ol patch for trunk 16.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
     Menu (Profile profile_in, const std::string& name_in);
12
12
--- a/src/menu.cpp
13
13
+++ b/src/menu.cpp
14
 
@@ -227,8 +227,8 @@
 
14
@@ -226,14 +226,15 @@
 
15
         // we pick events starting from the beginning of that clicked day.
15
16
         const auto now = m_state->clock->localtime();
16
17
         const auto calendar_day = m_state->calendar_month->month().get();
17
 
         const auto begin = DateTime::is_same_day(now, calendar_day)
 
18
-        const auto begin = DateTime::is_same_day(now, calendar_day)
18
19
-            ? now.start_of_minute()
19
20
-            : calendar_day.start_of_day();
20
 
+            ? calendar_day.start_of_day()
21
 
+            : now.start_of_minute();
22
 
 
23
 
         auto upcoming = get_display_appointments(
24
 
             m_state->calendar_upcoming->appointments().get(),
 
21
+        if ((profile() == Desktop) && !DateTime::is_same_day(now, calendar_day))
 
22
+            begin = calendar_day.start_of_day();
 
23
+        else
 
24
+            begin = now.start_of_minute();
 
25
 
 
26
-        auto upcoming = get_display_appointments(
 
27
-            m_state->calendar_upcoming->appointments().get(),
 
28
-            begin
 
29
-        );
 
30
+        std::vector<Appointment> upcoming;
 
31
+        for(const auto& a : m_state->calendar_upcoming->appointments().get())
 
32
+            if (begin <= a.end)
 
33
+                upcoming.push_back(a);
 
34
 
 
35
         if (m_upcoming != upcoming)
 
36
         {