aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/imap-features/imap-headers.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-11-04 11:36:30 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-11-07 09:10:57 +0800
commitbed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2 (patch)
tree13aec00b87de5a370343851d01edc4bede7bd89a /plugins/imap-features/imap-headers.c
parentd89f6379667a504ae2e3991eeeb543c43acb7003 (diff)
downloadgsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar.gz
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar.bz2
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar.lz
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar.xz
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.tar.zst
gsoc2013-evolution-bed7c0f05a4b4d60d35fd5e8ca1ade1e8225aae2.zip
EMAccountEditor: Start using CamelNetworkSettings.
Instead of stuffing host/port/user/etc into CamelURLs. To enforce this in 3rd party extensions, remove EAccounts from EMConfigTargetAccount and rename it EMConfigTargetSettings with the following struct members: const gchar *email_address; const gchar *storage_protocol; CamelSettings *storage_settings; const gchar *transport_protocol; CamelSettings *transport_settings;
Diffstat (limited to 'plugins/imap-features/imap-headers.c')
-rw-r--r--plugins/imap-features/imap-headers.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c
index a496106372..f09f880b36 100644
--- a/plugins/imap-features/imap-headers.c
+++ b/plugins/imap-features/imap-headers.c
@@ -78,18 +78,17 @@ void
imap_headers_commit (EPlugin *efp,
EConfigHookItemFactoryData *data)
{
- EMConfigTargetAccount *target_account;
+ EMConfigTargetSettings *target;
CamelFetchHeadersType fetch_headers;
- CamelSettings *settings;
- EAccount *modified_account;
gboolean use_imap = g_getenv ("USE_IMAP") != NULL;
+ const gchar *protocol;
- target_account = (EMConfigTargetAccount *) data->config->target;
- modified_account = target_account->modified_account;
- settings = target_account->settings;
+ target = (EMConfigTargetSettings *) data->config->target;
+ protocol = target->storage_protocol;
+
+ if (g_strcmp0 (protocol, "imap") == 0 ||
+ (use_imap && g_strcmp0 (protocol, "groupwise") == 0)) {
- if (g_str_has_prefix (modified_account->source->url, "imap://") ||
- (use_imap && g_str_has_prefix (modified_account->source->url, "groupwise://"))) {
GtkTreeModel *model;
GtkTreeIter iter;
gint n_children;
@@ -123,7 +122,7 @@ imap_headers_commit (EPlugin *efp,
fetch_headers = CAMEL_FETCH_HEADERS_BASIC_AND_MAILING_LIST;
g_object_set (
- settings,
+ target->storage_settings,
"fetch-headers", fetch_headers,
"fetch-headers-extra", strv, NULL);
@@ -249,9 +248,7 @@ GtkWidget *
org_gnome_imap_headers (EPlugin *epl,
EConfigHookItemFactoryData *data)
{
- EMConfigTargetAccount *target_account;
- CamelSettings *settings;
- EAccount *account;
+ EMConfigTargetSettings *target;
GtkWidget *vbox;
GtkBuilder *builder;
GtkWidget *button;
@@ -262,19 +259,20 @@ org_gnome_imap_headers (EPlugin *epl,
CamelFetchHeadersType fetch_headers = 0;
gchar **extra_headers = NULL;
gboolean use_imap = g_getenv ("USE_IMAP") != NULL;
+ const gchar *protocol;
guint ii, length = 0;
ui = g_new0 (EPImapFeaturesData, 1);
- target_account = (EMConfigTargetAccount *) data->config->target;
- account = target_account->modified_account;
- settings = target_account->settings;
+ target = (EMConfigTargetSettings *) data->config->target;
+ protocol = target->storage_protocol;
- if (!g_str_has_prefix (account->source->url, "imap://") && !(use_imap && g_str_has_prefix (account->source->url, "groupwise://")))
+ if (g_strcmp0 (protocol, "imap") != 0 &&
+ !(use_imap && g_strcmp0 (protocol, "groupwise") == 0))
return NULL;
g_object_get (
- settings,
+ target->storage_settings,
"fetch-headers", &fetch_headers,
"fetch-headers-extra", &extra_headers, NULL);