129
129
update_row (KotoTaskStore *store, icalcomponent *ical, gboolean insert, GtkTreeIter *iter)
131
131
icalproperty_status status;
133
132
icaltimetype due_time;
134
133
GDate *due_date = NULL;
135
char **categories = NULL;
137
136
g_assert (KOTO_IS_TASK_STORE (store));
147
146
icaltimezone_get_utc_timezone ()));
150
prop = icalcomponent_get_first_property (ical, ICAL_CATEGORIES_PROPERTY);
152
categories = g_strsplit (icalproperty_get_categories (prop), ",", 0);
153
icalproperty_free (prop);
149
task = koto_task_new (icalcomponent_new_clone (ical));
157
152
gtk_list_store_insert_with_values (GTK_LIST_STORE (store), iter, 0,
158
COLUMN_ICAL, koto_task_new (icalcomponent_new_clone (ical)),
159
154
COLUMN_DONE, status == ICAL_STATUS_COMPLETED,
160
155
COLUMN_PRIORITY, ical_util_get_priority (ical),
161
156
COLUMN_WEIGHT, get_weight (ical_util_get_priority (ical), due_time),
162
157
COLUMN_DUE, due_date,
163
158
COLUMN_SUMMARY, icalcomponent_get_summary (ical),
164
COLUMN_DESCRIPTION, icalcomponent_get_description (ical),
165
COLUMN_CATEGORY, categories,
166
159
COLUMN_URL, ical_util_get_url (ical),
169
162
gtk_list_store_set (GTK_LIST_STORE (store), iter,
170
COLUMN_ICAL, koto_task_new (icalcomponent_new_clone (ical)),
171
164
COLUMN_DONE, status == ICAL_STATUS_COMPLETED,
172
165
COLUMN_PRIORITY, ical_util_get_priority (ical),
173
166
COLUMN_WEIGHT, get_weight (ical_util_get_priority (ical), due_time),
174
167
COLUMN_DUE, due_date,
175
168
COLUMN_SUMMARY, icalcomponent_get_summary (ical),
176
COLUMN_DESCRIPTION, icalcomponent_get_description (ical),
177
COLUMN_CATEGORY, categories,
178
169
COLUMN_URL, ical_util_get_url (ical),
182
g_strfreev (categories);
184
174
g_date_free (due_date);
175
koto_task_unref (task);
338
329
G_TYPE_INT, /* priority */
339
330
G_TYPE_DATE, /* due */
340
331
G_TYPE_STRING, /* summary */
341
G_TYPE_STRING, /* description */
342
G_TYPE_STRV, /* categories */
343
332
G_TYPE_STRING, /* URL */
395
384
priv->view = g_object_ref (view);
396
priv->cal = g_object_ref (g_object_get_data (G_OBJECT (view), "koto-ecal"));
385
priv->cal = g_object_get_data (G_OBJECT (view), "koto-ecal");
387
g_object_ref (priv->cal);
397
388
priv->sig_added = g_signal_connect (priv->view, "objects-added", G_CALLBACK (on_objects_added), store);
398
389
priv->sig_modified = g_signal_connect (priv->view, "objects-modified", G_CALLBACK (on_objects_modified), store);
399
390
priv->sig_removed = g_signal_connect (priv->view, "objects-removed", G_CALLBACK (on_objects_removed), store);
402
g_warning ("koto-ecal not set on cal_view, cannot commit changes");