Use nicknames in sidebar; fix #6297

This also adds a signal disconnection I had missed with my previous
commit.

Squashed commit of the following:

commit d874ef81011342081258ce7ad3a9e43df8bed1a7
Author: Charles Lindsay <chaz@yorba.org>
Date:   Thu Jan 31 17:58:35 2013 -0800

    Simplify, from CR

commit f05f6f0e9ea86015f6ae1d6715340bb2fc8a4f87
Author: Charles Lindsay <chaz@yorba.org>
Date:   Thu Jan 31 17:44:37 2013 -0800

    Add previously-missing signal disconnect

commit 72981633bc8b104215d64e802ed5de9a4860a320
Author: Charles Lindsay <chaz@yorba.org>
Date:   Thu Jan 31 17:45:34 2013 -0800

    Change sidebar when nickname changes

commit fcc4d989a4a65d28e7e1d3c3df09075029430c5f
Author: Charles Lindsay <chaz@yorba.org>
Date:   Thu Jan 31 17:45:20 2013 -0800

    Use nickname instead of email address in sidebar
This commit is contained in:
Charles Lindsay 2013-01-31 17:59:59 -08:00
parent 3308189ece
commit e8c0cab8e8
2 changed files with 15 additions and 1 deletions

View file

@ -16,7 +16,7 @@ public class FolderList : Sidebar.Tree {
public Gee.HashMap<Geary.FolderPath, FolderEntry> folder_entries { get; private set; }
public AccountBranch(Geary.Account account) {
base(new Sidebar.Grouping(account.information.email, new ThemedIcon("emblem-mail")),
base(new Sidebar.Grouping(account.information.nickname, new ThemedIcon("emblem-mail")),
Sidebar.Branch.Options.NONE, special_folder_comparator);
this.account = account;
@ -24,9 +24,19 @@ public class FolderList : Sidebar.Tree {
IconFactory.instance.get_custom_icon("tags", IconFactory.ICON_SIDEBAR));
folder_entries = new Gee.HashMap<Geary.FolderPath, FolderEntry>();
account.information.notify["nickname"].connect(on_nicknamed_changed);
graft(get_root(), user_folder_group, normal_folder_comparator);
}
~AccountBranch() {
account.information.notify["nickname"].disconnect(on_nicknamed_changed);
}
private void on_nicknamed_changed() {
((Sidebar.Grouping) get_root()).rename(account.information.nickname);
}
private static int special_folder_comparator(Sidebar.Entry a, Sidebar.Entry b) {
// Our user folder grouping always comes dead last.
if (a is Sidebar.Grouping)

View file

@ -30,6 +30,10 @@ public class Geary.Imap.ClientSessionManager {
adjust_session_pool.begin();
}
~ClientSessionManager() {
account_information.notify["imap-credentials"].disconnect(on_imap_credentials_notified);
}
private void on_imap_credentials_notified() {
authentication_failed = false;
adjust_session_pool.begin();