From cbddcd3273e9dd727ff186c8f9d3d109d9d774bf Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 5 Sep 2020 19:20:59 +0200 Subject: [PATCH] kwallet and kjs are mandatory in cmake anyway, remove ifdefs --- CMakeLists.txt | 7 ------- core/generator.cpp | 4 ---- core/scripter.cpp | 6 ------ generators/ooo/generator_ooo.cpp | 4 ---- part.cpp | 8 ++------ 5 files changed, 2 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 232038aae..878f34831 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,13 +112,6 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Wallet ) -if(KF5Wallet_FOUND) - add_definitions(-DWITH_KWALLET=1) -endif() -if(KF5JS_FOUND) - add_definitions(-DWITH_KJS=1) -endif() - if(NOT WIN32 AND NOT ANDROID) find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Activities diff --git a/core/generator.cpp b/core/generator.cpp index 67cefe062..c88b4b225 100644 --- a/core/generator.cpp +++ b/core/generator.cpp @@ -25,9 +25,7 @@ #include #include -#ifdef WITH_KWALLET #include -#endif #include "document.h" #include "document_p.h" @@ -398,11 +396,9 @@ bool Generator::exportTo(const QString &, const ExportFormat &) void Generator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const { -#ifdef WITH_KWALLET *walletKey = fileName.section(QLatin1Char('/'), -1, -1); *walletName = KWallet::Wallet::NetworkWallet(); *walletFolder = QStringLiteral("KPdf"); -#endif } bool Generator::hasFeature(GeneratorFeature feature) const diff --git a/core/scripter.cpp b/core/scripter.cpp index 16c679449..cd1789666 100644 --- a/core/scripter.cpp +++ b/core/scripter.cpp @@ -22,17 +22,13 @@ class Okular::ScripterPrivate public: ScripterPrivate(DocumentPrivate *doc) : m_doc(doc) -#ifdef WITH_KJS , m_kjs(nullptr) -#endif , m_event(nullptr) { } DocumentPrivate *m_doc; -#ifdef WITH_KJS QScopedPointer m_kjs; -#endif Event *m_event; }; @@ -49,7 +45,6 @@ Scripter::~Scripter() void Scripter::execute(ScriptType type, const QString &script) { qCDebug(OkularCoreDebug) << "executing the script:"; -#ifdef WITH_KJS #if 0 if ( script.length() < 1000 ) qDebug() << script; @@ -74,7 +69,6 @@ void Scripter::execute(ScriptType type, const QString &script) } d->m_kjs->execute(builtInScript + script, d->m_event); } -#endif } void Scripter::setEvent(Event *event) diff --git a/generators/ooo/generator_ooo.cpp b/generators/ooo/generator_ooo.cpp index c065a8567..f15d62b0a 100644 --- a/generators/ooo/generator_ooo.cpp +++ b/generators/ooo/generator_ooo.cpp @@ -14,9 +14,7 @@ #include #include #include -#ifdef WITH_KWALLET #include -#endif OKULAR_EXPORT_PLUGIN(KOOOGenerator, "libokularGenerator_ooo.json") @@ -35,9 +33,7 @@ void KOOOGenerator::addPages(KConfigDialog *dlg) void KOOOGenerator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const { *walletKey = fileName + QStringLiteral("/opendocument"); -#ifdef WITH_KWALLET *walletName = KWallet::Wallet::LocalWallet(); *walletFolder = KWallet::Wallet::PasswordFolder(); -#endif } #include "generator_ooo.moc" diff --git a/part.cpp b/part.cpp index fb8dd5ea3..c07e74ed7 100644 --- a/part.cpp +++ b/part.cpp @@ -67,13 +67,11 @@ #include #include #include -#include -#include -#ifdef WITH_KWALLET #include -#endif #include #include +#include +#include #if PURPOSE_FOUND #include @@ -1374,7 +1372,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil } m_documentOpenWithPassword = false; -#ifdef WITH_KWALLET // if the file didn't open correctly it might be encrypted, so ask for a pass QString walletName, walletFolder, walletKey; m_document->walletDataForFile(fileNameToOpen, &walletName, &walletFolder, &walletKey); @@ -1440,7 +1437,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil } } } -#endif } if (openResult == Document::OpenSuccess) { -- GitLab