aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-08-08 15:08:48 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-08-08 15:08:48 +0800
commit8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f (patch)
tree31efe5865be3ad641ecf4b2efcca08b22e76b965 /mail/mail-ops.c
parentb9eece78e66a15307e549d7ec5f03e624030a970 (diff)
downloadgsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar.gz
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar.bz2
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar.lz
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar.xz
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.tar.zst
gsoc2013-evolution-8fed71251f97eae4653fe0c0b0ff3dcdef5f5b1f.zip
Fix build by allowing includes for e-table dir
2000-08-08 JP Rosevear <jpr@helixcode.com> * Makefile.am: Fix build by allowing includes for e-table dir 2000-08-08 JP Rosevear <jpr@helixcode.com> * mail-ops.c (check_configured): Use config accessors (fetch_mail): ditto (composer_send_cb): ditto (create_msg_composer): ditto * mail-config-gui.h: Update API * mail-config.h: Update API * mail-config.c: Add accessor functions (mail_config_is_configured): accessor function (mail_config_get_default_identity): ditto (mail_config_get_default_source): ditto (mail_config_get_transport): ditto (mail_config_send_html): ditto (identity_copy): Make public (identity_destroy): ditto (identity_destroy_each): ditto (service_copy): ditto (service_destroy): ditto (service_destroy_each): ditto (mail_config_init): Rename from init_config and make public (mail_config_clear): Rename from clear_config and make public (mail_config_read): Rename from read_config and make public (mail_config_write): Reanme from write_config and make public * main.c (main): Call mail_config_init. * mail.h: Include mail-config-gui.h * mail-config-gui.c: Move config gui stuff here. (source_dialog): Kill memory leak from debug leftovers. Make sure returned source is NULL by default svn path=/trunk/; revision=4592
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 68edde98ff..2d94a94da2 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -103,17 +103,12 @@ async_mail_exception_dialog (char *head, CamelException *ex, gpointer unused )
static gboolean
check_configured (void)
{
- const MailConfig *config;
-
- config = mail_config_fetch ();
- if (config->configured)
+ if (mail_config_is_configured ())
return TRUE;
mail_config_druid ();
- config = mail_config_fetch ();
-
- return config->configured;
+ return mail_config_is_configured ();
}
static void
@@ -361,19 +356,15 @@ real_fetch_mail (gpointer user_data)
void
fetch_mail (GtkWidget *button, gpointer user_data)
{
- const MailConfig *config;
- const MailConfigService *source;
+ MailConfigService *source;
char *url = NULL;
rfm_t *info;
if (!check_configured ())
return;
- config = mail_config_fetch ();
- if (config->sources) {
- source = (MailConfigService *)config->sources->data;
- url = source->url;
- }
+ source = mail_config_get_default_source ();
+ url = source->url;
if (!url) {
GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data),
@@ -507,7 +498,6 @@ cleanup_send_mail (gpointer userdata)
static void
composer_send_cb (EMsgComposer *composer, gpointer data)
{
- const MailConfig *config;
const MailConfigIdentity *id = NULL;
static CamelTransport *transport = NULL;
struct post_send_data *psd = data;
@@ -520,9 +510,9 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
ex = camel_exception_new ();
- config = mail_config_fetch ();
+ id = mail_config_get_default_identity ();
- if (!check_configured() || !config->ids) {
+ if (!check_configured() || !id) {
GtkWidget *message;
message = gnome_warning_dialog_parented (_("You need to configure an identity\n"
@@ -536,9 +526,6 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
if (!from) {
CamelInternetAddress *ciaddr;
- if (config->ids->data) {
- id = (MailConfigIdentity *)config->ids->data;
- }
g_assert (id);
name = id->name;
@@ -554,9 +541,11 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
}
if (!transport) {
+ MailConfigService *t;
char *url;
- url = config->transport->url;
+ t = mail_config_get_transport ();
+ url = t->url;
g_assert (url);
transport = camel_session_get_transport (session, url, ex);
@@ -606,15 +595,15 @@ free_psd (GtkWidget *composer, gpointer user_data)
static GtkWidget *
create_msg_composer (const char *url)
{
- const MailConfig *config;
+ MailConfigIdentity *id;
+ gboolean send_html;
gchar *sig_file = NULL;
GtkWidget *composer_widget;
- config = mail_config_fetch ();
- if (config->ids) {
- const MailConfigIdentity *id;
-
- id = (MailConfigIdentity *)config->ids->data;
+ id = mail_config_get_default_identity ();
+ send_html = mail_config_send_html ();
+
+ if (id) {
sig_file = id->sig;
}
@@ -624,7 +613,7 @@ create_msg_composer (const char *url)
composer_widget = e_msg_composer_new_with_sig_file (sig_file);
e_msg_composer_set_send_html (E_MSG_COMPOSER (composer_widget),
- config->send_html);
+ send_html);
return composer_widget;
}