Hi Federico,
Please change bmo#6498 to bmc #6498, here bmc means bugs.meego.com, thanks.

Regards,
Yin, Yan

> -----Original Message-----
> From: [email protected] [mailto:meego-commits-
> [email protected]] On Behalf Of Federico Mena Quintero
> Sent: Saturday, December 11, 2010 5:52 AM
> To: [email protected]
> Subject: [meego-commits] 10833: Changes to Trunk:Netbook/evolution
> 
> Hi,
> I have made the following changes to evolution in project Trunk:Netbook.
> Please review and accept ASAP.
> 
> Thank You,
> Federico Mena Quintero
> 
> [This message was auto-generated]
> 
> ---
> 
> Request #10833:
> 
>   submit:   home:federico:branches:Trunk:Netbook/evolution(r2)(cleanup)
> -> Trunk:Netbook/evolution
> 
> 
> Message:
>     bmo#6498 - Use Camel provider defaults when creating new email
> accounts
> 
> State:   new          2010-12-10T13:52:10 federico
> Comment: None
> 
> 
> 
> changes files:
> --------------
> --- evolution.changes
> +++ evolution.changes
> @@ -0,0 +1,5 @@
> +* Fri Dec 10 2010 Federico Mena-Quintero <[email protected]> -
> 2.30.1
> +- Added evolution-bmo6498-use-camel-provider-defaults.patch for
> +  bmo#6498 - the default options set by Camel providers were not
> +  actually being used when configuring new email accounts.
> +
> 
> new:
> ----
>   evolution-bmo6498-use-camel-provider-defaults.patch
> 
> spec files:
> -----------
> --- evolution.spec
> +++ evolution.spec
> @@ -95,6 +95,7 @@
>  Patch44: evolution-open-appt-bug-9637.patch
>  Patch45: evolution-set-size-for-fix-long-string-8974.patch
>  Patch46: evolution-capplet-account-label-8976.patch
> +Patch47: evolution-bmo6498-use-camel-provider-defaults.patch
>  ## Dependencies ###
> 
>  Requires(post): GConf2
> @@ -249,6 +250,7 @@
>  %patch44 -p1 -b .evolution-open-appt-bug-9637
>  %patch45 -p1 -b .evolution-set-size-for-fix-long-string-8974
>  %patch46 -p1 -b .evolution-capplet-account-label-8976
> +%patch47 -p1 -b .evolution-bmo6498-use-camel-provider-defaults
>  mkdir -p krb5-fakeprefix/include
>  mkdir -p krb5-fakeprefix/lib
>  mkdir -p krb5-fakeprefix/%{_lib}
> 
> other changes:
> --------------
> 
> ++++++ evolution-bmo6498-use-camel-provider-defaults.patch (new)
> --- evolution-bmo6498-use-camel-provider-defaults.patch
> +++ evolution-bmo6498-use-camel-provider-defaults.patch
> +From 5cff4d58fb0409cb8667cbec663c84478aed36ad Mon Sep 17 00:00:00 2001
> +From: Chenthill Palanisamy <[email protected]>
> +Date: Wed, 30 Jun 2010 16:22:26 +0530
> +Subject: [PATCH 1/6] Bug 623201 - Set default options automatically
> while creating a new account
> +
> +---
> + mail/em-account-editor.c |   13 ++++++++++++-
> + 1 files changed, 12 insertions(+), 1 deletions(-)
> +
> +diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
> +index 492cfaf..e79f38e 100644
> +--- a/mail/em-account-editor.c
> ++++ b/mail/em-account-editor.c
> +@@ -142,6 +142,7 @@ struct _EMAccountEditorPrivate {
> +
> +     EAccount *modified_account;
> +     EAccount *original_account;
> ++    gboolean new_account;
> +
> +     struct _EMConfig *config;
> +     GList *providers;
> +@@ -241,6 +242,7 @@ emae_set_original_account (EMAccountEditor *emae,
> +     } else {
> +             modified_account = e_account_new ();
> +             modified_account->enabled = TRUE;
> ++            emae->priv->new_account = TRUE;
> +
> +             e_account_set_string (
> +                     modified_account, E_ACCOUNT_DRAFTS_FOLDER_URI,
> +@@ -2250,7 +2252,9 @@ emae_option_toggle (EMAccountEditorService
> *service, CamelURL *url, const gchar
> + {
> +     GtkWidget *w;
> +
> +-    /* FIXME: how do we get the default value ever? */
> ++    if (service->emae->priv->new_account && def)
> ++            camel_url_set_param (url, name, "");
> ++
> +     w = gtk_check_button_new_with_mnemonic (text);
> +     g_object_set_data ((GObject *)w, "option-name", (gpointer)name);
> +     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
> camel_url_get_param (url, name) != NULL);
> +@@ -2355,6 +2359,13 @@ emae_option_checkspin (EMAccountEditorService
> *service, CamelURL *url, const gch
> +             max = 1.0;
> +     }
> +
> ++    if (service->emae->priv->new_account && on == 'y') {
> ++            gchar value[16];
> ++
> ++            sprintf (value, "%d", (gint) def);
> ++            camel_url_set_param (url, name, value);
> ++    }
> ++
> +     if ((enable = (val = camel_url_get_param (url, name)) != NULL) )
> +             def = strtod (val, NULL);
> +     else
> +--
> +1.7.1
> +
> +
> +From 6214d1c66b7379332e2c1a1e160c43c77191b98a Mon Sep 17 00:00:00 2001
> +From: Federico Mena Quintero <[email protected]>
> +Date: Wed, 1 Dec 2010 11:48:01 -0600
> +Subject: [PATCH 2/6] Function to set a CamelURL's defaults based on a
> provider's defaults
> +
> +In http://bugs.meego.com/show_bug.cgi?id=6498, part of the problem is
> that
> +when a mail account is created through the startup wizard in Express
> mode,
> +that account does not receive the default values that were defined by
> its
> +respective CamelProvider (i.e. the provider->extra_conf
> +CamelProviderConfEntry structures).
> +
> +However, the defaults *are* used if an account is created when not in
> +Express mode.  The problem is that Express mode doesn't include the
> +"Receiving options" page in its mail account editor, while non-express
> +mode does.  The utility functions to populate that page's widgets are
> the
> +ones responsible for setting the provider's default values on the
> CamelURL
> +for the new account.  Since in Express mode those widgets don't even
> get
> +created, the provider's defaults are never even considered.
> +
> +Here, what we do is to pull out the logic from those functions that
> create
> +widgets, so that we have set_provider_defaults_on_url(), a single
> function
> +to set default values from a CamelProvider into a CamelURL.  We will
> use
> +that function to set the defaults in both Express and non-express
> modes,
> +instead of depending on the widget code to do that.
> +
> +Signed-off-by: Federico Mena Quintero <[email protected]>
> +---
> + mail/em-account-editor.c |   89
> ++++++++++++++++++++++++++++++++++++++++++++++
> + 1 files changed, 89 insertions(+), 0 deletions(-)
> +
> +diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
> +index e79f38e..0f7687d 100644
> +--- a/mail/em-account-editor.c
> ++++ b/mail/em-account-editor.c
> +@@ -3319,6 +3319,95 @@ emae_editor_destroyed (GtkWidget *dialog,
> EMAccountEditor *emae)
> + }
> +
> + static void
> ++set_checkbox_default (CamelProviderConfEntry *entry, CamelURL *url)
> ++{
> ++    const gchar *value;
> ++
> ++    g_assert (entry->type == CAMEL_PROVIDER_CONF_CHECKBOX);
> ++
> ++    if (atoi (entry->value) != 0)
> ++            value = "";
> ++    else
> ++            value = NULL;
> ++
> ++    camel_url_set_param (url, entry->name, value);
> ++
> ++    /* FIXME: do we need to call emae_uri_changed()? */
> ++}
> ++
> ++static void
> ++set_entry_default (CamelProviderConfEntry *entry, CamelURL *url)
> ++{
> ++    g_assert (entry->type == CAMEL_PROVIDER_CONF_ENTRY);
> ++
> ++    camel_url_set_param (url, entry->name, entry->value);
> ++    /* FIXME: This comes from emae_option_entry().  That function
> calls
> ++     * emae_uri_changed(), but the corresponding emae_option_toggle()
> does
> ++     * not call emae_uri_changed() when it creates the checkbuttons -
> do
> ++     * we need to call that function at all?
> ++     */
> ++}
> ++
> ++static void
> ++set_checkspin_default (CamelProviderConfEntry *entry, CamelURL *url)
> ++{
> ++    gdouble min, def, max;
> ++    gchar on;
> ++
> ++    g_assert (entry->type == CAMEL_PROVIDER_CONF_CHECKSPIN);
> ++
> ++    /* FIXME: this is a fugly api.  See emae_option_checkspin() */
> ++    if (sscanf (entry->value, "%c:%lf:%lf:%lf", &on, &min, &def,
> &max) != 4) {
> ++            min = 0.0;
> ++            def = 0.0;
> ++            max = 1.0;
> ++    }
> ++
> ++    if (on == 'y') {
> ++            gchar value[16];
> ++
> ++            sprintf (value, "%d", (gint) def);
> ++            camel_url_set_param (url, entry->name, value);
> ++    } else
> ++            camel_url_set_param (url, entry->name, NULL);
> ++
> ++    /* FIXME: do we need to call emae_uri_changed()? */
> ++}
> ++
> ++static void
> ++set_provider_defaults_on_url (CamelProvider *provider, CamelURL *url)
> ++{
> ++    CamelProviderConfEntry *entries;
> ++    int i;
> ++
> ++    entries = provider->extra_conf;
> ++
> ++    for (i = 0; entries && entries[i].type != CAMEL_PROVIDER_CONF_END;
> i++) {
> ++            switch (entries[i].type) {
> ++            case CAMEL_PROVIDER_CONF_CHECKBOX:
> ++                    set_checkbox_default (entries + i, url);
> ++                    break;
> ++
> ++            case CAMEL_PROVIDER_CONF_ENTRY:
> ++                    set_entry_default (entries + i, url);
> ++                    break;
> ++
> ++            case CAMEL_PROVIDER_CONF_CHECKSPIN:
> ++                    set_checkspin_default (entries + i, url);
> ++                    break;
> ++
> ++            default:
> ++                    /* Other entry types don't have defaults, or so can
> be
> ++                     * inferred from emae_option_*().  But see
> ++                     * emae_option_options() - that *may* need something,
> ++                     * but that function doesn't actually modify the
> ++                     * CamelURL. */
> ++                    break;
> ++            }
> ++    }
> ++}
> ++
> ++static void
> + em_account_editor_construct (EMAccountEditor *emae,
> EMAccountEditorType type, const gchar *id)
> + {
> +     EMAccountEditorPrivate *priv = emae->priv;
> +--
> +1.7.1
> +
> +
> +From f3d72c5a200fd4ee4202e2c4cefce2ed5a8fa78f Mon Sep 17 00:00:00 2001
> +From: Federico Mena Quintero <[email protected]>
> +Date: Wed, 1 Dec 2010 13:23:41 -0600
> +Subject: [PATCH 3/6] Don't set the provider's defaults on the URL from
> the widget functions
> +
> +We will do that in a separate function to deal only with transferring
> (390 more lines skipped)
> 
> _______________________________________________
> MeeGo-commits mailing list
> [email protected]
> http://lists.meego.com/listinfo/meego-commits
_______________________________________________
MeeGo-packaging mailing list
[email protected]
http://lists.meego.com/listinfo/meego-packaging

Reply via email to