From: Sergio Villar Senin Date: Tue, 5 Aug 2008 16:45:57 +0000 (+0000) Subject: * Merged revisions 4870 & 5005 from trunk, both revisions have patches for well... X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=912c6a4c9b57c967a83e684d3861517e5df5c6fc;p=modest * Merged revisions 4870 & 5005 from trunk, both revisions have patches for well known problems in dimming rules pmo-diablo-r5264 --- diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 27990e9..a3fe625 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -1974,7 +1974,12 @@ on_account_went_online (TnyCamelAccount *account, gboolean canceled, GError *err /* Now it's really time to callback to the caller. If going online didn't succeed, * err will be set. We don't free it, Tinymail does that! If a cancel happened, * canceled will be set. Etcetera etcetera. */ - + + if (tny_account_get_connection_status (TNY_ACCOUNT (account)) == TNY_CONNECTION_STATUS_CONNECTED) + g_debug ("------------ %s %s CONECTADA", __FUNCTION__, tny_account_get_name (TNY_ACCOUNT (account))); + else + g_debug ("------------ %s %s NO conectada", __FUNCTION__, tny_account_get_name (TNY_ACCOUNT (account))); + if (info->callback) { info->callback (canceled, err, info->parent_window, info->account, info->user_data); } diff --git a/src/modest-dimming-rules-group.c b/src/modest-dimming-rules-group.c index a7459e3..c5bab55 100644 --- a/src/modest-dimming-rules-group.c +++ b/src/modest-dimming-rules-group.c @@ -39,6 +39,9 @@ static void modest_dimming_rules_group_finalize (GObject *obj); static void _insensitive_press_callback (GtkWidget *widget, gpointer user_data); +static void on_window_destroy (gpointer data, + GObject *object); + static void _add_rule (ModestDimmingRulesGroup *self, ModestDimmingRule *rule, ModestWindow *window); @@ -250,6 +253,7 @@ modest_dimming_rules_group_add_rules (ModestDimmingRulesGroup *self, /* Set window to process dimming rules */ priv->window = MODEST_WINDOW (window); + g_object_weak_ref (G_OBJECT (window), on_window_destroy, self); /* Add dimming rules */ for (i=0; i < n_elements; i++) { @@ -296,6 +300,9 @@ modest_dimming_rules_group_execute (ModestDimmingRulesGroup *self) g_return_if_fail (MODEST_IS_DIMMING_RULES_GROUP(self)); priv = MODEST_DIMMING_RULES_GROUP_GET_PRIVATE(self); + if (!priv->window) + return; + /* Init dimming rules init data */ state = modest_ui_dimming_rules_define_dimming_state (priv->window); modest_window_set_dimming_state (priv->window, state); @@ -357,3 +364,13 @@ _insensitive_press_callback (GtkWidget *widget, gpointer user_data) if (notification != NULL) g_free(notification); } + +static void +on_window_destroy (gpointer data, + GObject *object) +{ + ModestDimmingRulesGroup *self = MODEST_DIMMING_RULES_GROUP (data); + ModestDimmingRulesGroupPrivate *priv = MODEST_DIMMING_RULES_GROUP_GET_PRIVATE (self); + + priv->window = NULL; +} diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index e01d8e8..e3be664 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -497,7 +497,10 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win) modest_window_disable_dimming (MODEST_WINDOW(win)); /* Remove each header. If it's a view window header_view == NULL */ - mail_op = modest_mail_operation_new ((GObject *) win); + mail_op = modest_mail_operation_new_with_error_handling ((GObject *) win, + modest_ui_actions_disk_operations_error_handler, + g_strdup (_("mail_ib_file_operation_failed")), + g_free); modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op); modest_mail_operation_remove_msgs (mail_op, header_list, FALSE); diff --git a/src/modest-ui-dimming-manager.c b/src/modest-ui-dimming-manager.c index 3f33a2c..7c44e2b 100644 --- a/src/modest-ui-dimming-manager.c +++ b/src/modest-ui-dimming-manager.c @@ -207,6 +207,7 @@ process_dimming_rules_delayed_destroyer (gpointer data) priv = MODEST_UI_DIMMING_MANAGER_GET_PRIVATE(helper->manager); g_hash_table_remove (priv->delayed_calls, helper->name); g_free (helper->name); + g_object_unref (helper->manager); g_slice_free (DelayedDimmingRules, helper); } @@ -233,7 +234,7 @@ modest_ui_dimming_manager_process_dimming_rules_group (ModestUIDimmingManager *s /* Create the helper and start the timeout */ helper = g_slice_new (DelayedDimmingRules); helper->group = group; - helper->manager = self; + helper->manager = g_object_ref (self); helper->name = g_strdup (group_name); new_handler = g_timeout_add_full (G_PRIORITY_DEFAULT, 500, process_dimming_rules_delayed, helper, process_dimming_rules_delayed_destroyer);