diff options
author | Don Sanders <don.sanders@nokia.com> | 2011-11-07 12:28:11 +0200 |
---|---|---|
committer | Don Sanders <don.sanders@nokia.com> | 2011-11-07 12:28:11 +0200 |
commit | ddb06d5550cc82084b3c34fb367584a2fa4605d7 (patch) | |
tree | bcc63284e5053f437ee49bff05653f98c0cb4728 | |
parent | 324b60b0cd5232b837eaa799bef7caa403941181 (diff) |
Upgrade IMAP accounts to set QMailAccount::CanSearchOnServer flag2011W44_2
When an IMAP service is instantiated, e.g. when sync is done in
an IMAP account.
Normally an upgrade script like mailaccounts-106-107.sqlite.sql
would be used to do this, but it would be time consuming to do
as the sql would need to set the status bit depending on the
type of the account, including MfE accounts. (Not sure what
account type string MfE accounts have).
-rw-r--r-- | src/plugins/messageservices/imap/imapservice.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/messageservices/imap/imapservice.cpp b/src/plugins/messageservices/imap/imapservice.cpp index a2309938..cba2873e 100644 --- a/src/plugins/messageservices/imap/imapservice.cpp +++ b/src/plugins/messageservices/imap/imapservice.cpp @@ -1309,6 +1309,12 @@ ImapService::ImapService(const QMailAccountId &accountId) _accountWasPushEnabled(false) { QMailAccount account(accountId); + if (!(account.status() && QMailAccount::CanSearchOnServer)) { + account.setStatus(QMailAccount::CanSearchOnServer, true); + if (!QMailStore::instance()->updateAccount(&account)) { + qWarning() << "Unable to update account" << account.id() << "to set imap CanSearchOnServer"; + } + } if (account.status() && QMailAccount::Enabled) { enable(); } |