Skip to content

Commit

Permalink
Merge branch 'rebase_after_folder_flags' into 'master'
Browse files Browse the repository at this point in the history
[messagingframework] Update to new upstream checkout. Contributes to JB#41524

See merge request mer-core/messagingframework!20
  • Loading branch information
pvuorela committed Nov 5, 2018
2 parents a5a71f1 + 5c44680 commit 64a284d
Show file tree
Hide file tree
Showing 20 changed files with 278 additions and 423 deletions.
@@ -1,4 +1,4 @@
From 14476c4887a4e47ca7135749cf3acc218d7bd5cb Mon Sep 17 00:00:00 2001
From 861537a78563e2a4cc92bcd1913f021421b7b8e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Val=C3=A9rio=20Val=C3=A9rio?= <valerio.valerio@jolla.com>
Date: Mon, 23 Feb 2015 13:08:24 +0200
Subject: [PATCH 01/19] Stop _incomingDataTimer when imapprotocol object is
Expand All @@ -10,10 +10,10 @@ A crash occurs in case the timer is active and the object is destroyed.
1 file changed, 3 insertions(+)

diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp
index b37d990d..df5da7f2 100644
index 6de98d68..2c945d3f 100644
--- a/src/plugins/messageservices/imap/imapprotocol.cpp
+++ b/src/plugins/messageservices/imap/imapprotocol.cpp
@@ -2995,6 +2995,9 @@ ImapProtocol::ImapProtocol()
@@ -3012,6 +3012,9 @@ ImapProtocol::ImapProtocol()

ImapProtocol::~ImapProtocol()
{
Expand All @@ -24,5 +24,5 @@ index b37d990d..df5da7f2 100644
delete _fsm;
}
--
2.17.1
2.17.2

@@ -1,4 +1,4 @@
From 978bc8b258fb36cb517a1db4c873033cdf56e718 Mon Sep 17 00:00:00 2001
From 036c88b752d8926f1a699452a121f88c211c92ce Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Mon, 13 Aug 2018 15:45:24 +0300
Subject: [PATCH 02/19] Introduce acceptUntrustedCertificates() configuration.
Expand Down Expand Up @@ -198,10 +198,10 @@ index f0c0569a..69dc8ad1 100644

void setDeleteMail(bool b);
diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp
index df5da7f2..4d1ecfe7 100644
index 2c945d3f..35614ea5 100644
--- a/src/plugins/messageservices/imap/imapprotocol.cpp
+++ b/src/plugins/messageservices/imap/imapprotocol.cpp
@@ -3036,10 +3036,18 @@ bool ImapProtocol::open( const ImapConfiguration& config, qint64 bufferSize)
@@ -3053,10 +3053,18 @@ bool ImapProtocol::open( const ImapConfiguration& config, qint64 bufferSize)
this, SLOT(connected(QMailTransport::EncryptType)));
connect(_transport, SIGNAL(readyRead()),
this, SLOT(incomingData()));
Expand Down Expand Up @@ -264,7 +264,7 @@ index a1c50426..50c12e51 100644
void test();

diff --git a/src/plugins/messageservices/pop/popclient.cpp b/src/plugins/messageservices/pop/popclient.cpp
index 523850f2..37626baf 100644
index 16562e0b..595c62a9 100644
--- a/src/plugins/messageservices/pop/popclient.cpp
+++ b/src/plugins/messageservices/pop/popclient.cpp
@@ -112,6 +112,10 @@ void PopClient::createTransport()
Expand Down Expand Up @@ -441,5 +441,5 @@ index e8b28a6b..ed115d53 100644
void setSmtpPassword(const QString& password);
void setSmtpAuthentication(int t);
--
2.17.1
2.17.2

