From dcc3d40b2c0a78ba75ccae41619cb309ec6006c5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 7 Dec 2011 22:23:21 -0500 Subject: MailFolderCache: Add class methods for signals. --- mail/mail-folder-cache.c | 34 ++++++++++++++++++---------------- mail/mail-folder-cache.h | 26 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 16 deletions(-) (limited to 'mail') diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index dbb8ef8bfc..88b089edcc 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -956,7 +956,7 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) "folder-available", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ + G_STRUCT_OFFSET (MailFolderCacheClass, folder_available), NULL, NULL, /* accumulator */ e_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, @@ -976,7 +976,7 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) "folder-unavailable", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ + G_STRUCT_OFFSET (MailFolderCacheClass, folder_unavailable), NULL, NULL, /* accumulator */ e_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, @@ -994,7 +994,7 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) "folder-deleted", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ + G_STRUCT_OFFSET (MailFolderCacheClass, folder_deleted), NULL, NULL, /* accumulator */ e_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, @@ -1013,7 +1013,7 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) "folder-renamed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ + G_STRUCT_OFFSET (MailFolderCacheClass, folder_renamed), NULL, NULL, /* accumulator */ e_marshal_VOID__OBJECT_STRING_STRING, G_TYPE_NONE, 3, @@ -1024,25 +1024,27 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) /** * MailFolderCache::folder-unread-updated * @store: the #CamelStore containing the folder - * @name: the name of the folder + * @folder_name: the name of the folder * @unread: the number of unread mails in the folder * * Emitted when a we receive an update to the unread count for a folder **/ - signals[FOLDER_UNREAD_UPDATED] = - g_signal_new ("folder-unread-updated", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ - NULL, NULL, /* accumulator */ - e_marshal_VOID__OBJECT_STRING_INT, - G_TYPE_NONE, 3, - CAMEL_TYPE_OBJECT, G_TYPE_STRING, G_TYPE_INT); + signals[FOLDER_UNREAD_UPDATED] = g_signal_new ( + "folder-unread-updated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (MailFolderCacheClass, folder_unread_updated), + NULL, NULL, /* accumulator */ + e_marshal_VOID__OBJECT_STRING_INT, + G_TYPE_NONE, 3, + CAMEL_TYPE_STORE, + G_TYPE_STRING, + G_TYPE_INT); /** * MailFolderCache::folder-changed * @store: the #CamelStore containing the folder - * @folder_fullname: the full name of the folder + * @folder_name: the name of the folder * @new_messages: the number of new messages for the folder * @msg_uid: uid of the new message, or NULL * @msg_sender: sender of the new message, or NULL @@ -1055,7 +1057,7 @@ mail_folder_cache_class_init (MailFolderCacheClass *class) "folder-changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - 0, /* struct offset */ + G_STRUCT_OFFSET (MailFolderCacheClass, folder_changed), NULL, NULL, /* accumulator */ e_marshal_VOID__OBJECT_STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, 6, diff --git a/mail/mail-folder-cache.h b/mail/mail-folder-cache.h index 681c6efdda..a142272661 100644 --- a/mail/mail-folder-cache.h +++ b/mail/mail-folder-cache.h @@ -77,6 +77,32 @@ struct _MailFolderCache { struct _MailFolderCacheClass { GObjectClass parent_class; + + /* Signals */ + void (*folder_available) (MailFolderCache *cache, + CamelStore *store, + const gchar *folder_name); + void (*folder_unavailable) (MailFolderCache *cache, + CamelStore *store, + const gchar *folder_name); + void (*folder_deleted) (MailFolderCache *cache, + CamelStore *store, + const gchar *folder_name); + void (*folder_renamed) (MailFolderCache *cache, + CamelStore *store, + const gchar *old_folder_name, + const gchar *new_folder_name); + void (*folder_unread_updated) + (MailFolderCache *cache, + CamelStore *store, + const gchar *folder_name, + gint unread); + void (*folder_changed) (MailFolderCache *cache, + CamelStore *store, + gint new_messages, + const gchar *msg_uid, + const gchar *msg_sender, + const gchar *msg_subject); }; GType mail_folder_cache_get_type (void) G_GNUC_CONST; -- cgit