diff options
Diffstat (limited to '')
-rw-r--r-- | src/GpgFrontendContext.h | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/GpgFrontendContext.h b/src/GpgFrontendContext.h index fc027dd1..34bd46f0 100644 --- a/src/GpgFrontendContext.h +++ b/src/GpgFrontendContext.h @@ -28,55 +28,53 @@ #pragma once +#include <qapplication.h> +#include <qcoreapplication.h> + #include "core/function/SecureMemoryAllocator.h" namespace GpgFrontend { +struct GpgFrontendContext; + +using GFCxtWPtr = std::weak_ptr<GpgFrontendContext>; +using GFCxtSPtr = std::shared_ptr<GpgFrontendContext>; + struct GpgFrontendContext { int argc; char** argv; spdlog::level::level_enum log_level; bool load_ui_env; - SecureUniquePtr<QCoreApplication> app; - bool gather_external_gnupg_info; bool load_default_gpg_context; - /** - * @brief Create a Instance object - * - * @param argc - * @param argv - * @return std::weak_ptr<GpgFrontendContext> - */ - static auto CreateInstance(int argc, char** argv) - -> std::weak_ptr<GpgFrontendContext>; + GpgFrontendContext(int argc, char** argv); + + ~GpgFrontendContext(); /** - * @brief Get the Instance object + * @brief * - * @return std::weak_ptr<GpgFrontendContext> */ - static auto GetInstance() -> std::weak_ptr<GpgFrontendContext>; + void InitApplication(bool); /** - * @brief + * @brief Get the App object * + * @return QCoreApplication* */ - void InitGUIApplication(); + auto GetApp() -> QCoreApplication*; /** - * @brief + * @brief Get the Gui App object * + * @return QApplication* */ - void InitCoreApplication(); + auto GetGuiApp() -> QApplication*; private: - static std::shared_ptr<GpgFrontendContext> global_context; + QCoreApplication* app_ = nullptr; }; -using GFCxtWPtr = std::weak_ptr<GpgFrontendContext>; -using GFCxtSPtr = std::shared_ptr<GpgFrontendContext>; - } // namespace GpgFrontend
\ No newline at end of file |