projects
/
org.ibex.mail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b99b78d
)
clean up loose ends in SqliteMailbox
author
adam
<adam@megacz.com>
Sat, 1 Mar 2008 07:47:23 +0000
(07:47 +0000)
committer
adam
<adam@megacz.com>
Sat, 1 Mar 2008 07:47:23 +0000
(07:47 +0000)
darcs-hash:
20080301074723
-5007d-
a6f5ac86275a6f558454b3bc938af27573f6f3ef
.gz
src/org/ibex/mail/SqliteMailbox.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/mail/SqliteMailbox.java
b/src/org/ibex/mail/SqliteMailbox.java
index
5f23706
..
384dc4d
100644
(file)
--- a/
src/org/ibex/mail/SqliteMailbox.java
+++ b/
src/org/ibex/mail/SqliteMailbox.java
@@
-335,6
+335,7
@@
public class SqliteMailbox extends Mailbox.Default implements MailTree {
int oldflags = rs.getInt("flags_");
if (oldflags==flags) return;
Log.info(this, "setflags (old="+oldflags+")" + "update mail set flags_="+(flags)+" where uid_="+uid()+"");
int oldflags = rs.getInt("flags_");
if (oldflags==flags) return;
Log.info(this, "setflags (old="+oldflags+")" + "update mail set flags_="+(flags)+" where uid_="+uid()+"");
+ if ((flags & Mailbox.Flag.DELETED) != 0) Log.printStackTrace("deletion", Log.WARN);
PreparedStatement update = conn.prepareStatement("update mail set flags_=? where uid_=?");
update.setInt(1, flags);
update.setInt(2, uid());
PreparedStatement update = conn.prepareStatement("update mail set flags_=? where uid_=?");
update.setInt(1, flags);
update.setInt(2, uid());
@@
-353,11
+354,7
@@
public class SqliteMailbox extends Mailbox.Default implements MailTree {
}
public int imapNumber() {
if ("".equals(whereClause)) return count;
}
public int imapNumber() {
if ("".equals(whereClause)) return count;
- try {
- ResultSet rs = conn.prepareStatement("select count(*) from mail where uid_ <= " + uid()).executeQuery();
- rs.next();
- return rs.getInt(1);
- } catch (Exception e) { throw new RuntimeException(e); }
+ try { return queryImapNumberCache(uid()); } catch (SQLException s) { throw new RuntimeException(s); }
}
public int nntpNumber() { return uid(); }
public void delete() {
}
public int nntpNumber() { return uid(); }
public void delete() {