[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/pim/mailody/src
From: Tom Albers <tomalbers () kde ! nl>
Date: 2007-03-01 10:41:40
Message-ID: 1172745700.874527.19580.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 638256 by toma:
When filling the headers from the cache, start a verify of the flags after that. \
Should fix the status-has-changed-by-someone-else. ideally the imap protocol should \
indicate such a change by a number, so we can detect that.
M +2 -2 imaplib.cpp
M +14 -4 imapmanager.cpp
M +7 -0 imapmanager.h
--- trunk/playground/pim/mailody/src/imaplib.cpp #638255:638256
@@ -708,7 +708,7 @@
return;
}
- integrity(mb, totalShouldBe, uidvalidity, uidnext);
+ emit integrity(mb, totalShouldBe, uidvalidity, uidnext);
emit statusReady();
m_currentQueueItem = Queue();
QTimer::singleShot(0, this, SLOT(slotProcessQueue()));
@@ -822,7 +822,7 @@
if (m_currentQueueItem.state() == Queue::SyncMailBox)
getHeaderList(m_currentMailbox, 1, amount);
else
- integrity(m_currentMailbox, amount, uidvalidity, uidnext);
+ emit integrity(m_currentMailbox, amount, uidvalidity, uidnext);
}
// Sync will not emit the unseen count, so do a checkmail after that.
--- trunk/playground/pim/mailody/src/imapmanager.cpp #638255:638256
@@ -300,7 +300,12 @@
if (values.count() == 0)
m_imap->getMailBox( box );
else
+ {
emit mailBox( box, values );
+
+ //when using the cache, update the status list.
+ updateStatus(box);
+ }
}
}
@@ -363,6 +368,11 @@
m_imap->checkMail( mb );
}
+void ImapManager::updateStatus(const QString& mb)
+{
+ m_imap->getHeaderList( mb, 1, m_db->getTotalMessagesMailbox(mb));
+}
+
void ImapManager::slotMessagesInMailbox(Imaplib*, const QString& mb,
int amount)
{
@@ -555,15 +565,15 @@
// kdDebug() << k_funcinfo << endl;
int mailsReal = m_db->getTotalMessagesMessages(mb);
- // kdDebug() << "integrity: " << mb << " should be: "
- // << totalShouldBe << " current: " << mailsReal << endl;
+ kdDebug() << "integrity: " << mb << " should be: "
+ << totalShouldBe << " current: " << mailsReal << endl;
if (totalShouldBe > mailsReal)
{
// The amount on the server is bigger than that we have in the cache
// that probably means that there is new mail. Fetch missing.
- // kdDebug() << "Fetch missing: " << totalShouldBe
- // << " BUt: " << mailsReal << endl;
+ kdDebug() << "Fetch missing: " << totalShouldBe
+ << " BUt: " << mailsReal << endl;
m_imap->getHeaderList(mb, mailsReal+1, totalShouldBe);
}
else if (totalShouldBe != mailsReal)
--- trunk/playground/pim/mailody/src/imapmanager.h #638255:638256
@@ -95,6 +95,13 @@
* @param box the mailbox
*/
void checkMail(const QString& box);
+
+ /**
+ * This will refetch the tags.
+ * @param box the mailbox
+ *
+ */
+ void updateStatus(const QString& box);
/**
* returns if a message has that flag set, knowledge obtained from the
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic