diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-12 13:27:52 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-12 13:27:52 +0800 |
commit | 2f9fd80fc095224ff91fa43953d8a8d5f284a336 (patch) | |
tree | 1365b3130671d7c8b3ac04c72d47cbc33c99a64f /mail | |
parent | 6ea77903b10c8da838293e5a81076400430ac4c2 (diff) | |
download | gsoc2013-evolution-2f9fd80fc095224ff91fa43953d8a8d5f284a336.tar.gz gsoc2013-evolution-2f9fd80fc095224ff91fa43953d8a8d5f284a336.tar.zst gsoc2013-evolution-2f9fd80fc095224ff91fa43953d8a8d5f284a336.zip |
New convenience function that I will need later when I redo the composer
2001-01-12 Jeffrey Stedfast <fejj@ximian.com>
* mail-config.c (mail_config_get_account_by_name): New convenience
function that I will need later when I redo the composer From
field.
svn path=/trunk/; revision=7435
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/mail-config.c | 20 | ||||
-rw-r--r-- | mail/mail-config.h | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index bd3b27bd2d..41c4b9c2bf 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,9 @@ 2001-01-12 Jeffrey Stedfast <fejj@ximian.com> + * mail-config.c (mail_config_get_account_by_name): New convenience + function that I will need later when I redo the composer From + field. + * mail-display.c (on_object_requested): Update to reflect past changes to the mail-config API. diff --git a/mail/mail-config.c b/mail/mail-config.c index f238207d79..c5ba93f4a1 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -521,6 +521,7 @@ mail_config_get_default_account (void) account = l->data; if (account->default_account) return account; + l = l->next; } @@ -531,6 +532,25 @@ mail_config_get_default_account (void) return account; } +const MailConfigAccount * +mail_config_get_account_by_name (const char *account_name) +{ + /* FIXME: this should really use a hash */ + const MailConfigAccount *account; + GSList *l; + + l = config->accounts; + while (l) { + account = l->data; + if (!strcmp (account->name, account_name)) + return account; + + l = l->next; + } + + return NULL; +} + const GSList * mail_config_get_accounts (void) { diff --git a/mail/mail-config.h b/mail/mail-config.h index 5c40b832f2..cc8e9b7cbe 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -94,6 +94,7 @@ gint mail_config_get_mark_as_seen_timeout (void); void mail_config_set_mark_as_seen_timeout (gint timeout); const MailConfigAccount *mail_config_get_default_account (void); +const MailConfigAccount *mail_config_get_account_by_name (const char *account_name); const GSList *mail_config_get_accounts (void); void mail_config_add_account (MailConfigAccount *account); void mail_config_set_default_account (const MailConfigAccount *account); |