~ubuntu-branches/ubuntu/breezy/evolution-data-server/breezy

« back to all changes in this revision

Viewing changes to calendar/libecal/e-cal-listener.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-10-10 11:30:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010113056-rb4vj4kbs8yxft85
Tags: 1.4.1-0ubuntu3
* debian/patches/camel-imap-store.c.patch:
  - Ubuntu 17465: apply patch from
  http://bugzilla.gnome.org/attachment.cgi?id=53234&action=view
  (additional NULL pointer check)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Author: Federico Mena-Quintero <federico@ximian.com>
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or
9
 
 * modify it under the terms of version 2 of the GNU General Public
 
9
 * modify it under the terms of version 2 of the GNU Lesser General Public
10
10
 * License as published by the Free Software Foundation.
11
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
 
15
 * GNU Lesser General Public License for more details.
16
16
 *
17
 
 * You should have received a copy of the GNU General Public License
 
17
 * You should have received a copy of the GNU Lesser General Public License
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20
20
 */
55
55
        DEFAULT_OBJECT,
56
56
        OBJECT,
57
57
        OBJECT_LIST,
 
58
        ATTACHMENT_LIST,
58
59
        GET_TIMEZONE,
59
60
        ADD_TIMEZONE,
60
61
        SET_DEFAULT_TIMEZONE,
420
421
        g_list_free (object_list);
421
422
}
422
423
 
 
424
static void 
 
425
impl_notifyAttachmentListRequested (PortableServer_Servant servant,
 
426
                                const GNOME_Evolution_Calendar_CallStatus status,
 
427
                                const GNOME_Evolution_Calendar_stringlist *attachments,
 
428
                                CORBA_Environment *ev) 
 
429
{
 
430
        ECalListener *listener;
 
431
        ECalListenerPrivate *priv;
 
432
        GSList *a_list = NULL;
 
433
        int i;
 
434
        
 
435
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
 
436
        priv = listener->priv;
 
437
 
 
438
        if (!priv->notify)
 
439
                return;
 
440
 
 
441
        for (i = 0; i < attachments->_length; i++) {
 
442
                a_list = g_slist_append (a_list, g_strdup (attachments->_buffer[i]));
 
443
        }
 
444
 
 
445
        g_signal_emit (G_OBJECT (listener), signals[ATTACHMENT_LIST], 0, convert_status (status), a_list);
 
446
 
 
447
        g_slist_foreach (a_list, (GFunc) g_free, NULL);
 
448
        g_slist_free (a_list);
 
449
}
 
450
 
423
451
static void
424
452
impl_notifyTimezoneRequested (PortableServer_Servant servant,
425
453
                              const GNOME_Evolution_Calendar_CallStatus status,
728
756
        klass->epv.notifyDefaultObjectRequested = impl_notifyDefaultObjectRequested;
729
757
        klass->epv.notifyObjectRequested = impl_notifyObjectRequested;
730
758
        klass->epv.notifyObjectListRequested = impl_notifyObjectListRequested;
 
759
        klass->epv.notifyAttachmentListRequested = impl_notifyAttachmentListRequested;
731
760
        klass->epv.notifyTimezoneRequested = impl_notifyTimezoneRequested;
732
761
        klass->epv.notifyTimezoneAdded = impl_notifyTimezoneAdded;
733
762
        klass->epv.notifyDefaultTimezoneSet = impl_notifyDefaultTimezoneSet;
866
895
                              G_STRUCT_OFFSET (ECalListenerClass, object_list),
867
896
                              NULL, NULL,
868
897
                              e_cal_marshal_VOID__INT_POINTER,
 
898
                              G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
 
899
        signals[ATTACHMENT_LIST] =
 
900
                g_signal_new ("attachment_list",
 
901
                              G_TYPE_FROM_CLASS (klass),
 
902
                              G_SIGNAL_RUN_LAST,
 
903
                              G_STRUCT_OFFSET (ECalListenerClass, attachment_list),
 
904
                              NULL, NULL,
 
905
                              e_cal_marshal_VOID__INT_POINTER,
869
906
                              G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
870
907
        signals[GET_TIMEZONE] =
871
908
                g_signal_new ("get_timezone",
938
975
                       BONOBO_TYPE_OBJECT,
939
976
                       e_cal_listener);
940
977
 
 
978
/**
 
979
 * e_cal_listener_construct:
 
980
 * @listener: A calendar listener.
 
981
 * @cal_set_mode_fn: Function callback for notification that a
 
982
 * calendar changed modes.
 
983
 * @fn_data: Closure data pointer that will be passed to the notification
 
984
 * functions.
 
985
 *
 
986
 * Constructs all internal information for a calendar listener. This function
 
987
 * usually does not need to be called, unless creating a ECalListener-derived
 
988
 * class.
 
989
 *
 
990
 * Return value: the calendar listener ready to be used.
 
991
 */
941
992
ECalListener *
942
993
e_cal_listener_construct (ECalListener *listener,
943
994
                          ECalListenerCalSetModeFn cal_set_mode_fn,
960
1011
/**
961
1012
 * e_cal_listener_new:
962
1013
 * @cal_set_mode_fn: Function callback for notification that a
963
 
 * calendar changed modes
964
 
 * @fn_data: losure data pointer that will be passed to the notification
 
1014
 * calendar changed modes.
 
1015
 * @fn_data: Closure data pointer that will be passed to the notification
965
1016
 * functions.
966
1017
 * 
967
1018
 * Creates a new #ECalListener object.