Move asdbus stuff to src/hildon2, as it's hildon/maemo specific.
[modest] / src / hildon2 / modest-hildon2-window-mgr.c
index 46db0f0..7c34155 100644 (file)
@@ -51,6 +51,7 @@
 #include "modest-tny-msg.h"
 #include "modest-tny-account.h"
 #include <tny-merge-folder.h>
+#include <modest-account-mgr-helpers.h>
 
 /* 'private'/'protected' functions */
 static void modest_hildon2_window_mgr_class_init (ModestHildon2WindowMgrClass *klass);
@@ -588,11 +589,20 @@ modest_hildon2_window_mgr_register_window (ModestWindowMgr *self,
 
                if (acc_name) {
                        modest_platform_remove_new_mail_notifications (FALSE, acc_name);
+                       modest_account_mgr_set_has_new_mails (modest_runtime_get_account_mgr (),
+                                                             acc_name,
+                                                             FALSE);
                }
        }
 
        /* Show toolbar always */
-       modest_window_show_toolbar (window, TRUE);
+       if (MODEST_IS_MSG_EDIT_WINDOW (window)) {
+               gboolean show_toolbar;
+               show_toolbar = modest_conf_get_bool (modest_runtime_get_conf (), MODEST_CONF_EDIT_WINDOW_SHOW_TOOLBAR, NULL);
+               modest_window_show_toolbar (window, show_toolbar);
+       } else {
+               modest_window_show_toolbar (window, TRUE);
+       }
 
        return TRUE;
 fail: