Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[qmf] Set new IMAP folders to inherit SynchronizationEnabled flag. Co…
…ntributes to JB#47389 This is to support configurable email folder synchronisation. Applies the following upstream patch. When new folders are received from the server, the client-side SynchronizationEnabled flag must be set for them. Previously they were always set to true, but if they're inside a folder that isn't being synced, this probably doesn't reflect the user's intent. This change makes it so that for IMAP any new folders received from the server will have the SynchronizationEnabled flag set to whatever value their parent has it set to. If they have no parent (i.e. are in the root folder) then the flag is set to true as before.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
rpm/0021-Set-new-IMAP-folders-to-inherit-SynchronizationEnab.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 1bb1394a3501b593bc2ce0c42b13720cc67a9609 Mon Sep 17 00:00:00 2001 | ||
From: David Llewellyn-Jones <david.llewellyn-jones@jolla.com> | ||
Date: Fri, 07 Feb 2020 19:29:59 +0200 | ||
Subject: [PATCH] Set new IMAP folders to inherit SynchronizationEnabled flag | ||
|
||
When new folders are received from the server, the client-side | ||
SynchronizationEnabled flag must be set for them. Previously they were | ||
always set to true, but if they're inside a folder that isn't being | ||
synced, this probably doesn't reflect the user's intent. | ||
|
||
This change makes it so that for IMAP any new folders received from the | ||
server will have the SynchronizationEnabled flag set to whatever value | ||
their parent has it set to. If they have no parent (i.e. are in the root | ||
folder) then the flag is set to true as before. | ||
|
||
Change-Id: If43d5e2b4469a402d203841c04cc4b1b30ffc3b1 | ||
--- | ||
|
||
diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp | ||
index a710d48..7a6c80a 100644 | ||
--- a/src/plugins/messageservices/imap/imapclient.cpp | ||
+++ b/src/plugins/messageservices/imap/imapclient.cpp | ||
@@ -822,8 +822,11 @@ | ||
// This element needs to be created | ||
QMailFolder folder(mailboxPath, parentId, _config.id()); | ||
folder.setDisplayName(QMailCodec::decodeModifiedUtf7(*it)); | ||
- folder.setStatus(QMailFolder::SynchronizationEnabled, true); | ||
folder.setStatus(QMailFolder::Incoming, true); | ||
+ // Set synchronization flag the same as parent folder, or true if there's no parent | ||
+ bool synchronize = parentId.isValid() ? | ||
+ QMailFolder(parentId).status() & QMailFolder::SynchronizationEnabled : true; | ||
+ folder.setStatus(QMailFolder::SynchronizationEnabled, synchronize); | ||
|
||
// The reported flags pertain to the listed folder only | ||
QString folderFlags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters