diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,6 @@ Parts # Sonnet TextWidgets - Wallet WidgetsAddons WindowSystem XmlGui @@ -260,6 +259,23 @@ 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 --- a/src/libs/store/CMakeLists.txt +++ b/src/libs/store/CMakeLists.txt @@ -4,14 +4,8 @@ ########### 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 @@ 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 @@ 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 --- 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 +#endif #include "KoPageWidgetItem.h" //#include #include @@ -105,12 +107,16 @@ 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);