Changeset View
Changeset View
Standalone View
Standalone View
generators/ooo/generator_ooo.cpp
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2006 by Tobias Koenig <tokoe@kde.org> * | 2 | * Copyright (C) 2006 by Tobias Koenig <tokoe@kde.org> * | ||
3 | * * | 3 | * * | ||
4 | * This program is free software; you can redistribute it and/or modify * | 4 | * This program is free software; you can redistribute it and/or modify * | ||
5 | * it under the terms of the GNU General Public License as published by * | 5 | * it under the terms of the GNU General Public License as published by * | ||
6 | * the Free Software Foundation; either version 2 of the License, or * | 6 | * the Free Software Foundation; either version 2 of the License, or * | ||
7 | * (at your option) any later version. * | 7 | * (at your option) any later version. * | ||
8 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
9 | 9 | | |||
10 | #include "generator_ooo.h" | 10 | #include "generator_ooo.h" | ||
11 | 11 | | |||
12 | #include "converter.h" | 12 | #include "converter.h" | ||
13 | 13 | | |||
14 | #include <KAboutData> | 14 | #include <KAboutData> | ||
15 | #include <KLocalizedString> | 15 | #include <KLocalizedString> | ||
16 | #include <kconfigdialog.h> | 16 | #include <kconfigdialog.h> | ||
17 | #ifdef HAVE_KWALLET | ||||
17 | #include <kwallet.h> | 18 | # include <kwallet.h> | ||
19 | #endif | ||||
18 | 20 | | |||
19 | OKULAR_EXPORT_PLUGIN(KOOOGenerator, "libokularGenerator_ooo.json") | 21 | OKULAR_EXPORT_PLUGIN(KOOOGenerator, "libokularGenerator_ooo.json") | ||
20 | 22 | | |||
21 | KOOOGenerator::KOOOGenerator( QObject *parent, const QVariantList &args ) | 23 | KOOOGenerator::KOOOGenerator( QObject *parent, const QVariantList &args ) | ||
22 | : Okular::TextDocumentGenerator( new OOO::Converter, QStringLiteral("okular_ooo_generator_settings"), parent, args ) | 24 | : Okular::TextDocumentGenerator( new OOO::Converter, QStringLiteral("okular_ooo_generator_settings"), parent, args ) | ||
23 | { | 25 | { | ||
24 | } | 26 | } | ||
25 | 27 | | |||
26 | void KOOOGenerator::addPages( KConfigDialog* dlg ) | 28 | void KOOOGenerator::addPages( KConfigDialog* dlg ) | ||
27 | { | 29 | { | ||
28 | Okular::TextDocumentSettingsWidget *widget = new Okular::TextDocumentSettingsWidget(); | 30 | Okular::TextDocumentSettingsWidget *widget = new Okular::TextDocumentSettingsWidget(); | ||
29 | 31 | | |||
30 | dlg->addPage( widget, generalSettings(), i18n("OpenDocument Text"), QStringLiteral("application-vnd.oasis.opendocument.text"), i18n("OpenDocument Text Backend Configuration") ); | 32 | dlg->addPage( widget, generalSettings(), i18n("OpenDocument Text"), QStringLiteral("application-vnd.oasis.opendocument.text"), i18n("OpenDocument Text Backend Configuration") ); | ||
31 | } | 33 | } | ||
32 | 34 | | |||
33 | void KOOOGenerator::walletDataForFile( const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey ) const | 35 | void KOOOGenerator::walletDataForFile( const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey ) const | ||
34 | { | 36 | { | ||
35 | *walletKey = fileName + QStringLiteral("/opendocument"); | 37 | *walletKey = fileName + QStringLiteral("/opendocument"); | ||
38 | #ifdef HAVE_KWALLET | ||||
36 | *walletName = KWallet::Wallet::LocalWallet(); | 39 | *walletName = KWallet::Wallet::LocalWallet(); | ||
37 | *walletFolder = KWallet::Wallet::PasswordFolder(); | 40 | *walletFolder = KWallet::Wallet::PasswordFolder(); | ||
41 | #endif | ||||
38 | } | 42 | } | ||
39 | #include "generator_ooo.moc" | 43 | #include "generator_ooo.moc" |