aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/menu.cpp9
-rw-r--r--src/planner-eds.cpp11
2 files changed, 12 insertions, 8 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index b2562db..797757f 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -261,20 +261,19 @@ private:
void add_appointments(GMenu* menu, Profile profile)
{
- int n = 0;
const int MAX_APPTS = 5;
std::set<std::string> added;
for (const auto& appt : m_upcoming)
{
- // don't show too many
- if (n++ >= MAX_APPTS)
- break;
-
// don't show duplicates
if (added.count(appt.uid))
continue;
+ // don't show too many
+ if (g_menu_model_get_n_items (G_MENU_MODEL(menu)) >= MAX_APPTS)
+ break;
+
added.insert(appt.uid);
GDateTime* begin = appt.begin();
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index ee023a4..da406eb 100644
--- a/src/planner-eds.cpp
+++ b/src/planner-eds.cpp
@@ -302,7 +302,11 @@ private:
ECalClient* client;
std::string color;
AppointmentSubtask(const std::shared_ptr<Task>& task_in, ECalClient* client_in, const char* color_in):
- task(task_in), client(client_in), color(color_in) {}
+ task(task_in), client(client_in)
+ {
+ if (color_in)
+ color = color_in;
+ }
};
void rebuild_soon(int rebuild_flags)
@@ -476,14 +480,15 @@ private:
e_cal_component_free_recur_list(recur_list);
ECalComponentText text;
- text.value = "";
+ text.value = nullptr;
e_cal_component_get_summary(component, &text);
+ if (text.value)
+ appointment.summary = text.value;
appointment.begin = DateTime(begin);
appointment.end = DateTime(end);
appointment.color = subtask->color;
appointment.is_event = vtype == E_CAL_COMPONENT_EVENT;
- appointment.summary = text.value;
appointment.uid = uid;
GList * alarm_uids = e_cal_component_get_alarm_uids(component);