Commit cbddcd32 authored by Albert Astals Cid's avatar Albert Astals Cid

kwallet and kjs are mandatory in cmake anyway, remove ifdefs

parent a05df764
Pipeline #33187 passed with stage
in 10 minutes and 18 seconds
...@@ -112,13 +112,6 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS ...@@ -112,13 +112,6 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Wallet 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) if(NOT WIN32 AND NOT ANDROID)
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Activities Activities
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include <QMimeDatabase> #include <QMimeDatabase>
#include <QTimer> #include <QTimer>
#ifdef WITH_KWALLET
#include <KWallet> #include <KWallet>
#endif
#include "document.h" #include "document.h"
#include "document_p.h" #include "document_p.h"
...@@ -398,11 +396,9 @@ bool Generator::exportTo(const QString &, const ExportFormat &) ...@@ -398,11 +396,9 @@ bool Generator::exportTo(const QString &, const ExportFormat &)
void Generator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const void Generator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const
{ {
#ifdef WITH_KWALLET
*walletKey = fileName.section(QLatin1Char('/'), -1, -1); *walletKey = fileName.section(QLatin1Char('/'), -1, -1);
*walletName = KWallet::Wallet::NetworkWallet(); *walletName = KWallet::Wallet::NetworkWallet();
*walletFolder = QStringLiteral("KPdf"); *walletFolder = QStringLiteral("KPdf");
#endif
} }
bool Generator::hasFeature(GeneratorFeature feature) const bool Generator::hasFeature(GeneratorFeature feature) const
......
...@@ -22,17 +22,13 @@ class Okular::ScripterPrivate ...@@ -22,17 +22,13 @@ class Okular::ScripterPrivate
public: public:
ScripterPrivate(DocumentPrivate *doc) ScripterPrivate(DocumentPrivate *doc)
: m_doc(doc) : m_doc(doc)
#ifdef WITH_KJS
, m_kjs(nullptr) , m_kjs(nullptr)
#endif
, m_event(nullptr) , m_event(nullptr)
{ {
} }
DocumentPrivate *m_doc; DocumentPrivate *m_doc;
#ifdef WITH_KJS
QScopedPointer<ExecutorKJS> m_kjs; QScopedPointer<ExecutorKJS> m_kjs;
#endif
Event *m_event; Event *m_event;
}; };
...@@ -49,7 +45,6 @@ Scripter::~Scripter() ...@@ -49,7 +45,6 @@ Scripter::~Scripter()
void Scripter::execute(ScriptType type, const QString &script) void Scripter::execute(ScriptType type, const QString &script)
{ {
qCDebug(OkularCoreDebug) << "executing the script:"; qCDebug(OkularCoreDebug) << "executing the script:";
#ifdef WITH_KJS
#if 0 #if 0
if ( script.length() < 1000 ) if ( script.length() < 1000 )
qDebug() << script; qDebug() << script;
...@@ -74,7 +69,6 @@ void Scripter::execute(ScriptType type, const QString &script) ...@@ -74,7 +69,6 @@ void Scripter::execute(ScriptType type, const QString &script)
} }
d->m_kjs->execute(builtInScript + script, d->m_event); d->m_kjs->execute(builtInScript + script, d->m_event);
} }
#endif
} }
void Scripter::setEvent(Event *event) void Scripter::setEvent(Event *event)
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
#include <KAboutData> #include <KAboutData>
#include <KConfigDialog> #include <KConfigDialog>
#include <KLocalizedString> #include <KLocalizedString>
#ifdef WITH_KWALLET
#include <kwallet.h> #include <kwallet.h>
#endif
OKULAR_EXPORT_PLUGIN(KOOOGenerator, "libokularGenerator_ooo.json") OKULAR_EXPORT_PLUGIN(KOOOGenerator, "libokularGenerator_ooo.json")
...@@ -35,9 +33,7 @@ void KOOOGenerator::addPages(KConfigDialog *dlg) ...@@ -35,9 +33,7 @@ void KOOOGenerator::addPages(KConfigDialog *dlg)
void KOOOGenerator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const void KOOOGenerator::walletDataForFile(const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const
{ {
*walletKey = fileName + QStringLiteral("/opendocument"); *walletKey = fileName + QStringLiteral("/opendocument");
#ifdef WITH_KWALLET
*walletName = KWallet::Wallet::LocalWallet(); *walletName = KWallet::Wallet::LocalWallet();
*walletFolder = KWallet::Wallet::PasswordFolder(); *walletFolder = KWallet::Wallet::PasswordFolder();
#endif
} }
#include "generator_ooo.moc" #include "generator_ooo.moc"
...@@ -67,13 +67,11 @@ ...@@ -67,13 +67,11 @@
#include <KStandardShortcut> #include <KStandardShortcut>
#include <KToggleAction> #include <KToggleAction>
#include <KToggleFullScreenAction> #include <KToggleFullScreenAction>
#include <Kdelibs4ConfigMigrator>
#include <Kdelibs4Migration>
#ifdef WITH_KWALLET
#include <KWallet> #include <KWallet>
#endif
#include <KXMLGUIClient> #include <KXMLGUIClient>
#include <KXMLGUIFactory> #include <KXMLGUIFactory>
#include <Kdelibs4ConfigMigrator>
#include <Kdelibs4Migration>
#if PURPOSE_FOUND #if PURPOSE_FOUND
#include <Purpose/AlternativesModel> #include <Purpose/AlternativesModel>
...@@ -1374,7 +1372,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil ...@@ -1374,7 +1372,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil
} }
m_documentOpenWithPassword = false; m_documentOpenWithPassword = false;
#ifdef WITH_KWALLET
// if the file didn't open correctly it might be encrypted, so ask for a pass // if the file didn't open correctly it might be encrypted, so ask for a pass
QString walletName, walletFolder, walletKey; QString walletName, walletFolder, walletKey;
m_document->walletDataForFile(fileNameToOpen, &walletName, &walletFolder, &walletKey); m_document->walletDataForFile(fileNameToOpen, &walletName, &walletFolder, &walletKey);
...@@ -1440,7 +1437,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil ...@@ -1440,7 +1437,6 @@ Document::OpenResult Part::doOpenFile(const QMimeType &mimeA, const QString &fil
} }
} }
} }
#endif
} }
if (openResult == Document::OpenSuccess) { if (openResult == Document::OpenSuccess) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment