File indexing completed on 2024-05-19 05:29:58
0001 /* 0002 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0003 SPDX-FileCopyrightText: 2021-2022 Harald Sitter <sitter@kde.org> 0004 */ 0005 0006 #include <KPluginFactory> 0007 #include <KQuickConfigModule> 0008 #include <QStandardPaths> 0009 0010 #include "CommandOutputContext.h" 0011 0012 class KCMFirmwareSecurity : public KQuickConfigModule 0013 { 0014 Q_OBJECT 0015 Q_PROPERTY(CommandOutputContext *infoOutputContext READ outputContext CONSTANT FINAL) 0016 public: 0017 explicit KCMFirmwareSecurity(QObject *parent, const KPluginMetaData &data) 0018 : KQuickConfigModule(parent, data) 0019 { 0020 const QString executable = QStandardPaths::locate(QStandardPaths::GenericDataLocation, 0021 QStringLiteral("kinfocenter/firmware_security/fwupdmgr.sh"), 0022 QStandardPaths::LocateFile); 0023 m_outputContext = new CommandOutputContext({QStringLiteral("fwupdmgr"), QStringLiteral("aha")}, QStringLiteral("/bin/sh"), {executable}, parent); 0024 } 0025 CommandOutputContext *outputContext() const 0026 { 0027 return m_outputContext; 0028 } 0029 0030 private: 0031 CommandOutputContext *m_outputContext; 0032 }; 0033 0034 K_PLUGIN_CLASS_WITH_JSON(KCMFirmwareSecurity, "kcm_firmware_security.json") 0035 0036 #include "main.moc"