Merge lp:~cyphermox/indicator-datetime/revert277 into lp:~indicator-applet-developers/indicator-datetime/trunk.13.10

Proposed by Mathieu Trudel-Lapierre on 2013-10-22
Status: Merged
Approved by: Ted Gould on 2013-10-22
Approved revision: 279
Merged at revision: 279
Proposed branch: lp:~cyphermox/indicator-datetime/revert277
Merge into: lp:~indicator-applet-developers/indicator-datetime/trunk.13.10
Diff against target: 1390 lines (+107/-861)
13 files modified
README (+1/-7)
configure.ac (+0/-2)
debian/control (+0/-1)
src/Makefile.am (+0/-2)
src/main.c (+4/-45)
src/planner-eds.c (+70/-179)
src/planner-eds.h (+2/-0)
src/planner-mock.c (+0/-178)
src/planner-mock.h (+0/-58)
src/planner.c (+0/-20)
src/planner.h (+2/-4)
src/service.c (+27/-359)
src/service.h (+1/-6)
To merge this branch: bzr merge lp:~cyphermox/indicator-datetime/revert277
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2013-10-22
Ted Gould (community) 2013-10-22 Approve on 2013-10-22
Review via email: mp+192258@code.launchpad.net

This proposal supersedes a proposal from 2013-10-22.

Description of the change

Revert revision 277 which appears to be more feature than bugfix applicable for SRU.

To post a comment you must log in.
Ted Gould (ted) wrote : Posted in a previous version of this proposal

Uhm, this is the 14.04 branch. No need to revert anything here.

