[Xfce4-commits] <postler:master> Selectively add instead of re-populuating folders
Christian Dywan
noreply at xfce.org
Tue Jul 5 18:14:03 CEST 2011
Updating branch refs/heads/master
to 0d7a91dccc513c18674406f70b8cf951061a5d28 (commit)
from a273d10faec4633e270f7f9a85a13f3c801a41bc (commit)
commit 0d7a91dccc513c18674406f70b8cf951061a5d28
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Jul 5 01:17:52 2011 +0200
Selectively add instead of re-populuating folders
Fixes: https://bugs.launchpad.net/postler/+bug/805157
postler/postler-bureau.vala | 3 ---
postler/postler-folders.vala | 11 ++++++++++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 667256a..ad09b78 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -219,7 +219,6 @@ public class Postler.Bureau : Gtk.Window {
}
account_info.path = "search:" + header + "/" + search.get_text ();
accounts.add_info (account_info);
- folders.populate ();
}
void action_view (Gtk.Action action) {
@@ -291,7 +290,6 @@ public class Postler.Bureau : Gtk.Window {
setup.done.connect ((setup, info) => {
accounts.add_info (info);
client.fetch (info.name);
- folders.populate ();
} );
}
@@ -802,7 +800,6 @@ public class Postler.Bureau : Gtk.Window {
messages.parent.show_all ();
accounts.add_info (info);
client.fetch (info.name);
- folders.populate ();
});
}
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index db9a515..f64ce57 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -19,11 +19,20 @@ public class Postler.Folders : Gtk.Toolbar {
public Folders (Accounts accounts) {
this.accounts = accounts;
+ accounts.add_info.connect ((info) => {
+ if (info.type == AccountType.SEARCH) {
+ var button = get_nth_item (0) as Gtk.RadioToolButton;
+ unowned GLib.SList<Gtk.RadioToolButton>? group = button.get_group ();
+ var search = folder_button (group, info.name,
+ info.path, FolderType.GENERIC);
+ insert (search, get_n_items () - 1);
+ }
+ });
populate ();
}
- public async void populate () {
+ async void populate () {
unowned GLib.SList<Gtk.RadioToolButton>? group = null;
for (int type = 0; type < FolderType.GENERIC; type++) {
var folder = (FolderType)type;
More information about the Xfce4-commits
mailing list