diff options
author | Don Sanders <[email protected]> | 2010-08-22 20:04:50 +1000 |
---|---|---|
committer | Don Sanders <[email protected]> | 2010-08-22 20:04:50 +1000 |
commit | 3883d34064b6ea06b126400bbeb04e501b349a99 (patch) | |
tree | de50d3c22ec5fc912218caddb75b527c611857ae /examples/qtmail/app/emailclient.cpp | |
parent | 3d76e906a28c1dad3c7d1094e5c2d70063db3cb8 (diff) |
Simply qtmail example by using new
QMailRetrievalAction::synchronize function.
Diffstat (limited to 'examples/qtmail/app/emailclient.cpp')
-rw-r--r-- | examples/qtmail/app/emailclient.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/examples/qtmail/app/emailclient.cpp b/examples/qtmail/app/emailclient.cpp index e07fcb0d..7390ef46 100644 --- a/examples/qtmail/app/emailclient.cpp +++ b/examples/qtmail/app/emailclient.cpp @@ -476,7 +476,6 @@ EmailClient::EmailClient(QWidget *parent, Qt::WindowFlags f) initialAction(None), preSearchWidgetId(-1), m_messageServerProcess(0), - syncState(ExportUpdates), m_contextMenu(0), m_transmitAction(0), m_retrievalAction(0), @@ -1281,18 +1280,8 @@ void EmailClient::retrievalCompleted() { messageListView()->updateActions(); // update GetMoreMessagesButton if (mailAccountId.isValid()) { - if (syncState == ExportUpdates) { - // Find any changes to the folder list of the server - syncState = RetrieveFolders; - retrieveAction("Retrieving folder list for account")->retrieveFolderList(mailAccountId, QMailFolderId()); - } else if (syncState == RetrieveFolders) { - // Now we need to retrieve the message lists for the folders - syncState = RetrieveMessages; - retrieveAction("Retrieving message list for account")->retrieveMessageList(mailAccountId, QMailFolderId(), MoreMessagesIncrement); - } else { - // See if there are more accounts to process - getNextNewMail(); - } + // See if there are more accounts to process + getNextNewMail(); } else { autoGetMail = false; @@ -1316,9 +1305,7 @@ void EmailClient::getNewMail() selectedMessageId = QMailMessageId(); setRetrievalInProgress(true); - syncState = ExportUpdates; - - retrieveAction("Exporting account updates")->exportUpdates(mailAccountId); + retrieveAction("Exporting account updates")->synchronize(mailAccountId, MoreMessagesIncrement); } void EmailClient::getAllNewMail() @@ -1492,8 +1479,7 @@ void EmailClient::transferFailure(const QMailAccountId& accountId, const QString emit updateStatus(tr("Transfer cancelled")); } - if(syncState == ExportUpdates) - rollBackUpdates(); + rollBackUpdates(); if (isSending()) { sendFailure(accountId); |