diff options
Diffstat (limited to 'src/module')
4 files changed, 18 insertions, 160 deletions
diff --git a/src/module/GpgFrontendModuleInit.cpp b/src/module/GpgFrontendModuleInit.cpp index b2d29c71..6f88b9ec 100644 --- a/src/module/GpgFrontendModuleInit.cpp +++ b/src/module/GpgFrontendModuleInit.cpp @@ -40,11 +40,11 @@ namespace GpgFrontend::Module { -void LoadGpgFrontendModules(ModuleInitArgs args) { +void LoadGpgFrontendModules(ModuleInitArgs) { // must init at default thread before core Thread::TaskRunnerGetter::GetInstance().GetTaskRunner()->PostTask( new Thread::Task( - [args](const DataObjectPtr&) -> int { + [](const DataObjectPtr&) -> int { MODULE_LOG_INFO("loading integrated module..."); // VersionCheckingModule diff --git a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp index 84dd49cb..c257a977 100644 --- a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp +++ b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp @@ -81,20 +81,20 @@ GnuPGInfoGatheringModule::GnuPGInfoGatheringModule() GnuPGInfoGatheringModule::~GnuPGInfoGatheringModule() = default; -bool GnuPGInfoGatheringModule::Register() { - MODULE_LOG_INFO("gnupg info gathering module registering"); +auto GnuPGInfoGatheringModule::Register() -> bool { + MODULE_LOG_DEBUG("gnupg info gathering module registering"); listenEvent("GPGFRONTEND_CORE_INITLIZED"); return true; } -bool GnuPGInfoGatheringModule::Active() { - MODULE_LOG_INFO("gnupg info gathering module activating"); +auto GnuPGInfoGatheringModule::Active() -> bool { + MODULE_LOG_DEBUG("gnupg info gathering module activating"); return true; } -int GnuPGInfoGatheringModule::Exec(EventRefrernce event) { - MODULE_LOG_INFO("gnupg info gathering module executing, event id: {}", - event->GetIdentifier()); +auto GnuPGInfoGatheringModule::Exec(EventRefrernce event) -> int { + MODULE_LOG_DEBUG("gnupg info gathering module executing, event id: {}", + event->GetIdentifier()); const auto gpgme_version = RetrieveRTValueTypedOrDefault<>( "core", "gpgme.version", std::string{"0.0.0"}); @@ -145,8 +145,8 @@ int GnuPGInfoGatheringModule::Exec(EventRefrernce event) { component_infos.push_back(c_i_gpgme); component_infos.push_back(c_i_gpgconf); - nlohmann::json jsonlized_gpgme_component_info = c_i_gpgme; - nlohmann::json jsonlized_gpgconf_component_info = c_i_gpgconf; + nlohmann::json const jsonlized_gpgme_component_info = c_i_gpgme; + nlohmann::json const jsonlized_gpgconf_component_info = c_i_gpgconf; UpsertRTValue( GetModuleIdentifier(), "gnupg.components.gpgme", static_cast<std::string>(jsonlized_gpgme_component_info.dump())); @@ -212,7 +212,7 @@ int GnuPGInfoGatheringModule::Exec(EventRefrernce event) { c_i.binary_checksum = binary_checksum.has_value() ? binary_checksum.value() : "/"; - nlohmann::json jsonlized_component_info = c_i; + nlohmann::json const jsonlized_component_info = c_i; UpsertRTValue( GetModuleIdentifier(), (boost::format("gnupg.components.%1%") % component_name).str(), @@ -375,7 +375,7 @@ int GnuPGInfoGatheringModule::Exec(EventRefrernce event) { info.argdef = option_argdef; info.value = option_value; - nlohmann::json jsonlized_option_info = info; + nlohmann::json const jsonlized_option_info = info; UpsertRTValue( GetModuleIdentifier(), (boost::format("gnupg.components.%1%.options.%2%") % diff --git a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.h b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.h index 5c6d4636..5c228298 100644 --- a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.h +++ b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.h @@ -41,14 +41,14 @@ class GPGFRONTEND_MODULE_SDK_EXPORT GnuPGInfoGatheringModule : public Module { public: GnuPGInfoGatheringModule(); - ~GnuPGInfoGatheringModule(); + ~GnuPGInfoGatheringModule() override; - virtual bool Register() override; + auto Register() -> bool override; - virtual bool Active() override; + auto Active() -> bool override; - virtual int Exec(EventRefrernce) override; + auto Exec(EventRefrernce) -> int override; - virtual bool Deactive() override; + auto Deactive() -> bool override; }; } // namespace GpgFrontend::Module::Integrated::GnuPGInfoGatheringModule diff --git a/src/module/integrated/version_checking_module/GpgTOFUInfo.h b/src/module/integrated/version_checking_module/GpgTOFUInfo.h deleted file mode 100644 index 9deec33f..00000000 --- a/src/module/integrated/version_checking_module/GpgTOFUInfo.h +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Copyright (C) 2021 Saturneric <[email protected]> - * - * This file is part of GpgFrontend. - * - * GpgFrontend is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GpgFrontend is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>. - * - * The initial version of the source code is inherited from - * the gpg4usb project, which is under GPL-3.0-or-later. - * - * All the source code of GpgFrontend was modified and released by - * Saturneric <[email protected]> starting on May 12, 2021. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ - -#pragma once - -namespace GpgFrontend { -/** - * @brief - * - */ -class GPGFRONTEND_CORE_EXPORT GpgTOFUInfo { - public: - /** - * @brief - * - * @return unsigned - */ - [[nodiscard]] unsigned GetValidity() const; - /** - * @brief - * - * @return unsigned - */ - [[nodiscard]] unsigned GetPolicy() const; - - /** - * @brief - * - * @return unsigned long - */ - [[nodiscard]] unsigned long GetSignCount() const; - - /** - * @brief - * - * @return unsigned long - */ - [[nodiscard]] unsigned long GetEncrCount() const; - - /** - * @brief - * - * @return unsigned long - */ - [[nodiscard]] unsigned long GetSignFirst() const; - - /** - * @brief - * - * @return unsigned long - */ - [[nodiscard]] unsigned long GetSignLast() const; - - /** - * @brief - * - * @return unsigned long - */ - [[nodiscard]] unsigned long GetEncrLast() const; - - /** - * @brief - * - * @return std::string - */ - [[nodiscard]] std::string GetDescription() const; - - /** - * @brief Construct a new Gpg T O F U Info object - * - */ - GpgTOFUInfo(); - - /** - * @brief Construct a new Gpg T O F U Info object - * - * @param tofu_info - */ - explicit GpgTOFUInfo(gpgme_tofu_info_t tofu_info); - - /** - * @brief Construct a new Gpg T O F U Info object - * - * @param o - */ - GpgTOFUInfo(GpgTOFUInfo&& o) noexcept; - - /** - * @brief Construct a new Gpg T O F U Info object - * - */ - GpgTOFUInfo(const GpgTOFUInfo&) = delete; - - /** - * @brief - * - * @param o - * @return GpgTOFUInfo& - */ - GpgTOFUInfo& operator=(GpgTOFUInfo&& o) noexcept; - - /** - * @brief - * - * @return GpgTOFUInfo& - */ - GpgTOFUInfo& operator=(const GpgTOFUInfo&) = delete; - - private: - using SubkeyRefHandler = - std::unique_ptr<struct _gpgme_tofu_info, - std::function<void(gpgme_tofu_info_t)>>; ///< - - SubkeyRefHandler _tofu_info_ref = nullptr; ///< -}; - -} // namespace GpgFrontend |