kdepim-runtime

This commit is contained in:
Rmys
2023-09-21 14:29:45 +03:00
parent 9b96ced32a
commit 4bf7f90959
6 changed files with 1492 additions and 86 deletions
@@ -0,0 +1,60 @@
From 2fd3604ad6a9594b9dd8b0f1529f4f4589fe831f Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Tue, 19 Sep 2023 17:04:36 +0200
Subject: [PATCH] Revert "Revert "Fix race condition when building""
This reverts commit d3f20b3dab530065f9cff9d73e4ca1076af55a29.
(cherry picked from commit f9f262b9289f7b1c34e55205fa0c5cde915bc652)
---
resources/google-groupware/CMakeLists.txt | 7 ++++---
resources/google-groupware/googleresource.cpp | 1 -
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/resources/google-groupware/CMakeLists.txt b/resources/google-groupware/CMakeLists.txt
index 2f2b46aded..0ac6f2db8e 100644
--- a/resources/google-groupware/CMakeLists.txt
+++ b/resources/google-groupware/CMakeLists.txt
@@ -67,9 +67,6 @@ set(googleresource_SRCS
${googleresource_common_SRCS}
)
-ki18n_wrap_ui(googleresource_SRCS googlesettingswidget.ui)
-
-
add_executable(akonadi_google_resource ${googleresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_google_resource PROPERTIES UNITY_BUILD ON)
@@ -126,6 +123,7 @@ install(
kcoreaddons_add_plugin(googleconfig
INSTALL_NAMESPACE "pim${QT_MAJOR_VERSION}/akonadi/config"
)
+
target_sources(googleconfig
PRIVATE
googleconfig.cpp
@@ -133,6 +131,9 @@ PRIVATE
googlesettingswidget.h
${googleresource_common_SRCS}
)
+
+ki18n_wrap_ui(googleconfig googlesettingswidget.ui)
+
target_link_libraries(googleconfig
KPim${KF_MAJOR_VERSION}::AkonadiCore
KPim${KF_MAJOR_VERSION}::AkonadiCalendar
diff --git a/resources/google-groupware/googleresource.cpp b/resources/google-groupware/googleresource.cpp
index 47a7e0c8d5..d51c1e4a7c 100644
--- a/resources/google-groupware/googleresource.cpp
+++ b/resources/google-groupware/googleresource.cpp
@@ -11,7 +11,6 @@
#include "googleresourcestate.h"
#include "googlescopes.h"
#include "googlesettings.h"
-#include "googlesettingswidget.h"
#include "settingsadaptor.h"
#include "personhandler.h"
--
GitLab
@@ -0,0 +1,120 @@
From c99afc75a503fff6ca83df2f47a5d5d951579524 Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Tue, 19 Sep 2023 18:58:54 +0200
Subject: [PATCH] Actually start job to read secret key
BUG: 470820
(cherry picked from commit 8393e92d56ecb31b2dd65d15d046f8e02565f5e3)
---
resources/google-groupware/googleconfig.cpp | 8 +++++++-
resources/google-groupware/googlesettings.cpp | 15 +++++++++------
.../google-groupware/googlesettingswidget.cpp | 3 +--
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/resources/google-groupware/googleconfig.cpp b/resources/google-groupware/googleconfig.cpp
index 2eb6ab2efa..1af177c81f 100644
--- a/resources/google-groupware/googleconfig.cpp
+++ b/resources/google-groupware/googleconfig.cpp
@@ -6,6 +6,7 @@
#include <Akonadi/AgentConfigurationBase>
+#include "googleresource_debug.h"
#include "googlesettings.h"
#include "googlesettingswidget.h"
@@ -25,7 +26,12 @@ public:
void load() override
{
Akonadi::AgentConfigurationBase::load();
- mWidget.loadSettings();
+ mSettings.init();
+ connect(&mSettings, &GoogleSettings::accountReady, this, [this](bool ready) {
+ if (ready) {
+ mWidget.loadSettings();
+ }
+ });
}
Q_REQUIRED_RESULT bool save() const override
diff --git a/resources/google-groupware/googlesettings.cpp b/resources/google-groupware/googlesettings.cpp
index aa94cad1ab..23a9979895 100644
--- a/resources/google-groupware/googlesettings.cpp
+++ b/resources/google-groupware/googlesettings.cpp
@@ -32,7 +32,6 @@ static const QString googleWalletFolder = QStringLiteral("Akonadi Google");
GoogleSettings::GoogleSettings(const KSharedConfigPtr &config, Options options)
: SettingsBase(config)
{
- qDebug() << config;
if (options & Option::ExportToDBus) {
new SettingsAdaptor(this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
@@ -44,9 +43,11 @@ GoogleSettings::GoogleSettings(const KSharedConfigPtr &config, Options options)
void GoogleSettings::init()
{
// First read from QtKeyChain
- auto job = new QKeychain::ReadPasswordJob(googleWalletFolder);
+ auto job = new QKeychain::ReadPasswordJob(googleWalletFolder, this);
+ job->setKey(account());
connect(job, &QKeychain::Job::finished, this, [this, job]() {
if (job->error() != QKeychain::Error::NoError) {
+ qCWarning(GOOGLE_LOG) << "Unable to read password" << job->error();
Q_EMIT accountReady(false);
return;
}
@@ -54,18 +55,19 @@ void GoogleSettings::init()
// Found something with QtKeyChain
if (!account().isEmpty()) {
m_account = fetchAccountFromKeychain(account(), job);
+ m_isReady = true;
+ Q_EMIT accountReady(true);
}
- m_isReady = true;
- Q_EMIT accountReady(true);
});
+ job->start();
}
KGAPI2::AccountPtr GoogleSettings::fetchAccountFromKeychain(const QString &accountName, QKeychain::ReadPasswordJob *job)
{
QMap<QString, QString> map;
auto value = job->binaryData();
- if (!value.isEmpty()) {
- qCDebug(GOOGLE_LOG) << "Account" << accountName << "not found in KWallet";
+ if (value.isEmpty()) {
+ qCWarning(GOOGLE_LOG) << "Account" << accountName << "not found in KWallet";
return {};
}
@@ -116,6 +118,7 @@ WritePasswordJob *GoogleSettings::storeAccount(AccountPtr account)
connect(writeJob, &WritePasswordJob::finished, this, [this, writeJob]() {
if (writeJob->error()) {
+ qCWarning(GOOGLE_LOG) << "Unable to write password" << writeJob->error();
return;
}
SettingsBase::setAccount(m_account->accountName());
diff --git a/resources/google-groupware/googlesettingswidget.cpp b/resources/google-groupware/googlesettingswidget.cpp
index 2543c4c6b8..8e84cfbabd 100644
--- a/resources/google-groupware/googlesettingswidget.cpp
+++ b/resources/google-groupware/googlesettingswidget.cpp
@@ -36,7 +36,6 @@ GoogleSettingsWidget::GoogleSettingsWidget(GoogleSettings &settings, const QStri
, m_settings(settings)
, m_identifier(identifier)
{
- qDebug() << m_settings.account();
auto mainLayout = new QVBoxLayout(this);
auto mainWidget = new QWidget(this);
@@ -83,7 +82,7 @@ bool GoogleSettingsWidget::handleError(KGAPI2::Job *job)
}
if (job->error() == KGAPI2::Unauthorized) {
- qCDebug(GOOGLE_LOG) << job << job->errorString();
+ qWarning() << job << job->errorString();
const QList<QUrl> resourceScopes = googleScopes();
for (const QUrl &scope : resourceScopes) {
if (!m_account->scopes().contains(scope)) {
--
GitLab
File diff suppressed because it is too large Load Diff
@@ -1,23 +0,0 @@
diff --git a/resources/shared/singlefileresource/singlefileresource.h b/resources/shared/singlefileresource/singlefileresource.h
index f3c19aa..3f41499 100644
--- a/resources/shared/singlefileresource/singlefileresource.h
+++ b/resources/shared/singlefileresource/singlefileresource.h
@@ -55,7 +55,7 @@ public:
, mSettings(new Settings(config()))
{
// The resource needs network when the path refers to a non local file.
- setNeedsNetwork(!QUrl(mSettings->path()).isLocalFile());
+ setNeedsNetwork(!QUrl::fromUserInput(mSettings->path()).isLocalFile());
}
~SingleFileResource()
{
@@ -82,7 +82,7 @@ public:
return;
}
- mCurrentUrl = QUrl(mSettings->path()); // path already has scheme
+ mCurrentUrl = QUrl::fromUserInput(mSettings->path()); // the string contains the scheme if remote, doesn't if local path
if (mCurrentHash.isEmpty())
{
// First call to readFile() lets see if there is a hash stored in a
--
@@ -1,62 +0,0 @@
diff -Nuar a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2017-12-14 14:08:44.000000000 +0300
+++ b/CMakeLists.txt 2017-12-17 22:28:41.525681257 +0300
@@ -62,7 +62,7 @@
include(ECMCoverageOption)
-set(QT_REQUIRED_VERSION "5.8.0")
+set(QT_REQUIRED_VERSION "5.7.1")
set(KDEPIMRUNTIME_LIB_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}")
set(KDEPIMRUNTIME_LIB_SOVERSION "5")
diff -Nuar a/resources/tomboynotes/tomboyitemuploadjob.cpp b/resources/tomboynotes/tomboyitemuploadjob.cpp
--- a/resources/tomboynotes/tomboyitemuploadjob.cpp 2017-12-13 15:11:13.000000000 +0300
+++ b/resources/tomboynotes/tomboyitemuploadjob.cpp 2017-12-17 22:30:50.749671933 +0300
@@ -65,7 +65,9 @@
case JobType::AddItem:
jsonNote[QLatin1String("create-date")] = getCurrentISOTime();
// Missing break is intended
+#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
+#endif
case JobType::ModifyItem:
jsonNote[QLatin1String("title")] = mNoteContent->headerByType("subject")->asUnicodeString();
jsonNote[QLatin1String("note-content")] = mNoteContent->mainBodyPart()->decodedText();
diff -Nuar a/resources/imap/searchtask.cpp b/resources/imap/searchtask.cpp
--- a/resources/imap/searchtask.cpp 2017-12-13 15:11:13.000000000 +0300
+++ b/resources/imap/searchtask.cpp 2017-12-17 22:48:51.475593953 +0300
@@ -104,12 +104,16 @@
switch (term.condition()) {
case Akonadi::SearchTerm::CondGreaterOrEqual:
value--;
+#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
+#endif
case Akonadi::SearchTerm::CondGreaterThan:
return KIMAP::Term(KIMAP::Term::Larger, value).setNegated(term.isNegated());
case Akonadi::SearchTerm::CondLessOrEqual:
value++;
+#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
+#endif
case Akonadi::SearchTerm::CondLessThan:
return KIMAP::Term(KIMAP::Term::Smaller, value).setNegated(term.isNegated());
case Akonadi::SearchTerm::CondEqual:
@@ -128,12 +132,16 @@
switch (term.condition()) {
case Akonadi::SearchTerm::CondGreaterOrEqual:
value = value.addDays(-1);
+#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
+#endif
case Akonadi::SearchTerm::CondGreaterThan:
return KIMAP::Term(KIMAP::Term::SentSince, value).setNegated(term.isNegated());
case Akonadi::SearchTerm::CondLessOrEqual:
value = value.addDays(1);
+#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
+#endif
case Akonadi::SearchTerm::CondLessThan:
return KIMAP::Term(KIMAP::Term::SentBefore, value).setNegated(term.isNegated());
case Akonadi::SearchTerm::CondEqual:
@@ -63,7 +63,9 @@
<Dependency>qt5-keychain-devel</Dependency>
</BuildDependencies>
<Patches>
<!--Patch>qt5.patch</Patch-->
<Patch level="1">2fd3604a.patch</Patch>
<Patch level="1">c99afc75.patch</Patch>
<Patch level="1">fb0d78fb.patch</Patch>
</Patches>
</Source>
@@ -140,6 +142,13 @@
</Package>
<History>
<Update release="54">
<Date>2023-09-21</Date>
<Version>23.08.1</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="53">
<Date>2023-09-14</Date>
<Version>23.08.1</Version>