diff options
| author | Don Sanders <don.sanders@nokia.com> | 2011-03-14 19:06:42 +1000 |
|---|---|---|
| committer | Don Sanders <don.sanders@nokia.com> | 2011-03-14 19:06:42 +1000 |
| commit | 241e13a614450ed43d47b23f78fd348c5c8cf0bd (patch) | |
| tree | 09e82b9b5cea33468d70b6bc162ae6dd1fbb04d5 | |
| parent | bf972903437feb8cf355839aa95c629b3e68d5b1 (diff) | |
Optionally enabled pipeling of SELECT + UID FETCH command combination
If an ImapConfiguration object has a "fullPipelining" value != 0 then
SELECT + UID FETCH pipelining will be enabled.
Otherwise such pipelining will be disabled, this is the default.
Followup for NB#235204
| -rw-r--r-- | src/plugins/messageservices/imap/imapconfiguration.cpp | 13 | ||||
| -rw-r--r-- | src/plugins/messageservices/imap/imapconfiguration.h | 3 | ||||
| -rw-r--r-- | src/plugins/messageservices/imap/imapstrategy.cpp | 9 |
3 files changed, 24 insertions, 1 deletions
diff --git a/src/plugins/messageservices/imap/imapconfiguration.cpp b/src/plugins/messageservices/imap/imapconfiguration.cpp index 7a46a13d..5c6b0d12 100644 --- a/src/plugins/messageservices/imap/imapconfiguration.cpp +++ b/src/plugins/messageservices/imap/imapconfiguration.cpp @@ -178,6 +178,19 @@ void ImapConfiguration::setTimeTillLogout(int milliseconds) setValue("timeTillLogout", QString::number(milliseconds)); } +// Defines if aggresive pipelining will be used +// Currently SELECT + UID FETCH command combination may be pipelined iff true +bool ImapConfiguration::fullPipelining() const +{ + return (value("fullPipelining", "0").toInt() != 0); +} + + +void ImapConfiguration::setFullPipelining(bool b) +{ + setValue("fullPipelining", QString::number(b ? 1 : 0)); +} + ImapConfigurationEditor::ImapConfigurationEditor(QMailAccountConfiguration *config) : ImapConfiguration(*config) { diff --git a/src/plugins/messageservices/imap/imapconfiguration.h b/src/plugins/messageservices/imap/imapconfiguration.h index 88586c7e..b0d821d8 100644 --- a/src/plugins/messageservices/imap/imapconfiguration.h +++ b/src/plugins/messageservices/imap/imapconfiguration.h @@ -90,6 +90,9 @@ public: int timeTillLogout() const; void setTimeTillLogout(int milliseconds); + + bool fullPipelining() const; + void setFullPipelining(bool b); }; class PLUGIN_EXPORT ImapConfigurationEditor : public ImapConfiguration diff --git a/src/plugins/messageservices/imap/imapstrategy.cpp b/src/plugins/messageservices/imap/imapstrategy.cpp index df620954..ce091693 100644 --- a/src/plugins/messageservices/imap/imapstrategy.cpp +++ b/src/plugins/messageservices/imap/imapstrategy.cpp @@ -2069,7 +2069,9 @@ void ImapSynchronizeBaseStrategy::handleSelect(ImapStrategyContextBase *context) { // We have selected the current mailbox if (_transferState == Preview) { - fetchNextMailPreview(context); + if (!(ImapConfiguration(context->config()).fullPipelining())) { + fetchNextMailPreview(context); + } // else the scheduled fetch command was pipelined } else if (_transferState == Complete) { // We're completing a message or section messageListMessageAction(context); @@ -2151,6 +2153,11 @@ bool ImapSynchronizeBaseStrategy::selectNextPreviewFolder(ImapStrategyContextBas } selectFolder(context, _currentMailbox ); + + if (ImapConfiguration(context->config()).fullPipelining()) { + // Send fetch command without waiting for Select response + fetchNextMailPreview(context); + } } } |