8 changes: 4 additions & 4 deletions rpm/0003-fix-tests-installation-path.patch
@@ -1,4 +1,4 @@
From 28ca7ccd92627207196b76babfe04b064bc2da18 Mon Sep 17 00:00:00 2001
From ff786f09e3d6edd8a11b173f4ce6cb9e7917f971 Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Tue, 30 Apr 2013 14:38:17 +0300
Subject: [PATCH 03/19] fix tests installation path.
Expand Down Expand Up @@ -1475,10 +1475,10 @@ index 623b19ca..1d3ba39e 100644
include(../common.pri)

diff --git a/tests/tests.pro b/tests/tests.pro
index 383d8419..6edc0344 100644
index cac44948..cae08159 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -37,5 +37,5 @@ CONFIG += unittest
@@ -41,5 +41,5 @@ CONFIG += unittest

# Install test file description
test_description.files = qt5/tests.xml
Expand Down Expand Up @@ -2935,5 +2935,5 @@ index 4cde1fe3..204ecd5a 100644

INSTALLS += testdata
--
2.17.1
2.17.2

402 changes: 138 additions & 264 deletions rpm/0004-Accounts-qt-integration.patch

Large diffs are not rendered by default.

@@ -1,4 +1,4 @@
From a21882a3d1ee1f0b74eafb1773c6437fa8727235 Mon Sep 17 00:00:00 2001
From b444c7fe216da0b94f67f68786ab6ed4231b1dc1 Mon Sep 17 00:00:00 2001
From: Evgeny Karpov <evgeny.karpov@oss.tieto.com>
Date: Thu, 24 Oct 2013 09:37:30 +0000
Subject: [PATCH 05/19] Start messageserver on system startup in case there are
Expand Down Expand Up @@ -172,5 +172,5 @@ index d05c3377..689ad320 100644
+ SUBDIRS += accountscheck
+}
--
2.17.1
2.17.2

12 changes: 6 additions & 6 deletions rpm/0006-Add-keepalive-timer-to-IMAP-IDLE-service.patch
@@ -1,4 +1,4 @@
From 8fa73f84d55e1948f29be4d3c4ba51ac7342f271 Mon Sep 17 00:00:00 2001
From c6a7e74090171af6d67bb4fc97c745c6c50fc4d2 Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Wed, 10 Sep 2014 14:36:13 +0300
Subject: [PATCH 06/19] Add keepalive timer to IMAP IDLE service
Expand Down Expand Up @@ -29,10 +29,10 @@ index 1c0ae6bb..1b5742b4 100644
QT += alignedtimer
}
diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp
index 33f17d5d..e6398bea 100644
index 1c132995..24dfa0cf 100644
--- a/src/plugins/messageservices/imap/imapclient.cpp
+++ b/src/plugins/messageservices/imap/imapclient.cpp
@@ -1995,6 +1995,9 @@ void ImapClient::closeIdleConnections()
@@ -2003,6 +2003,9 @@ void ImapClient::closeIdleConnections()
qMailLog(IMAP) << Q_FUNC_INFO << "Account was modified. Closing connections";

