"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libedataserverui/e-reminders-widget.c" between
evolution-data-server-3.32.4.tar.xz and evolution-data-server-3.34.0.tar.xz

About: Evolution-Data-Server manages access to the calendar, tasks and addressbook information available for Evolution and other applications.

e-reminders-widget.c  (evolution-data-server-3.32.4.tar.xz):e-reminders-widget.c  (evolution-data-server-3.34.0.tar.xz)
skipping to change at line 265 skipping to change at line 265
gchar **out_overdue_markup, gchar **out_overdue_markup,
gchar **out_description_markup) gchar **out_description_markup)
{ {
g_return_if_fail (rd != NULL); g_return_if_fail (rd != NULL);
if (out_overdue_markup) { if (out_overdue_markup) {
gint64 diff; gint64 diff;
gboolean in_future; gboolean in_future;
gchar *time_str; gchar *time_str;
diff = (g_get_real_time () / G_USEC_PER_SEC) - ((gint64) rd->inst ance.occur_start); diff = (g_get_real_time () / G_USEC_PER_SEC) - ((gint64) e_cal_co mponent_alarm_instance_get_occur_start (e_reminder_data_get_instance (rd)));
in_future = diff < 0; in_future = diff < 0;
if (in_future) if (in_future)
diff = (-1) * diff; diff = (-1) * diff;
/* in minutes */ /* in minutes */
if (in_future && (diff % 60) > 0) if (in_future && (diff % 60) > 0)
diff += 60; diff += 60;
diff = diff / 60; diff = diff / 60;
skipping to change at line 483 skipping to change at line 483
reminders->priv->is_mapped = FALSE; reminders->priv->is_mapped = FALSE;
reminders_widget_maybe_schedule_overdue_update (reminders); reminders_widget_maybe_schedule_overdue_update (reminders);
} }
static gint static gint
reminders_sort_by_occur (gconstpointer ptr1, reminders_sort_by_occur (gconstpointer ptr1,
gconstpointer ptr2) gconstpointer ptr2)
{ {
const EReminderData *rd1 = ptr1, *rd2 = ptr2; const EReminderData *rd1 = ptr1, *rd2 = ptr2;
const ECalComponentAlarmInstance *inst1, *inst2;
gint cmp; gint cmp;
if (!rd1 || !rd2) if (!rd1 || !rd2)
return rd1 == rd2 ? 0 : rd1 ? 1 : -1; return rd1 == rd2 ? 0 : rd1 ? 1 : -1;
if (rd1->instance.occur_start != rd2->instance.occur_start) inst1 = e_reminder_data_get_instance (rd1);
return rd1->instance.occur_start < rd2->instance.occur_start ? -1 inst2 = e_reminder_data_get_instance (rd2);
: 1;
if (rd1->instance.trigger != rd2->instance.trigger) if (!inst1 || !inst2)
return rd1->instance.trigger < rd2->instance.trigger ? -1 : 1; return inst1 == inst2 ? 0 : inst1 ? 1 : -1;
cmp = g_strcmp0 (rd1->source_uid, rd2->source_uid); if (e_cal_component_alarm_instance_get_occur_start (inst1) != e_cal_compo
nent_alarm_instance_get_occur_start (inst2))
return e_cal_component_alarm_instance_get_occur_start (inst1) < e
_cal_component_alarm_instance_get_occur_start (inst2) ? -1 : 1;
if (e_cal_component_alarm_instance_get_time (inst1) != e_cal_component_al
arm_instance_get_time (inst2))
return e_cal_component_alarm_instance_get_time (inst1) < e_cal_co
mponent_alarm_instance_get_time (inst2) ? -1 : 1;
cmp = g_strcmp0 (e_reminder_data_get_source_uid (rd1), e_reminder_data_ge
t_source_uid (rd2));
if (!cmp) if (!cmp)
cmp = g_strcmp0 (rd1->instance.auid, rd2->instance.auid); cmp = g_strcmp0 (e_cal_component_alarm_instance_get_uid (inst1), e_cal_component_alarm_instance_get_uid (inst2));
return cmp; return cmp;
} }
static void static void
reminders_widget_set_is_empty (ERemindersWidget *reminders, reminders_widget_set_is_empty (ERemindersWidget *reminders,
gboolean is_empty) gboolean is_empty)
{ {
g_return_if_fail (E_IS_REMINDERS_WIDGET (reminders)); g_return_if_fail (E_IS_REMINDERS_WIDGET (reminders));
skipping to change at line 616 skipping to change at line 623
past = e_reminder_watcher_dup_past (reminders->priv->watcher); past = e_reminder_watcher_dup_past (reminders->priv->watcher);
if (past) { if (past) {
GSList *link; GSList *link;
GtkTreeIter iter; GtkTreeIter iter;
past = g_slist_sort (past, reminders_sort_by_occur); past = g_slist_sort (past, reminders_sort_by_occur);
for (link = past; link; link = g_slist_next (link)) { for (link = past; link; link = g_slist_next (link)) {
const EReminderData *rd = link->data; const EReminderData *rd = link->data;
gchar *overdue = NULL, *description = NULL; gchar *overdue = NULL, *description = NULL;
if (!rd || !rd->component) if (!rd || !e_reminder_data_get_component (rd))
continue; continue;
reminders_get_reminder_markups (reminders, rd, &overdue, &description); reminders_get_reminder_markups (reminders, rd, &overdue, &description);
gtk_list_store_append (list_store, &iter); gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter, gtk_list_store_set (list_store, &iter,
E_REMINDERS_WIDGET_COLUMN_OVERDUE, overdue, E_REMINDERS_WIDGET_COLUMN_OVERDUE, overdue,
E_REMINDERS_WIDGET_COLUMN_DESCRIPTION, descriptio n, E_REMINDERS_WIDGET_COLUMN_DESCRIPTION, descriptio n,
E_REMINDERS_WIDGET_COLUMN_REMINDER_DATA, rd, E_REMINDERS_WIDGET_COLUMN_REMINDER_DATA, rd,
-1); -1);
skipping to change at line 874 skipping to change at line 881
if (rd) { if (rd) {
gboolean result = FALSE; gboolean result = FALSE;
g_signal_emit (reminders, signals[ACTIVATED], 0, rd, &res ult); g_signal_emit (reminders, signals[ACTIVATED], 0, rd, &res ult);
if (!result) { if (!result) {
const gchar *scheme = NULL; const gchar *scheme = NULL;
const gchar *comp_uid = NULL; const gchar *comp_uid = NULL;
e_cal_component_get_uid (rd->component, &comp_uid ); comp_uid = e_cal_component_get_uid (e_reminder_da ta_get_component (rd));
switch (e_cal_component_get_vtype (rd->component) ) { switch (e_cal_component_get_vtype (e_reminder_dat a_get_component (rd))) {
case E_CAL_COMPONENT_EVENT: case E_CAL_COMPONENT_EVENT:
scheme = "calendar:"; scheme = "calendar:";
break; break;
case E_CAL_COMPONENT_TODO: case E_CAL_COMPONENT_TODO:
scheme = "task:"; scheme = "task:";
break; break;
case E_CAL_COMPONENT_JOURNAL: case E_CAL_COMPONENT_JOURNAL:
scheme = "memo:"; scheme = "memo:";
break; break;
default: default:
break; break;
} }
if (scheme && comp_uid && rd->source_uid) { if (scheme && comp_uid && e_reminder_data_get_sou rce_uid (rd)) {
GString *uri; GString *uri;
gchar *tmp; gchar *tmp;
GError *error = NULL; GError *error = NULL;
uri = g_string_sized_new (128); uri = g_string_sized_new (128);
g_string_append (uri, scheme); g_string_append (uri, scheme);
g_string_append (uri, "///?"); g_string_append (uri, "///?");
tmp = g_uri_escape_string (rd->source_uid , NULL, TRUE); tmp = g_uri_escape_string (e_reminder_dat a_get_source_uid (rd), NULL, TRUE);
g_string_append (uri, "source-uid="); g_string_append (uri, "source-uid=");
g_string_append (uri, tmp); g_string_append (uri, tmp);
g_free (tmp); g_free (tmp);
g_string_append (uri, "&"); g_string_append_c (uri, '&');
tmp = g_uri_escape_string (comp_uid, NULL , TRUE); tmp = g_uri_escape_string (comp_uid, NULL , TRUE);
g_string_append (uri, "comp-uid="); g_string_append (uri, "comp-uid=");
g_string_append (uri, tmp); g_string_append (uri, tmp);
g_free (tmp); g_free (tmp);
if (!g_app_info_launch_default_for_uri (u ri->str, NULL, &error) && if (!g_app_info_launch_default_for_uri (u ri->str, NULL, &error) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) { !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) {
gchar *prefix = g_strdup_printf ( _("Failed to launch URI ā€œ%sā€:"), uri->str); gchar *prefix = g_strdup_printf ( _("Failed to launch URI ā€œ%sā€:"), uri->str);
e_reminders_widget_report_error ( reminders, prefix, error); e_reminders_widget_report_error ( reminders, prefix, error);
skipping to change at line 1802 skipping to change at line 1809
if (reminders->priv->info_bar) { if (reminders->priv->info_bar) {
gtk_widget_destroy (GTK_WIDGET (reminders->priv->info_bar)); gtk_widget_destroy (GTK_WIDGET (reminders->priv->info_bar));
reminders->priv->info_bar = NULL; reminders->priv->info_bar = NULL;
} }
reminders->priv->info_bar = GTK_INFO_BAR (gtk_info_bar_new ()); reminders->priv->info_bar = GTK_INFO_BAR (gtk_info_bar_new ());
gtk_info_bar_set_message_type (reminders->priv->info_bar, GTK_MESSAGE_ERR OR); gtk_info_bar_set_message_type (reminders->priv->info_bar, GTK_MESSAGE_ERR OR);
gtk_info_bar_set_show_close_button (reminders->priv->info_bar, TRUE); gtk_info_bar_set_show_close_button (reminders->priv->info_bar, TRUE);
label = GTK_LABEL (gtk_label_new (message)); label = GTK_LABEL (gtk_label_new (message));
gtk_label_set_width_chars (label, 20);
gtk_label_set_max_width_chars (label, 120); gtk_label_set_max_width_chars (label, 120);
gtk_label_set_line_wrap (label, TRUE); gtk_label_set_line_wrap (label, TRUE);
gtk_label_set_selectable (label, TRUE); gtk_label_set_selectable (label, TRUE);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (reminder s->priv->info_bar)), GTK_WIDGET (label)); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (reminder s->priv->info_bar)), GTK_WIDGET (label));
gtk_widget_show (GTK_WIDGET (label)); gtk_widget_show (GTK_WIDGET (label));
gtk_widget_show (GTK_WIDGET (reminders->priv->info_bar)); gtk_widget_show (GTK_WIDGET (reminders->priv->info_bar));
g_signal_connect (reminders->priv->info_bar, "response", G_CALLBACK (remi nders_widget_error_response_cb), reminders); g_signal_connect (reminders->priv->info_bar, "response", G_CALLBACK (remi nders_widget_error_response_cb), reminders);
gtk_grid_attach (GTK_GRID (reminders), GTK_WIDGET (reminders->priv->info_ bar), 0, 2, 1, 1); gtk_grid_attach (GTK_GRID (reminders), GTK_WIDGET (reminders->priv->info_ bar), 0, 2, 1, 1);
 End of changes. 13 change blocks. 
14 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)