1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
From 9c5eb86128da46899e719209a92a65df012c6d8e Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Tue, 1 Jan 2019 19:19:19 +0100
Subject: [PATCH] Re-add accidentally removed test for QCA, KF5Wallet is
optional
---
CMakeLists.txt | 18 +++++++++++++++++-
src/libs/store/CMakeLists.txt | 15 +++++++--------
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eed9d3c..3cb4b63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,7 +128,6 @@ find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED
Parts
# Sonnet
TextWidgets
- Wallet
WidgetsAddons
WindowSystem
XmlGui
@@ -260,6 +259,23 @@ set_package_properties(KChart PROPERTIES
TYPE REQUIRED
)
+##
+## Test for QCA2
+##
+macro_optional_find_package(Qca-qt5 2.1.0 QUIET)
+set_package_properties(Qca-qt5 PROPERTIES
+ DESCRIPTION "Qt Cryptographic Architecture"
+ URL "https:/download.kde.org/stable/qca-qt5"
+ PURPOSE "Required for encrypted OpenDocument files and encrypted xls files support"
+ TYPE OPTIONAL
+)
+
+find_package(KF5Wallet ${REQUIRED_KF5_VERSION})
+
+if(Qca-qt5_FOUND AND KF5Wallet_FOUND)
+ add_definitions( -DQCA2 )
+endif()
+
find_package(Perl REQUIRED)
find_package(ZLIB REQUIRED)
diff --git a/src/libs/store/CMakeLists.txt b/src/libs/store/CMakeLists.txt
index 2c96fa7..f998264 100644
--- a/src/libs/store/CMakeLists.txt
+++ b/src/libs/store/CMakeLists.txt
@@ -4,14 +4,8 @@ endif()
########### libkostore ###############
-if( Qca-qt5_FOUND )
- add_definitions( -DQCA2 )
-endif()
-
set(kostore_LIB_SRCS
KoDirectoryStore.cpp
- KoEncryptedStore.cpp
- KoEncryptionChecker.cpp
KoLZF.cpp
KoStore.cpp
KoStoreDevice.cpp
@@ -23,6 +17,12 @@ set(kostore_LIB_SRCS
StoreDebug.cpp
KoNetAccess.cpp # temporary while porting
)
+if( Qca-qt5_FOUND )
+ set(kostore_LIB_SRCS ${kostore_LIB_SRCS}
+ KoEncryptedStore.cpp
+ KoEncryptionChecker.cpp
+ )
+endif()
add_library(planstore SHARED ${kostore_LIB_SRCS})
generate_export_header(planstore BASE_NAME kostore)
@@ -35,12 +35,11 @@ target_link_libraries(planstore
PRIVATE
Qt5::Gui
KF5::Archive
- KF5::Wallet
KF5::KIOWidgets
KF5::I18n
)
if( Qca-qt5_FOUND )
- target_link_libraries(planstore PRIVATE qca-qt5)
+ target_link_libraries(planstore PRIVATE qca-qt5 KF5::Wallet)
endif()
set_target_properties(planstore PROPERTIES
diff --git a/src/libs/widgets/KoDocumentInfoDlg.cpp b/src/libs/widgets/KoDocumentInfoDlg.cpp
index 1615a61..55e2c32 100644
--- a/src/libs/widgets/KoDocumentInfoDlg.cpp
+++ b/src/libs/widgets/KoDocumentInfoDlg.cpp
@@ -26,7 +26,9 @@
#include "KoDocumentInfo.h"
#include "KoDocumentBase.h"
#include "KoGlobal.h"
+#ifdef QCA2
#include <KoEncryptionChecker.h>
+#endif
#include "KoPageWidgetItem.h"
//#include <KoDocumentRdfBase.h>
#include <KoIcon.h>
@@ -105,12 +107,16 @@ KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo)
d->aboutUi = new Ui::KoDocumentInfoAboutWidget();
QWidget *infodlg = new QWidget();
d->aboutUi->setupUi(infodlg);
+#ifdef QCA2
if (!KoEncryptionChecker::isEncryptionSupported()) {
+#endif
d->aboutUi->lblEncryptedDesc->setVisible(false);
d->aboutUi->lblEncrypted->setVisible(false);
d->aboutUi->pbEncrypt->setVisible(false);
d->aboutUi->lblEncryptedPic->setVisible(false);
+#ifdef QCA2
}
+#endif
d->aboutUi->cbLanguage->addItems(KoGlobal::listOfLanguages());
d->aboutUi->cbLanguage->setCurrentIndex(-1);
--
2.20.1
|