closeConnection();
Expand All @@ -43,7 +43,7 @@ index 33f17d5d..e6398bea 100644
foreach(const QMailFolderId &id, _monitored.keys()) {
IdleProtocol *protocol = _monitored.take(id);
diff --git a/src/plugins/messageservices/imap/imapclient.h b/src/plugins/messageservices/imap/imapclient.h
index 74dfbbb7..1945b951 100644
index 36428286..ebd7afb7 100644
--- a/src/plugins/messageservices/imap/imapclient.h
+++ b/src/plugins/messageservices/imap/imapclient.h
@@ -51,6 +51,9 @@
Expand All @@ -67,7 +67,7 @@ index 74dfbbb7..1945b951 100644
void progressChanged(uint, uint);
void retrievalCompleted();
diff --git a/src/plugins/messageservices/imap/imapservice.cpp b/src/plugins/messageservices/imap/imapservice.cpp
index d03aed78..6a0954dd 100644
index 61a049b3..65bfee9d 100644
--- a/src/plugins/messageservices/imap/imapservice.cpp
+++ b/src/plugins/messageservices/imap/imapservice.cpp
@@ -1512,6 +1512,14 @@ ImapService::ImapService(const QMailAccountId &accountId)
Expand Down Expand Up @@ -204,5 +204,5 @@ index 7b688c52..1855eba5 100644

class ImapServicePlugin : public QMailMessageServicePlugin
--
2.17.1
2.17.2

4 changes: 2 additions & 2 deletions rpm/0007-Use-Qt5-booster-to-save-memory.patch
@@ -1,4 +1,4 @@
From 5a1106dad9f9c11e808e36e7f68e9c22176986db Mon Sep 17 00:00:00 2001
From a6fa0b03ba4bc51c0338f7a31f0b8ba316376b7a Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Mon, 27 Oct 2014 09:49:12 +0200
Subject: [PATCH 07/19] Use Qt5 booster to save memory.
Expand Down Expand Up @@ -61,5 +61,5 @@ index 0d583d15..a5aa05a9 100644
RestartSec=1

--
2.17.1
2.17.2

27 changes: 13 additions & 14 deletions rpm/0008-Introduce-QMailAccount-HasPersistentConnection-statu.patch
@@ -1,4 +1,4 @@
From d37dae961bf066d758406f105224d555c5fec30e Mon Sep 17 00:00:00 2001
From a1b4652fc0c67cb9d4eeeaede7ce1a3752fa5d47 Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Mon, 13 Aug 2018 17:24:36 +0300
Subject: [PATCH 08/19] Introduce QMailAccount::HasPersistentConnection status
Expand All @@ -12,10 +12,10 @@ keepalive(less state transitions).
src/libraries/qmfclient/qmailaccount.cpp | 11 +++
src/libraries/qmfclient/qmailaccount.h | 1 +
src/libraries/qmfclient/qmailstore_p.cpp | 12 ++++
.../messageservices/imap/imapclient.cpp | 13 +++-
.../messageservices/imap/imapclient.cpp | 12 ++++
.../messageservices/imap/imapservice.cpp | 70 ++++++++++---------
.../messageservices/imap/imapservice.h | 3 -
6 files changed, 72 insertions(+), 38 deletions(-)
6 files changed, 72 insertions(+), 37 deletions(-)

diff --git a/src/libraries/qmfclient/qmailaccount.cpp b/src/libraries/qmfclient/qmailaccount.cpp
index 3211155d..85796363 100644
Expand Down Expand Up @@ -66,7 +66,7 @@ index 4d5ab660..8ba3efa9 100644
QMailAccount();
explicit QMailAccount(const QMailAccountId& id);
diff --git a/src/libraries/qmfclient/qmailstore_p.cpp b/src/libraries/qmfclient/qmailstore_p.cpp
index 12c71068..c3035d9f 100644
index 8180cb64..599b573b 100644
--- a/src/libraries/qmfclient/qmailstore_p.cpp
+++ b/src/libraries/qmfclient/qmailstore_p.cpp
@@ -2671,6 +2671,10 @@ bool SSOAccountSatisfyTheProperty(Accounts::Account* ssoAccount, const QMailAcco
Expand All @@ -89,7 +89,7 @@ index 12c71068..c3035d9f 100644
|| attemptRegisterStatusBit(QLatin1String("SynchronizationEnabled"), QLatin1String("folderstatus"),
63, true, const_cast<quint64 *>(&QMailFolder::SynchronizationEnabled), t, false)
|| attemptRegisterStatusBit(QLatin1String("Synchronized"), QLatin1String("folderstatus"),
@@ -3708,11 +3714,13 @@ QMailAccount QMailStorePrivate::extractAccount(const QSharedPointer<Accounts::Ac
@@ -3710,11 +3716,13 @@ QMailAccount QMailStorePrivate::extractAccount(const QSharedPointer<Accounts::Ac
const bool& isDefault = ssoAccount->valueAsBool("email/default");
const bool& canTransmit = ssoAccount->valueAsBool("canTransmit", true);
const bool& appendSignature = ssoAccount->valueAsBool("signatureEnabled", true);
Expand All @@ -103,7 +103,7 @@ index 12c71068..c3035d9f 100644

result.setSignature(ssoAccount->valueAsString("signature"));
result.setFromAddress(ssoAccount->contains("fullName")?
@@ -6217,6 +6225,8 @@ QMailStorePrivate::AttemptResult QMailStorePrivate::attemptAddAccount(QMailAccou
@@ -6219,6 +6227,8 @@ QMailStorePrivate::AttemptResult QMailStorePrivate::attemptAddAccount(QMailAccou
ssoAccount->setValue("status", account->status());
const bool appendSignature = (account->status() & QMailAccount::AppendSignature);
ssoAccount->setValue("signatureEnabled", appendSignature);
Expand All @@ -112,7 +112,7 @@ index 12c71068..c3035d9f 100644
ssoAccount->setValue("signature", account->signature());
ssoAccount->setValue("emailaddress", account->fromAddress().address());
ssoAccount->setValue("fullName", account->fromAddress().name());
@@ -7019,6 +7029,8 @@ QMailStorePrivate::AttemptResult QMailStorePrivate::attemptUpdateAccount(QMailAc
@@ -7021,6 +7031,8 @@ QMailStorePrivate::AttemptResult QMailStorePrivate::attemptUpdateAccount(QMailAc
ssoAccount->setValue("status", account->status());
bool signatureEnabled = account->status() & QMailAccount::AppendSignature;
ssoAccount->setValue("signatureEnabled", signatureEnabled);
Expand All @@ -122,17 +122,15 @@ index 12c71068..c3035d9f 100644
ssoAccount->setValue("emailaddress", account->fromAddress().address());
ssoAccount->setValue("fullName", account->fromAddress().name());
diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp
index e6398bea..aa05b3dc 100644
index 24dfa0cf..793e6177 100644
--- a/src/plugins/messageservices/imap/imapclient.cpp
+++ b/src/plugins/messageservices/imap/imapclient.cpp
@@ -1564,7 +1564,18 @@ void ImapClient::setAccount(const QMailAccountId &id)
@@ -1573,6 +1573,18 @@ void ImapClient::setAccount(const QMailAccountId &id)
}
}

_config = QMailAccountConfiguration(id);
-
+ // At this point account can't have a persistent connection to the server, if for some reason the status is wrong(crash/abort) we will
+ // reset correct status here.
+ QMailAccount account(id);
+ const bool hasPersistentConnection = (account.status() & QMailAccount::HasPersistentConnection);
+ if (hasPersistentConnection) {
+ account.setStatus(QMailAccount::HasPersistentConnection, false);
Expand All @@ -142,11 +140,12 @@ index e6398bea..aa05b3dc 100644
+ qMailLog(Messaging) << "HasPersistentConnection for " << account.id() << "changed to" << false;
+ }
+ }
+
#ifdef USE_ACCOUNTS_QT
if (!_ssoSessionManager) {
ImapConfiguration imapCfg(_config);
diff --git a/src/plugins/messageservices/imap/imapservice.cpp b/src/plugins/messageservices/imap/imapservice.cpp
index 6a0954dd..3d33db6d 100644
index 65bfee9d..3339314e 100644
--- a/src/plugins/messageservices/imap/imapservice.cpp
+++ b/src/plugins/messageservices/imap/imapservice.cpp
@@ -1513,11 +1513,8 @@ ImapService::ImapService(const QMailAccountId &accountId)
Expand Down Expand Up @@ -290,5 +289,5 @@ index 1855eba5..e1dcc6b0 100644
};

--
2.17.1
2.17.2

0 comments on commit 64a284d

Please sign in to comment.