Warning, file /pim/kleopatra/src/conf/gnupgsystemconfigurationpage.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* -*- mode: c++; c-basic-offset:4 -*- 0002 conf/gnupgsystemconfigurationpage.cpp 0003 0004 This file is part of Kleopatra, the KDE keymanager 0005 SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #include "gnupgsystemconfigurationpage.h" 0011 #include <config-kleopatra.h> 0012 0013 #include <Libkleo/CryptoConfigModule> 0014 #include <QGpgME/CryptoConfig> 0015 #include <QGpgME/Protocol> 0016 0017 #include <QVBoxLayout> 0018 0019 using namespace Kleo::Config; 0020 0021 GnuPGSystemConfigurationPage::GnuPGSystemConfigurationPage(QObject *parent, const KPluginMetaData &data) 0022 : KCModule(parent, data) 0023 { 0024 auto lay = new QVBoxLayout(widget()); 0025 lay->setContentsMargins(0, 0, 0, 0); 0026 0027 QGpgME::CryptoConfig *const config = QGpgME::cryptoConfig(); 0028 0029 mWidget = new CryptoConfigModule(config, CryptoConfigModule::TabbedLayout, widget()); 0030 lay->addWidget(mWidget); 0031 0032 connect(mWidget, &CryptoConfigModule::changed, this, &Kleo::Config::GnuPGSystemConfigurationPage::markAsChanged); 0033 } 0034 0035 GnuPGSystemConfigurationPage::~GnuPGSystemConfigurationPage() 0036 { 0037 // ### correct here? 0038 if (QGpgME::CryptoConfig *const config = QGpgME::cryptoConfig()) { 0039 config->clear(); 0040 } 0041 } 0042 0043 void GnuPGSystemConfigurationPage::load() 0044 { 0045 mWidget->reset(); 0046 } 0047 0048 void GnuPGSystemConfigurationPage::save() 0049 { 0050 mWidget->save(); 0051 #if 0 0052 // Tell other apps (e.g. kmail) that the gpgconf data might have changed 0053 QDBusMessage message = 0054 QDBusMessage::createSignal(QString(), "org.kde.kleo.CryptoConfig", "changed"); 0055 QDBusConnection::sessionBus().send(message); 0056 #endif 0057 } 0058 0059 void GnuPGSystemConfigurationPage::defaults() 0060 { 0061 mWidget->defaults(); 0062 } 0063 0064 #include "moc_gnupgsystemconfigurationpage.cpp"