review: Disapprove
Ted Gould (ted) :
review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2013-10-09 16:39:36 +0000
3+++ README 2013-10-22 22:10:20 +0000
4@@ -7,17 +7,11 @@
5 Parameter: None
6
7 * "activate-planner"
8- Description: opens an appointment editor.
9+ Description: opens up a calendar appointment editor.
10 State: None
11 Parameter: int64, a time_t hinting which day/time to show in the planner,
12 or 0 for the current day
13
14- * "activate-appointment"
15- Description: opens an appointment editor to the specified appointment.
16- State: None
17- Parameter: string, an opaque uid to specify which appointment to use.
18- This uid comes from the menuitems' target values.
19-
20 * "set-location"
21 Description: Set the current location. This will try to set the current
22 timezone to the new location's timezone.
23
24=== modified file 'configure.ac'
25--- configure.ac 2013-10-16 22:14:11 +0000
26+++ configure.ac 2013-10-22 22:10:20 +0000
27@@ -51,7 +51,6 @@
28 ICAL_REQUIRED_VERSION=0.48
29 ECAL_REQUIRED_VERSION=3.5
30 EDS_REQUIRED_VERSION=3.5
31-LIBNOTIFY_REQUIRED_VERSION=0.7.6
32 URL_DISPATCHER_1_REQUIRED_VERSION=1
33 JSON_GLIB_REQUIRED_VERSION=0.16.2
34
35@@ -63,7 +62,6 @@
36 libical >= $ICAL_REQUIRED_VERSION
37 libecal-1.2 >= $ECAL_REQUIRED_VERSION
38 libedataserver-1.2 >= $EDS_REQUIRED_VERSION
39- libnotify >= $LIBNOTIFY_REQUIRED_VERSION
40 url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION
41 json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION])
42
43
44=== modified file 'debian/control'
45--- debian/control 2013-10-16 22:14:11 +0000
46+++ debian/control 2013-10-22 22:10:20 +0000
47@@ -10,7 +10,6 @@
48 libxorg-gtest-dev,
49 libgtest-dev,
50 libglib2.0-dev (>= 2.35.4),
51- libnotify-dev (>= 0.7.6),
52 libido3-0.1-dev (>= 0.2.90),
53 libgeoclue-dev (>= 0.12.0),
54 libecal1.2-dev (>= 3.5),
55
56=== modified file 'src/Makefile.am'
57--- src/Makefile.am 2013-10-10 02:31:13 +0000
58+++ src/Makefile.am 2013-10-22 22:10:20 +0000
59@@ -20,8 +20,6 @@
60 libindicator_datetime_service_a_SOURCES = \
61 planner.c \
62 planner.h \
63- planner-mock.c \
64- planner-mock.h \
65 planner-eds.c \
66 planner-eds.h \
67 service.c \
68
69=== modified file 'src/main.c'
70--- src/main.c 2013-10-17 12:23:13 +0000
71+++ src/main.c 2013-10-22 22:10:20 +0000
72@@ -24,41 +24,25 @@
73
74 #include <glib/gi18n.h>
75 #include <gio/gio.h>
76-#include <libnotify/notify.h>
77
78-#include "planner-eds.h"
79-#include "planner-mock.h"
80 #include "service.h"
81
82 /***
83 ****
84 ***/
85
86-/* When enabled, new alarms will show up every minute to test snap decisions */
87-static gboolean test_alarms = FALSE;
88-
89-static GOptionEntry entries[] = {
90- { "test-alarms", '\0', 0, G_OPTION_ARG_NONE, &test_alarms, "Test Alarms", NULL },
91- { NULL }
92-};
93-
94 static void
95 on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop)
96 {
97 g_message ("exiting: service couldn't acquire or lost ownership of busname");
98-
99- if (!test_alarms)
100- g_main_loop_quit ((GMainLoop*)loop);
101+ g_main_loop_quit ((GMainLoop*)loop);
102 }
103
104 int
105 main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED)
106 {
107- GOptionContext * context;
108- GError * error;
109- IndicatorDatetimePlanner * planner;
110+ GMainLoop * loop;
111 IndicatorDatetimeService * service;
112- GMainLoop * loop;
113
114 /* Work around a deadlock in glib's type initialization. It can be
115 * removed when https://bugzilla.gnome.org/show_bug.cgi?id=674885 is
116@@ -71,40 +55,15 @@
117 bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
118 textdomain (GETTEXT_PACKAGE);
119
120- /* init libnotify */
121- if (!notify_init ("indicator-datetime-service"))
122- g_critical ("libnotify initialization failed");
123-
124- /* parse command-line options */
125- context = g_option_context_new (NULL);
126- g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
127- if (!g_option_context_parse (context, &argc, &argv, &error))
128- {
129- g_print("option parsing failed: %s\n", error->message);
130- return EXIT_FAILURE;
131- }
132-
133- /* set up the planner */
134- if (test_alarms)
135- {
136- g_message ("Using fake appointment book for testing alarms.");
137- planner = indicator_datetime_planner_mock_new ();
138- }
139- else
140- {
141- planner = indicator_datetime_planner_eds_new ();
142- }
143-
144 /* run */
145- service = indicator_datetime_service_new (planner);
146+ service = indicator_datetime_service_new ();
147 loop = g_main_loop_new (NULL, FALSE);
148 g_signal_connect (service, INDICATOR_DATETIME_SERVICE_SIGNAL_NAME_LOST,
149 G_CALLBACK(on_name_lost), loop);
150 g_main_loop_run (loop);
151
152 /* cleanup */
153+ g_clear_object (&service);
154 g_main_loop_unref (loop);
155- g_object_unref (service);
156- g_object_unref (planner);
157 return 0;
158 }
159
160=== modified file 'src/planner-eds.c'
161--- src/planner-eds.c 2013-10-10 02:24:43 +0000
162+++ src/planner-eds.c 2013-10-22 22:10:20 +0000
163@@ -43,180 +43,78 @@
164
165 /***
166 ****
167-**** my_get_appointments() helpers
168-****
169-***/
170-
171-/* whole-task data that all the subtasks can see */
172-struct appointment_task_data
173-{
174- /* a ref to the planner's cancellable */
175- GCancellable * cancellable;
176-
177+***/
178+
179+void
180+indicator_datetime_appt_free (struct IndicatorDatetimeAppt * appt)
181+{
182+ if (appt != NULL)
183+ {
184+ g_date_time_unref (appt->end);
185+ g_date_time_unref (appt->begin);
186+ g_free (appt->color);
187+ g_free (appt->summary);
188+ g_slice_free (struct IndicatorDatetimeAppt, appt);
189+ }
190+}
191+
192+/***
193+**** my_get_appointments() helpers
194+***/
195+
196+struct get_appointments_task_data
197+{
198 /* how many subtasks are still running on */
199 int subtask_count;
200
201 /* the list of appointments to be returned */
202 GSList * appointments;
203+
204+ /* ensure that recurring events don't get multiple IndicatorDatetimeAppts */
205+ GHashTable * added;
206 };
207
208-static struct appointment_task_data *
209-appointment_task_data_new (GCancellable * cancellable)
210-{
211- struct appointment_task_data * data;
212-
213- data = g_slice_new0 (struct appointment_task_data);
214- data->cancellable = g_object_ref (cancellable);
215- return data;
216-}
217-
218-static void
219-appointment_task_data_free (gpointer gdata)
220-{
221- struct appointment_task_data * data = gdata;
222-
223- g_object_unref (data->cancellable);
224-
225- g_slice_free (struct appointment_task_data, data);
226-}
227-
228-static void
229-appointment_task_done (GTask * task)
230-{
231- struct appointment_task_data * data = g_task_get_task_data (task);
232-
233+static void
234+get_appointments_task_data_free (gpointer gdata)
235+{
236+ struct get_appointments_task_data * data = gdata;
237+ g_hash_table_unref (data->added);
238+ g_slice_free (struct get_appointments_task_data, data);
239+}
240+
241+static void
242+on_all_subtasks_done (GTask * task)
243+{
244+ struct get_appointments_task_data * data = g_task_get_task_data (task);
245 g_task_return_pointer (task, data->appointments, NULL);
246 g_object_unref (task);
247 }
248
249-static void
250-appointment_task_decrement_subtasks (GTask * task)
251-{
252- struct appointment_task_data * data = g_task_get_task_data (task);
253-
254- if (g_atomic_int_dec_and_test (&data->subtask_count))
255- appointment_task_done (task);
256-}
257-
258-static void
259-appointment_task_increment_subtasks (GTask * task)
260-{
261- struct appointment_task_data * data = g_task_get_task_data (task);
262-
263- g_atomic_int_inc (&data->subtask_count);
264-}
265-
266-/**
267-*** get-the-appointment's-uri subtasks
268-**/
269-
270-struct appointment_uri_subtask_data
271-{
272- /* The parent task */
273- GTask * task;
274-
275- /* The appointment whose uri we're looking for.
276- This pointer is owned by the Task and isn't reffed/unreffed by the subtask */
277- struct IndicatorDatetimeAppt * appt;
278-};
279-
280-static void
281-appointment_uri_subtask_done (struct appointment_uri_subtask_data * subdata)
282-{
283- GTask * task = subdata->task;
284-
285- /* free the subtask data */
286- g_slice_free (struct appointment_uri_subtask_data, subdata);
287-
288- appointment_task_decrement_subtasks (task);
289-}
290-
291-static struct appointment_uri_subtask_data *
292-appointment_uri_subtask_data_new (GTask * task, struct IndicatorDatetimeAppt * appt)
293-{
294- struct appointment_uri_subtask_data * subdata;
295-
296- appointment_task_increment_subtasks (task);
297-
298- subdata = g_slice_new0 (struct appointment_uri_subtask_data);
299- subdata->task = task;
300- subdata->appt = appt;
301- return subdata;
302-}
303-
304-static void
305-on_appointment_uris_ready (GObject * client,
306- GAsyncResult * res,
307- gpointer gsubdata)
308-{
309- GSList * uris;
310- GError * error;
311- struct appointment_uri_subtask_data * subdata = gsubdata;
312-
313- uris = NULL;
314- error = NULL;
315- e_cal_client_get_attachment_uris_finish (E_CAL_CLIENT(client), res, &uris, &error);
316- if (error != NULL)
317- {
318- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
319- g_warning ("Error getting appointment uris: %s", error->message);
320-
321- g_error_free (error);
322- }
323- else if (uris != NULL)
324- {
325- struct IndicatorDatetimeAppt * appt = subdata->appt;
326- appt->url = g_strdup (uris->data); /* copy the first URL */
327- g_debug ("found url '%s' for appointment '%s'", appt->url, appt->summary);
328- e_client_util_free_string_slist (uris);
329- }
330-
331- appointment_uri_subtask_done (subdata);
332-}
333-
334-/**
335-*** enumerate-the-components subtasks
336-**/
337-
338-/* data struct for the enumerate-components subtask */
339-struct appointment_component_subtask_data
340-{
341- /* The parent task */
342- GTask * task;
343-
344- /* The client we're walking through. The subtask owns a ref to this */
345- ECalClient * client;
346-
347- /* The appointment's color coding. The subtask owns this string */
348+struct get_appointments_subtask_data
349+{
350+ GTask * task;
351+
352 gchar * color;
353 };
354
355 static void
356-on_appointment_component_subtask_done (gpointer gsubdata)
357+on_subtask_done (gpointer gsubdata)
358 {
359- struct appointment_component_subtask_data * subdata = gsubdata;
360- GTask * task = subdata->task;
361+ struct get_appointments_subtask_data * subdata;
362+ GTask * task;
363+ struct get_appointments_task_data * data;
364+
365+ subdata = gsubdata;
366+ task = subdata->task;
367
368 /* free the subtask data */
369 g_free (subdata->color);
370- g_object_unref (subdata->client);
371- g_slice_free (struct appointment_component_subtask_data, subdata);
372-
373- appointment_task_decrement_subtasks (task);
374-}
375-
376-static struct appointment_component_subtask_data *
377-appointment_component_subtask_data_new (GTask * task, ECalClient * client, const gchar * color)
378-{
379- struct appointment_component_subtask_data * subdata;
380-
381- appointment_task_increment_subtasks (task);
382-
383- subdata = g_slice_new0 (struct appointment_component_subtask_data);
384- subdata->task = task;
385- subdata->client = g_object_ref (client);
386- subdata->color = g_strdup (color);
387- return subdata;
388+ g_slice_free (struct get_appointments_subtask_data, subdata);
389+
390+ /* poke the task */
391+ data = g_task_get_task_data (task);
392+ if (g_atomic_int_dec_and_test (&data->subtask_count))
393+ on_all_subtasks_done (task);
394 }
395
396 static gboolean
397@@ -226,8 +124,8 @@
398 gpointer gsubdata)
399 {
400 const ECalComponentVType vtype = e_cal_component_get_vtype (component);
401- struct appointment_component_subtask_data * subdata = gsubdata;
402- struct appointment_task_data * data = g_task_get_task_data (subdata->task);
403+ struct get_appointments_subtask_data * subdata = gsubdata;
404+ struct get_appointments_task_data * data = g_task_get_task_data (subdata->task);
405
406 if ((vtype == E_CAL_COMPONENT_EVENT) || (vtype == E_CAL_COMPONENT_TODO))
407 {
408@@ -238,6 +136,7 @@
409 e_cal_component_get_status (component, &status);
410
411 if ((uid != NULL) &&
412+ (!g_hash_table_contains (data->added, uid)) &&
413 (status != ICAL_STATUS_COMPLETED) &&
414 (status != ICAL_STATUS_CANCELLED))
415 {
416@@ -246,7 +145,6 @@
417 GSList * recur_list;
418 ECalComponentText text;
419 struct IndicatorDatetimeAppt * appt;
420- struct appointment_uri_subtask_data * uri_subdata;
421
422 appt = g_slice_new0 (struct IndicatorDatetimeAppt);
423
424@@ -271,22 +169,13 @@
425 appt->color = g_strdup (subdata->color);
426 appt->is_event = vtype == E_CAL_COMPONENT_EVENT;
427 appt->summary = g_strdup (text.value);
428- appt->uid = g_strdup (uid);
429
430 alarm_uids = e_cal_component_get_alarm_uids (component);
431 appt->has_alarms = alarm_uids != NULL;
432 cal_obj_uid_list_free (alarm_uids);
433
434 data->appointments = g_slist_prepend (data->appointments, appt);
435-
436- /* start a new subtask to get the associated URIs */
437- uri_subdata = appointment_uri_subtask_data_new (subdata->task, appt);
438- e_cal_client_get_attachment_uris (subdata->client,
439- uid,
440- NULL,
441- data->cancellable,
442- on_appointment_uris_ready,
443- uri_subdata);
444+ g_hash_table_add (data->added, g_strdup(uid));
445 }
446 }
447
448@@ -308,6 +197,7 @@
449 priv_t * p;
450 const char * str;
451 icaltimezone * default_timezone;
452+ struct get_appointments_task_data * data;
453 const int64_t begin = g_date_time_to_unix (begin_datetime);
454 const int64_t end = g_date_time_to_unix (end_datetime);
455 GTask * task;
456@@ -333,18 +223,17 @@
457 *** walk through the sources to build the appointment list
458 **/
459
460+ data = g_slice_new0 (struct get_appointments_task_data);
461+ data->added = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
462 task = g_task_new (planner, p->cancellable, callback, user_data);
463- g_task_set_task_data (task,
464- appointment_task_data_new (p->cancellable),
465- appointment_task_data_free);
466+ g_task_set_task_data (task, data, get_appointments_task_data_free);
467
468 subtasks_added = FALSE;
469 for (l=p->sources; l!=NULL; l=l->next)
470 {
471 ESource * source;
472 ECalClient * client;
473- const char * color;
474- struct appointment_component_subtask_data * subdata;
475+ struct get_appointments_subtask_data * subdata;
476
477 source = l->data;
478 client = g_object_get_qdata (l->data, source_client_quark());
479@@ -354,9 +243,11 @@
480 if (default_timezone != NULL)
481 e_cal_client_set_default_timezone (client, default_timezone);
482
483- /* start a new subtask to enumerate all the components in this client. */
484- color = e_source_selectable_get_color (e_source_get_extension (source, E_SOURCE_EXTENSION_CALENDAR));
485- subdata = appointment_component_subtask_data_new (task, client, color);
486+ subdata = g_slice_new (struct get_appointments_subtask_data);
487+ subdata->task = task;
488+ subdata->color = e_source_selectable_dup_color (e_source_get_extension (source, E_SOURCE_EXTENSION_CALENDAR));
489+
490+ g_atomic_int_inc (&data->subtask_count);
491 subtasks_added = TRUE;
492 e_cal_client_generate_instances (client,
493 begin,
494@@ -364,11 +255,11 @@
495 p->cancellable,
496 my_get_appointments_foreach,
497 subdata,
498- on_appointment_component_subtask_done);
499+ on_subtask_done);
500 }
501
502 if (!subtasks_added)
503- appointment_task_done (task);
504+ on_all_subtasks_done (task);
505 }
506
507 static GSList *
508@@ -379,7 +270,7 @@
509 return g_task_propagate_pointer (G_TASK(res), error);
510 }
511
512-static gboolean
513+gboolean
514 my_is_configured (IndicatorDatetimePlanner * planner)
515 {
516 IndicatorDatetimePlannerEds * self;
517
518=== modified file 'src/planner-eds.h'
519--- src/planner-eds.h 2013-10-10 02:04:31 +0000
520+++ src/planner-eds.h 2013-10-22 22:10:20 +0000
521@@ -51,6 +51,8 @@
522 IndicatorDatetimePlannerClass parent_class;
523 };
524
525+gboolean indicator_datetime_planner_eds_is_usable (void);
526+
527 IndicatorDatetimePlanner * indicator_datetime_planner_eds_new (void);
528
529 G_END_DECLS
530
531=== removed file 'src/planner-mock.c'
532--- src/planner-mock.c 2013-10-10 02:31:13 +0000
533+++ src/planner-mock.c 1970-01-01 00:00:00 +0000
534@@ -1,178 +0,0 @@
535-/*
536- * Copyright 2013 Canonical Ltd.
537- *
538- * Authors:
539- * Charles Kerr <charles.kerr@canonical.com>
540- *
541- * This program is free software: you can redistribute it and/or modify it
542- * under the terms of the GNU General Public License version 3, as published
543- * by the Free Software Foundation.
544- *
545- * This program is distributed in the hope that it will be useful, but
546- * WITHOUT ANY WARRANTY; without even the implied warranties of
547- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
548- * PURPOSE. See the GNU General Public License for more details.
549- *
550- * You should have received a copy of the GNU General Public License along
551- * with this program. If not, see <http://www.gnu.org/licenses/>.
552- */
553-
554-#include "config.h"
555-
556-#include "planner-mock.h"
557-
558-struct _IndicatorDatetimePlannerMockPriv
559-{
560- gboolean is_configured;
561-};
562-
563-typedef IndicatorDatetimePlannerMockPriv priv_t;
564-
565-G_DEFINE_TYPE (IndicatorDatetimePlannerMock,
566- indicator_datetime_planner_mock,
567- INDICATOR_TYPE_DATETIME_PLANNER)
568-
569-/***
570-**** IndicatorDatetimePlanner virtual funcs
571-***/
572-
573-static void
574-my_get_appointments (IndicatorDatetimePlanner * planner,
575- GDateTime * begin_datetime,
576- GDateTime * end_datetime G_GNUC_UNUSED,
577- GAsyncReadyCallback callback,
578- gpointer user_data)
579-{
580- GTask * task;
581- GSList * appointments;
582- struct IndicatorDatetimeAppt * appt;
583- struct IndicatorDatetimeAppt * prev;
584-
585- task = g_task_new (planner, NULL, callback, user_data);
586-
587- /**
588- *** Build the appointments list
589- **/
590-
591- appointments = NULL;
592-
593- /* add a daily appointment that occurs at the beginning of the next minute */
594- appt = g_slice_new0 (struct IndicatorDatetimeAppt);
595- appt->is_daily = TRUE;
596- appt->begin = g_date_time_add_seconds (begin_datetime, 60-g_date_time_get_seconds(begin_datetime));
597- appt->end = g_date_time_add_minutes (appt->begin, 1);
598- appt->color = g_strdup ("#00FF00");
599- appt->is_event = TRUE;
600- appt->summary = g_strdup ("Daily alarm");
601- appt->uid = g_strdup ("this uid isn't very random.");
602- appt->has_alarms = TRUE;
603- appt->url = g_strdup ("alarm:///some-alarm-info-goes-here");
604- appointments = g_slist_prepend (appointments, appt);
605- prev = appt;
606-
607- /* and add one for a minute later that has an alarm uri */
608- appt = g_slice_new0 (struct IndicatorDatetimeAppt);
609- appt->is_daily = TRUE;
610- appt->begin = g_date_time_add_minutes (prev->end, 1);
611- appt->end = g_date_time_add_minutes (appt->begin, 1);
612- appt->color = g_strdup ("#0000FF");
613- appt->is_event = TRUE;
614- appt->summary = g_strdup ("Second Daily alarm");
615- appt->uid = g_strdup ("this uid isn't very random either.");
616- appt->has_alarms = FALSE;
617- appointments = g_slist_prepend (appointments, appt);
618-
619- /* done */
620- g_task_return_pointer (task, appointments, NULL);
621- g_object_unref (task);
622-}
623-
624-static GSList *
625-my_get_appointments_finish (IndicatorDatetimePlanner * self G_GNUC_UNUSED,
626- GAsyncResult * res,
627- GError ** error)
628-{
629- return g_task_propagate_pointer (G_TASK(res), error);
630-}
631-
632-static gboolean
633-my_is_configured (IndicatorDatetimePlanner * planner)
634-{
635- IndicatorDatetimePlannerMock * self;
636- self = INDICATOR_DATETIME_PLANNER_MOCK (planner);
637- return self->priv->is_configured;
638-}
639-
640-static void
641-my_activate (IndicatorDatetimePlanner * self G_GNUC_UNUSED)
642-{
643- g_message ("%s %s", G_STRLOC, G_STRFUNC);
644-}
645-
646-static void
647-my_activate_time (IndicatorDatetimePlanner * self G_GNUC_UNUSED,
648- GDateTime * activate_time)
649-{
650- gchar * str = g_date_time_format (activate_time, "%F %T");
651- g_message ("%s %s: %s", G_STRLOC, G_STRFUNC, str);
652- g_free (str);
653-}
654-
655-/***
656-**** GObject virtual funcs
657-***/
658-
659-static void
660-my_dispose (GObject * o)
661-{
662- G_OBJECT_CLASS (indicator_datetime_planner_mock_parent_class)->dispose (o);
663-}
664-
665-/***
666-**** Instantiation
667-***/
668-
669-static void
670-indicator_datetime_planner_mock_class_init (IndicatorDatetimePlannerMockClass * klass)
671-{
672- GObjectClass * object_class;
673- IndicatorDatetimePlannerClass * planner_class;
674-
675- object_class = G_OBJECT_CLASS (klass);
676- object_class->dispose = my_dispose;
677-
678- planner_class = INDICATOR_DATETIME_PLANNER_CLASS (klass);
679- planner_class->is_configured = my_is_configured;
680- planner_class->activate = my_activate;
681- planner_class->activate_time = my_activate_time;
682- planner_class->get_appointments = my_get_appointments;
683- planner_class->get_appointments_finish = my_get_appointments_finish;
684-
685- g_type_class_add_private (klass, sizeof (IndicatorDatetimePlannerMockPriv));
686-}
687-
688-static void
689-indicator_datetime_planner_mock_init (IndicatorDatetimePlannerMock * self)
690-{
691- priv_t * p;
692-
693- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
694- INDICATOR_TYPE_DATETIME_PLANNER_MOCK,
695- IndicatorDatetimePlannerMockPriv);
696-
697- p->is_configured = TRUE;
698-
699- self->priv = p;
700-}
701-
702-/***
703-**** Public
704-***/
705-
706-IndicatorDatetimePlanner *
707-indicator_datetime_planner_mock_new (void)
708-{
709- gpointer o = g_object_new (INDICATOR_TYPE_DATETIME_PLANNER_MOCK, NULL);
710-
711- return INDICATOR_DATETIME_PLANNER (o);
712-}
713
714=== removed file 'src/planner-mock.h'
715--- src/planner-mock.h 2013-10-10 02:31:13 +0000
716+++ src/planner-mock.h 1970-01-01 00:00:00 +0000
717@@ -1,58 +0,0 @@
718-/*
719- * Copyright 2013 Canonical Ltd.
720- *
721- * Authors:
722- * Charles Kerr <charles.kerr@canonical.com>
723- *
724- * This program is free software: you can redistribute it and/or modify it
725- * under the terms of the GNU General Public License version 3, as published
726- * by the Free Software Foundation.
727- *
728- * This program is distributed in the hope that it will be useful, but
729- * WITHOUT ANY WARRANTY; without even the implied warranties of
730- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
731- * PURPOSE. See the GNU General Public License for more details.
732- *
733- * You should have received a copy of the GNU General Public License along
734- * with this program. If not, see <http://www.gnu.org/licenses/>.
735- */
736-
737-#ifndef __INDICATOR_DATETIME_PLANNER_MOCK__H__
738-#define __INDICATOR_DATETIME_PLANNER_MOCK__H__
739-
740-#include "planner.h" /* parent class */
741-
742-G_BEGIN_DECLS
743-
744-#define INDICATOR_TYPE_DATETIME_PLANNER_MOCK (indicator_datetime_planner_mock_get_type())
745-#define INDICATOR_DATETIME_PLANNER_MOCK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), INDICATOR_TYPE_DATETIME_PLANNER_MOCK, IndicatorDatetimePlannerMock))
746-#define INDICATOR_DATETIME_PLANNER_MOCK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), INDICATOR_TYPE_DATETIME_PLANNER_MOCK, IndicatorDatetimePlannerMockClass))
747-#define INDICATOR_IS_DATETIME_PLANNER_MOCK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_DATETIME_PLANNER_MOCK))
748-
749-typedef struct _IndicatorDatetimePlannerMock IndicatorDatetimePlannerMock;
750-typedef struct _IndicatorDatetimePlannerMockPriv IndicatorDatetimePlannerMockPriv;
751-typedef struct _IndicatorDatetimePlannerMockClass IndicatorDatetimePlannerMockClass;
752-
753-GType indicator_datetime_planner_mock_get_type (void);
754-
755-/**
756- * An IndicatorDatetimePlanner which uses Evolution Data Server
757- * to get its list of appointments.
758- */
759-struct _IndicatorDatetimePlannerMock
760-{
761- /*< private >*/
762- IndicatorDatetimePlanner parent;
763- IndicatorDatetimePlannerMockPriv * priv;
764-};
765-
766-struct _IndicatorDatetimePlannerMockClass
767-{
768- IndicatorDatetimePlannerClass parent_class;
769-};
770-
771-IndicatorDatetimePlanner * indicator_datetime_planner_mock_new (void);
772-
773-G_END_DECLS
774-
775-#endif /* __INDICATOR_DATETIME_PLANNER_MOCK__H__ */
776
777=== modified file 'src/planner.c'
778--- src/planner.c 2013-10-10 02:06:35 +0000
779+++ src/planner.c 2013-10-22 22:10:20 +0000
780@@ -259,23 +259,3 @@
781
782 return self->priv->timezone;
783 }
784-
785-/***
786-****
787-***/
788-
789-void
790-indicator_datetime_appt_free (struct IndicatorDatetimeAppt * appt)
791-{
792- if (appt != NULL)
793- {
794- g_date_time_unref (appt->end);
795- g_date_time_unref (appt->begin);
796- g_free (appt->color);
797- g_free (appt->summary);
798- g_free (appt->url);
799- g_free (appt->uid);
800- g_slice_free (struct IndicatorDatetimeAppt, appt);
801- }
802-}
803-
804
805=== modified file 'src/planner.h'
806--- src/planner.h 2013-10-09 13:21:16 +0000
807+++ src/planner.h 2013-10-22 22:10:20 +0000
808@@ -40,10 +40,8 @@
809
810 struct IndicatorDatetimeAppt
811 {
812- gchar * color;
813- gchar * summary;
814- gchar * url;
815- gchar * uid;
816+ char * color;
817+ char * summary;
818 GDateTime * begin;
819 GDateTime * end;
820 gboolean is_event;
821
822=== modified file 'src/service.c'
823--- src/service.c 2013-10-17 03:39:12 +0000
824+++ src/service.c 2013-10-22 22:10:20 +0000
825@@ -24,11 +24,11 @@
826
827 #include <glib/gi18n.h>
828 #include <gio/gio.h>
829-#include <libnotify/notify.h>
830 #include <json-glib/json-glib.h>
831 #include <url-dispatcher.h>
832
833 #include "dbus-shared.h"
834+#include "planner-eds.h"
835 #include "timezone-file.h"
836 #include "timezone-geoclue.h"
837 #include "service.h"
838@@ -53,15 +53,6 @@
839
840 enum
841 {
842- PROP_0,
843- PROP_PLANNER,
844- PROP_LAST
845-};
846-
847-static GParamSpec * properties[PROP_LAST] = { 0 };
848-
849-enum
850-{
851 SECTION_HEADER = (1<<0),
852 SECTION_CALENDAR = (1<<1),
853 SECTION_APPOINTMENTS = (1<<2),
854@@ -128,7 +119,6 @@
855
856 guint header_timer;
857 guint timezone_timer;
858- guint alarm_timer;
859
860 /* Which year/month to show in the calendar,
861 and which day should get the cursor.
862@@ -398,197 +388,6 @@
863 g_date_time_unref (now);
864 }
865
866-/***
867-**** ALARMS
868-***/
869-
870-static void set_alarm_timer (IndicatorDatetimeService * self);
871-
872-static gboolean
873-appointment_has_alarm_url (const struct IndicatorDatetimeAppt * appt)
874-{
875- return (appt->has_alarms) &&
876- (appt->url != NULL) &&
877- (g_str_has_prefix (appt->url, "alarm:///"));
878-}
879-
880-static gboolean
881-datetimes_have_the_same_minute (GDateTime * a G_GNUC_UNUSED, GDateTime * b G_GNUC_UNUSED)
882-{
883- int ay, am, ad;
884- int by, bm, bd;
885-
886- g_date_time_get_ymd (a, &ay, &am, &ad);
887- g_date_time_get_ymd (b, &by, &bm, &bd);
888-
889- return (ay == by) &&
890- (am == bm) &&
891- (ad == bd) &&
892- (g_date_time_get_hour (a) == g_date_time_get_hour (b)) &&
893- (g_date_time_get_minute (a) == g_date_time_get_minute (b));
894-}
895-
896-static void
897-dispatch_alarm_url (const struct IndicatorDatetimeAppt * appt)
898-{
899- gchar * str;
900-
901- g_return_if_fail (appt != NULL);
902- g_return_if_fail (appointment_has_alarm_url (appt));
903-
904- str = g_date_time_format (appt->begin, "%F %T");
905- g_debug ("dispatching url \"%s\" for appointment \"%s\", which begins at %s",
906- appt->url, appt->summary, str);
907- g_free (str);
908-
909- url_dispatch_send (appt->url, NULL, NULL);
910-}
911-
912-static void
913-on_snap_decided (NotifyNotification * notification G_GNUC_UNUSED,
914- char * action,
915- gpointer gurl)
916-{
917- g_debug ("%s: %s", G_STRFUNC, action);
918-
919- if (!g_strcmp0 (action, "show"))
920- {
921- const gchar * url = gurl;
922- g_debug ("dispatching url '%s'", url);
923- url_dispatch_send (url, NULL, NULL);
924- }
925-}
926-
927-static void
928-show_snap_decision_for_alarm (const struct IndicatorDatetimeAppt * appt)
929-{
930- gchar * title;
931- const gchar * body;
932- const gchar * icon_name;
933- NotifyNotification * nn;
934- GError * error;
935-
936- title = g_date_time_format (appt->begin,
937- get_terse_time_format_string (appt->begin));
938- body = appt->summary;
939- icon_name = ALARM_CLOCK_ICON_NAME;
940- g_debug ("creating a snap decision with title '%s', body '%s', icon '%s'",
941- title, body, icon_name);
942-
943- nn = notify_notification_new (title, body, icon_name);
944- notify_notification_set_hint_string (nn,
945- "x-canonical-snap-decisions",
946- "true");
947- notify_notification_set_hint_string (nn,
948- "x-canonical-private-button-tint",
949- "true");
950- notify_notification_add_action (nn, "show", _("Show"),
951- on_snap_decided, g_strdup(appt->url), g_free);
952- notify_notification_add_action (nn, "dismiss", _("Dismiss"),
953- on_snap_decided, NULL, NULL);
954-
955- error = NULL;
956- notify_notification_show (nn, &error);
957- if (error != NULL)
958- {
959- g_warning ("Unable to show alarm '%s' popup: %s", body, error->message);
960- g_error_free (error);
961- dispatch_alarm_url (appt);
962- }
963-
964- g_free (title);
965-}
966-
967-static void update_appointment_lists (IndicatorDatetimeService * self);
968-
969-static gboolean
970-on_alarm_timer (gpointer gself)
971-{
972- IndicatorDatetimeService * self = INDICATOR_DATETIME_SERVICE (gself);
973- GDateTime * now;
974- GSList * l;
975-
976- /* If there are any alarms at the current time, show a snap decision */
977- now = indicator_datetime_service_get_localtime (self);
978- for (l=self->priv->upcoming_appointments; l!=NULL; l=l->next)
979- {
980- const struct IndicatorDatetimeAppt * appt = l->data;
981-
982- if (appointment_has_alarm_url (appt))
983- if (datetimes_have_the_same_minute (now, appt->begin))
984- show_snap_decision_for_alarm (appt);
985- }
986- g_date_time_unref (now);
987-
988- /* rebuild the alarm list asynchronously.
989- set_upcoming_appointments() will update the alarm timer when this
990- async call is done, so no need to restart the timer here... */
991- update_appointment_lists (self);
992-
993- return G_SOURCE_REMOVE;
994-}
995-
996-/* if there are upcoming alarms, set the alarm timer to the nearest one.
997- otherwise, unset the alarm timer. */
998-static void
999-set_alarm_timer (IndicatorDatetimeService * self)
1000-{
1001- priv_t * p;
1002- GDateTime * now;
1003- GDateTime * alarm_time;
1004- GSList * l;
1005-
1006- p = self->priv;
1007- indicator_clear_timer (&p->alarm_timer);
1008-
1009- now = indicator_datetime_service_get_localtime (self);
1010-
1011- /* find the time of the next alarm on our calendar */
1012- alarm_time = NULL;
1013- for (l=p->upcoming_appointments; l!=NULL; l=l->next)
1014- {
1015- const struct IndicatorDatetimeAppt * appt = l->data;
1016-
1017- if (appointment_has_alarm_url (appt))
1018- if (g_date_time_compare (appt->begin, now) > 0)
1019- if (!alarm_time || g_date_time_compare (alarm_time, appt->begin) > 0)
1020- alarm_time = appt->begin;
1021- }
1022-
1023- /* if there's an upcoming alarm, set a timer to wake up at that time */
1024- if (alarm_time != NULL)
1025- {
1026- GTimeSpan interval_msec;
1027- gchar * str;
1028- GDateTime * then;
1029-
1030- interval_msec = g_date_time_difference (alarm_time, now);
1031- interval_msec += G_USEC_PER_SEC; /* fire a moment after alarm_time */
1032- interval_msec /= 1000; /* convert from usec to msec */
1033-
1034- str = g_date_time_format (alarm_time, "%F %T");
1035- g_debug ("%s is the next alarm time", str);
1036- g_free (str);
1037- then = g_date_time_add_seconds (now, interval_msec/1000);
1038- str = g_date_time_format (then, "%F %T");
1039- g_debug ("%s is when we'll wake up for it", str);
1040- g_free (str);
1041- g_date_time_unref (then);
1042-
1043- p->alarm_timer = g_timeout_add_full (G_PRIORITY_HIGH,
1044- (guint) interval_msec,
1045- on_alarm_timer,
1046- self,
1047- NULL);
1048- }
1049-
1050- g_date_time_unref (now);
1051-}
1052-
1053-/***
1054-****
1055-***/
1056-
1057 static void
1058 update_internal_timezone (IndicatorDatetimeService * self)
1059 {
1060@@ -944,36 +743,23 @@
1061 }
1062
1063 static void
1064-add_appointments (IndicatorDatetimeService * self, GMenu * menu, gboolean phone)
1065+add_appointments (IndicatorDatetimeService * self, GMenu * menu, gboolean terse)
1066 {
1067 const int MAX_APPTS = 5;
1068- GDateTime * now;
1069- GHashTable * added;
1070+ GDateTime * now = indicator_datetime_service_get_localtime (self);
1071 GSList * appts;
1072 GSList * l;
1073 int i;
1074
1075- now = indicator_datetime_service_get_localtime (self);
1076-
1077- added = g_hash_table_new (g_str_hash, g_str_equal);
1078-
1079 /* build appointment menuitems */
1080 appts = self->priv->upcoming_appointments;
1081 for (l=appts, i=0; l!=NULL && i<MAX_APPTS; l=l->next, i++)
1082 {
1083 struct IndicatorDatetimeAppt * appt = l->data;
1084- char * fmt;
1085- gint64 unix_time;
1086+ char * fmt = get_appointment_time_format (appt, now, self->priv->settings, terse);
1087+ const gint64 unix_time = g_date_time_to_unix (appt->begin);
1088 GMenuItem * menu_item;
1089
1090- if (g_hash_table_contains (added, appt->uid))
1091- continue;
1092-
1093- g_hash_table_add (added, appt->uid);
1094-
1095- fmt = get_appointment_time_format (appt, now, self->priv->settings, phone);
1096- unix_time = g_date_time_to_unix (appt->begin);
1097-
1098 menu_item = g_menu_item_new (appt->summary, NULL);
1099
1100 if (appt->has_alarms)
1101@@ -990,22 +776,15 @@
1102 g_menu_item_set_attribute (menu_item, "x-canonical-type",
1103 "s", appt->has_alarms ? "com.canonical.indicator.alarm"
1104 : "com.canonical.indicator.appointment");
1105-
1106- if (phone)
1107- g_menu_item_set_action_and_target_value (menu_item,
1108- "indicator.activate-appointment",
1109- g_variant_new_string (appt->uid));
1110- else
1111- g_menu_item_set_action_and_target_value (menu_item,
1112- "indicator.activate-planner",
1113- g_variant_new_int64 (unix_time));
1114+ g_menu_item_set_action_and_target_value (menu_item,
1115+ "indicator.activate-planner",
1116+ g_variant_new_int64 (unix_time));
1117 g_menu_append_item (menu, menu_item);
1118 g_object_unref (menu_item);
1119 g_free (fmt);
1120 }
1121
1122 /* cleanup */
1123- g_hash_table_unref (added);
1124 g_date_time_unref (now);
1125 }
1126
1127@@ -1584,34 +1363,6 @@
1128 }
1129
1130 static void
1131-on_activate_appointment (GSimpleAction * a G_GNUC_UNUSED,
1132- GVariant * param,
1133- gpointer gself)
1134-{
1135- priv_t * p = INDICATOR_DATETIME_SERVICE(gself)->priv;
1136- const gchar * uid = g_variant_get_string (param, NULL);
1137-
1138- if (uid != NULL)
1139- {
1140- const struct IndicatorDatetimeAppt * appt;
1141- GSList * l;
1142-
1143- /* find the appointment that matches that uid */
1144- for (l=p->upcoming_appointments, appt=NULL; l && !appt; l=l->next)
1145- {
1146- const struct IndicatorDatetimeAppt * tmp = l->data;
1147- if (!g_strcmp0 (uid, tmp->uid))
1148- appt = tmp;
1149- }
1150-
1151- /* if that appointment's an alarm, dispatch its url */
1152- g_debug ("%s: uri '%s'; matching appt is %p", G_STRFUNC, uid, appt);
1153- if (appt && appointment_has_alarm_url (appt))
1154- dispatch_alarm_url (appt);
1155- }
1156-}
1157-
1158-static void
1159 on_phone_clock_activated (GSimpleAction * a G_GNUC_UNUSED,
1160 GVariant * param G_GNUC_UNUSED,
1161 gpointer gself G_GNUC_UNUSED)
1162@@ -1675,7 +1426,6 @@
1163 { "activate-phone-settings", on_phone_settings_activated },
1164 { "activate-phone-clock-app", on_phone_clock_activated },
1165 { "activate-planner", on_activate_planner, "x", NULL },
1166- { "activate-appointment", on_activate_appointment, "s", NULL },
1167 { "set-location", on_set_location, "s" }
1168 };
1169
1170@@ -1906,10 +1656,6 @@
1171
1172 /* sync the menus/actions */
1173 rebuild_appointments_section_soon (self);
1174-
1175- /* alarm timer is keyed off of the next alarm time,
1176- so it needs to be rebuilt when the appointment list changes */
1177- set_alarm_timer (self);
1178 }
1179
1180 static void
1181@@ -2079,45 +1825,6 @@
1182 ***/
1183
1184 static void
1185-my_get_property (GObject * o,
1186- guint property_id,
1187- GValue * value,
1188- GParamSpec * pspec)
1189-{
1190- IndicatorDatetimeService * self = INDICATOR_DATETIME_SERVICE (o);
1191-
1192- switch (property_id)
1193- {
1194- case PROP_PLANNER:
1195- g_value_set_object (value, self->priv->planner);
1196- break;
1197-
1198- default:
1199- G_OBJECT_WARN_INVALID_PROPERTY_ID (o, property_id, pspec);
1200- }
1201-}
1202-
1203-static void
1204-my_set_property (GObject * o,
1205- guint property_id,
1206- const GValue * value,
1207- GParamSpec * pspec)
1208-{
1209- IndicatorDatetimeService * self = INDICATOR_DATETIME_SERVICE (o);
1210-
1211- switch (property_id)
1212- {
1213- case PROP_PLANNER:
1214- indicator_datetime_service_set_planner (self, g_value_get_object (value));
1215- break;
1216-
1217- default:
1218- G_OBJECT_WARN_INVALID_PROPERTY_ID (o, property_id, pspec);
1219- }
1220-}
1221-
1222-
1223-static void
1224 my_dispose (GObject * o)
1225 {
1226 int i;
1227@@ -2140,7 +1847,13 @@
1228
1229 set_detect_location_enabled (self, FALSE);
1230
1231- indicator_datetime_service_set_planner (self, NULL);
1232+ if (p->planner != NULL)
1233+ {
1234+ g_signal_handlers_disconnect_by_data (p->planner, self);
1235+ g_clear_object (&p->planner);
1236+ }
1237+ g_clear_pointer (&p->upcoming_appointments, indicator_datetime_planner_free_appointments);
1238+ g_clear_pointer (&p->calendar_appointments, indicator_datetime_planner_free_appointments);
1239
1240 if (p->login1_manager != NULL)
1241 {
1242@@ -2152,7 +1865,6 @@
1243 indicator_clear_timer (&p->rebuild_id);
1244 indicator_clear_timer (&p->timezone_timer);
1245 indicator_clear_timer (&p->header_timer);
1246- indicator_clear_timer (&p->alarm_timer);
1247
1248 if (p->settings != NULL)
1249 {
1250@@ -2243,6 +1955,16 @@
1251 p->cancellable = g_cancellable_new ();
1252
1253 /***
1254+ **** Create the planner and listen for changes
1255+ ***/
1256+
1257+ p->planner = indicator_datetime_planner_eds_new ();
1258+
1259+ g_signal_connect_swapped (p->planner, "appointments-changed",
1260+ G_CALLBACK(update_appointment_lists), self);
1261+
1262+
1263+ /***
1264 **** Create the settings object and listen for changes
1265 ***/
1266
1267@@ -2311,8 +2033,6 @@
1268
1269 on_local_time_jumped (self);
1270
1271- set_alarm_timer (self);
1272-
1273 for (i=0; i<N_PROFILES; ++i)
1274 create_menu (self, i);
1275
1276@@ -2323,12 +2043,9 @@
1277 indicator_datetime_service_class_init (IndicatorDatetimeServiceClass * klass)
1278 {
1279 GObjectClass * object_class = G_OBJECT_CLASS (klass);
1280- const GParamFlags flags = G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS;
1281
1282 object_class->dispose = my_dispose;
1283 object_class->finalize = my_finalize;
1284- object_class->get_property = my_get_property;
1285- object_class->set_property = my_set_property;
1286
1287 g_type_class_add_private (klass, sizeof (IndicatorDatetimeServicePrivate));
1288
1289@@ -2340,18 +2057,6 @@
1290 NULL, NULL,
1291 g_cclosure_marshal_VOID__VOID,
1292 G_TYPE_NONE, 0);
1293-
1294- /* install properties */
1295-
1296- properties[PROP_0] = NULL;
1297-
1298- properties[PROP_PLANNER] = g_param_spec_object ("planner",
1299- "Planner",
1300- "The appointment provider",
1301- INDICATOR_TYPE_DATETIME_PLANNER,
1302- flags);
1303-
1304- g_object_class_install_properties (object_class, PROP_LAST, properties);
1305 }
1306
1307 /***
1308@@ -2359,11 +2064,9 @@
1309 ***/
1310
1311 IndicatorDatetimeService *
1312-indicator_datetime_service_new (IndicatorDatetimePlanner * planner)
1313+indicator_datetime_service_new (void)
1314 {
1315- GObject * o = g_object_new (INDICATOR_TYPE_DATETIME_SERVICE,
1316- "planner", planner,
1317- NULL);
1318+ GObject * o = g_object_new (INDICATOR_TYPE_DATETIME_SERVICE, NULL);
1319
1320 return INDICATOR_DATETIME_SERVICE (o);
1321 }
1322@@ -2399,38 +2102,3 @@
1323 if (dirty)
1324 update_appointment_lists (self);
1325 }
1326-
1327-void
1328-indicator_datetime_service_set_planner (IndicatorDatetimeService * self,
1329- IndicatorDatetimePlanner * planner)
1330-{
1331- priv_t * p;
1332-
1333- g_return_if_fail (INDICATOR_IS_DATETIME_SERVICE (self));
1334- g_return_if_fail (INDICATOR_IS_DATETIME_PLANNER (planner));
1335-
1336- p = self->priv;
1337-
1338- /* clear the old planner & appointments */
1339-
1340- if (p->planner != NULL)
1341- {
1342- g_signal_handlers_disconnect_by_data (p->planner, self);
1343- g_clear_object (&p->planner);
1344- }
1345-
1346- g_clear_pointer (&p->upcoming_appointments, indicator_datetime_planner_free_appointments);
1347- g_clear_pointer (&p->calendar_appointments, indicator_datetime_planner_free_appointments);
1348-
1349- /* set the new planner & begin fetching appointments from it */
1350-
1351- if (planner != NULL)
1352- {
1353- p->planner = g_object_ref (planner);
1354-
1355- g_signal_connect_swapped (p->planner, "appointments-changed",
1356- G_CALLBACK(update_appointment_lists), self);
1357-
1358- update_appointment_lists (self);
1359- }
1360-}
1361
1362=== modified file 'src/service.h'
1363--- src/service.h 2013-10-10 02:02:17 +0000
1364+++ src/service.h 2013-10-22 22:10:20 +0000
1365@@ -22,7 +22,6 @@
1366
1367 #include <glib.h>
1368 #include <glib-object.h>
1369-#include "planner.h"
1370
1371 G_BEGIN_DECLS
1372
1373@@ -63,17 +62,13 @@
1374
1375 GType indicator_datetime_service_get_type (void);
1376
1377-IndicatorDatetimeService * indicator_datetime_service_new (IndicatorDatetimePlanner * planner);
1378+IndicatorDatetimeService * indicator_datetime_service_new (void);
1379
1380 GDateTime * indicator_datetime_service_get_localtime (IndicatorDatetimeService * service);
1381
1382 void indicator_datetime_service_set_calendar_date (IndicatorDatetimeService * self,
1383 GDateTime * date);
1384
1385-void indicator_datetime_service_set_planner (IndicatorDatetimeService * self,
1386- IndicatorDatetimePlanner * planner);
1387-
1388-
1389
1390 G_END_DECLS
1391

Subscribers

People subscribed via source and target branches