From d711a4fb856d51a66da47e104c017b4ef61a2967 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 2 Jun 2009 17:11:50 +0200 Subject: [PATCH] New ModestAccountProtocol method "get_service_name" --- src/modest-account-protocol.c | 24 ++++++++++++++++++++++++ src/modest-account-protocol.h | 16 +++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/modest-account-protocol.c b/src/modest-account-protocol.c index 70d8d24..c36e849 100644 --- a/src/modest-account-protocol.c +++ b/src/modest-account-protocol.c @@ -103,6 +103,9 @@ static const GdkPixbuf *modest_account_protocol_get_icon_default (ModestAccountP GObject *object, guint icon_size); +static gchar *modest_account_protocol_get_service_name_default (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox); /* globals */ static GObjectClass *parent_class = NULL; @@ -198,6 +201,8 @@ modest_account_protocol_class_init (ModestAccountProtocolClass *klass) modest_account_protocol_get_signature_default; account_class->get_icon = modest_account_protocol_get_icon_default; + account_class->get_service_name = + modest_account_protocol_get_service_name_default; } static void @@ -706,3 +711,22 @@ modest_account_protocol_get_icon_default (ModestAccountProtocol *self, ModestAcc return NULL; } + +gchar * +modest_account_protocol_get_service_name (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox) +{ + return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_name (self, account_id, mailbox); +} + +static gchar * +modest_account_protocol_get_service_name_default (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox) +{ + g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL); + + return NULL; +} + diff --git a/src/modest-account-protocol.h b/src/modest-account-protocol.h index cf70de5..f2b2aa0 100644 --- a/src/modest-account-protocol.h +++ b/src/modest-account-protocol.h @@ -85,9 +85,9 @@ struct _ModestAccountProtocolClass { gchar * (*get_signature) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox, gboolean *has_signature); const GdkPixbuf * (*get_icon) (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type, GObject *object, guint icon_size); + gchar * (*get_service_name) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox); /* Padding for future expansions */ - void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); @@ -405,6 +405,20 @@ gchar *modest_account_protocol_get_signature (ModestAccountProtocol *self, const GdkPixbuf * modest_account_protocol_get_icon (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type, GObject *object, guint icon_size); +/** + * modest_account_protocol_get_service_name: + * @self: a #ModestAccountProtocol + * @account_id: a transport account name + * @mailbox: a mailbox + * + * Obtain the service name string for the account and mailbox. + * + * Returns: a newly allocated string + */ +gchar *modest_account_protocol_get_service_name (ModestAccountProtocol *self, + const gchar *account_id, + const gchar *mailbox); + G_END_DECLS -- 1.7.9.5