[Xfce4-commits] <postler:master> Count the number of messages without duplicates
Christian Dywan
noreply at xfce.org
Sat Jun 4 14:30:07 CEST 2011
Updating branch refs/heads/master
to 154243402d30f13eabee3176f32667c82a100f80 (commit)
from 1b3156812d94e4dddfb7923d54f42456a9c6b772 (commit)
commit 154243402d30f13eabee3176f32667c82a100f80
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Jun 2 21:21:12 2011 +0200
Count the number of messages without duplicates
postler/postler-index.vala | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/postler/postler-index.vala b/postler/postler-index.vala
index 99531c2..1c5d62c 100644
--- a/postler/postler-index.vala
+++ b/postler/postler-index.vala
@@ -147,7 +147,7 @@ namespace Postler {
public int64 unread_messages (string folder) throws GLib.Error {
if (statement_unread == null) {
if (database.prepare_v2 ("""
- SELECT COUNT (*) FROM messages WHERE uri LIKE ?1 AND unread != 0
+ SELECT COUNT (id) FROM (SELECT DISTINCT id FROM messages WHERE uri LIKE ?1 AND unread != 0)
""",
-1, out statement_unread) != Sqlite.OK)
throw new GLib.FileError.FAILED (_("Failed to count unread messages: %s"), database.errmsg ());
More information about the Xfce4-commits
mailing list