[Xfce4-commits] <postler:master> Render indicators with unread_messages and unread
Christian Dywan
noreply at xfce.org
Sat Jun 4 14:30:08 CEST 2011
Updating branch refs/heads/master
to b03910de19acbd3a339609b7dbcb6302126e8d0f (commit)
from 154243402d30f13eabee3176f32667c82a100f80 (commit)
commit b03910de19acbd3a339609b7dbcb6302126e8d0f
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Jun 3 23:01:55 2011 +0200
Render indicators with unread_messages and unread
Also stop drawing attention.
postler/postler-service.vala | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/postler/postler-service.vala b/postler/postler-service.vala
index 8a906f2..6d94082 100644
--- a/postler/postler-service.vala
+++ b/postler/postler-service.vala
@@ -136,18 +136,17 @@ namespace Postler {
List<Indicate.Indicator> items;
void update_inbox_indicator (Indicate.Indicator item) {
- string path = item.get_property ("url") + "/INBOX/new";
+ string path = "file://" + item.get_property ("url") + "/INBOX/%";
uint new_messages = 0;
+
+ notify["unread"].connect ((object, pspec) => {
+ update_inbox_indicator (item);
+ });
+
try {
- new_messages = (uint)unread_messages ("file://" + path);
- var folder = File.new_for_path (path);
- var monitor = folder.monitor_directory (0, null);
- monitor.changed.connect ((monitor, file, other, event) => {
- update_inbox_indicator (item);
- });
- indicator.set_data ("monitor", monitor);
-
- } catch (Error error) {
+ new_messages = (uint)unread_messages (path);
+ }
+ catch (Error error) {
GLib.warning ("Indicator: %s", error.message);
}
@@ -166,7 +165,6 @@ namespace Postler {
var item = new Indicate.Indicator.with_server (indicator);
item.set_property ("name", info.display_name);
item.set_property ("url", info.path);
- item.set_property ("draw-attention", "true");
item.user_display.connect ((item) => {
string url = item.get_property ("url");
Postler.App.spawn_module ("bureau", url + "/INBOX");
@@ -191,7 +189,6 @@ namespace Postler {
}
bool badge_timer () {
- var accounts = new Accounts ();
uint new_messages = 0;
try {
new_messages = (uint)unread_messages ("%/INBOX/%");
More information about the Xfce4-commits
mailing list