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
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
......
......@@ -25,9 +25,7 @@
#include <QMimeDatabase>
#include <QTimer>
#ifdef WITH_KWALLET
#include <KWallet>
#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
......
......@@ -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<ExecutorKJS> 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)
......
......@@ -14,9 +14,7 @@
#include <KAboutData>
#include <KConfigDialog>
#include <KLocalizedString>
#ifdef WITH_KWALLET
#include <kwallet.h>
#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"
......@@ -67,13 +67,11 @@
#include <KStandardShortcut>
#include <KToggleAction>
#include <KToggleFullScreenAction>
#include <Kdelibs4ConfigMigrator>
#include <Kdelibs4Migration>
#ifdef WITH_KWALLET
#include <KWallet>
#endif
#include <KXMLGUIClient>
#include <KXMLGUIFactory>
#include <Kdelibs4ConfigMigrator>
#include <Kdelibs4Migration>
#if PURPOSE_FOUND
#include <Purpose/AlternativesModel>
......@@ -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) {
......
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