File indexing completed on 2024-11-17 04:44:13
0001 /* 0002 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "externalcomposerplugineditorinterface.h" 0008 #include <KConfigGroup> 0009 #include <KPIMTextEdit/RichTextComposer> 0010 #include <KSharedConfig> 0011 0012 ExternalComposerPluginEditorInterface::ExternalComposerPluginEditorInterface(QObject *parent) 0013 : MessageComposer::PluginEditorInitInterface(parent) 0014 { 0015 } 0016 0017 ExternalComposerPluginEditorInterface::~ExternalComposerPluginEditorInterface() = default; 0018 0019 bool ExternalComposerPluginEditorInterface::exec() 0020 { 0021 if (mEnabled) { 0022 richTextEditor()->setUseExternalEditor(mEnabled); 0023 richTextEditor()->setExternalEditorPath(mExternalComposerPath); 0024 } 0025 return true; 0026 } 0027 0028 void ExternalComposerPluginEditorInterface::reloadConfig() 0029 { 0030 KSharedConfig::Ptr config = KSharedConfig::openConfig(); 0031 KConfigGroup group = config->group(QStringLiteral("External Composer")); 0032 mEnabled = group.readEntry("Enabled", false); 0033 mExternalComposerPath = group.readEntry("ComposerPath", QString()); 0034 } 0035 0036 #include "moc_externalcomposerplugineditorinterface.cpp"