29#ifndef GPGFRONTEND_GLOBALSETTINGSTATION_H
30#define GPGFRONTEND_GLOBALSETTINGSTATION_H
32#include <openssl/x509.h>
34#include <boost/filesystem/operations.hpp>
35#include <boost/filesystem/path.hpp>
37#include "GpgFrontendBuildInstallInfo.h"
38#include "core/GpgFrontendCore.h"
39#include "core/GpgFunctionObject.h"
68 libconfig::Setting &GetUISettings() noexcept {
return ui_cfg_.getRoot(); }
75 [[nodiscard]] std::filesystem::path
GetAppDir()
const {
return app_path_; }
77 [[nodiscard]] std::filesystem::path GetAppDataPath()
const {
78 return app_data_path_;
86 [[nodiscard]] std::filesystem::path
GetLogDir()
const {
96 auto db_path = app_configure_path_ /
"db";
97 if (!std::filesystem::exists(db_path)) {
98 std::filesystem::create_directory(db_path);
103 [[nodiscard]] std::filesystem::path GetAppConfigPath()
const {
104 return app_configure_path_;
113 return app_resource_path_ /
"gpg1.4" /
"gpg";
122 return app_locale_path_;
131 return app_resource_path_;
140 return app_resource_path_ /
"certs";
147 void SyncSettings() noexcept;
150 std::filesystem::path app_path_ =
151 qApp->applicationDirPath().toStdString();
152 std::filesystem::path app_data_path_ =
153 QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
155 std::filesystem::path app_log_path_ =
156 app_data_path_ / "logs";
157 std::filesystem::path app_data_objs_path_ =
158 app_data_path_ / "objs";
160#ifdef LINUX_INSTALL_BUILD
161 std::filesystem::path app_resource_path_ =
162 std::filesystem::path(APP_LOCALSTATE_PATH) /
165 std::filesystem::path app_resource_path_ =
166 RESOURCE_DIR_BOOST_PATH(app_path_);
169#ifdef LINUX_INSTALL_BUILD
170 std::filesystem::path app_locale_path_ =
171 std::string(APP_LOCALE_PATH);
173 std::filesystem::path app_locale_path_ =
174 app_resource_path_ /
"locales";
177 std::filesystem::path app_configure_path_ =
178 QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)
180 std::filesystem::path ui_config_dir_path_ =
181 app_configure_path_ /
183 std::filesystem::path ui_config_path_ =
184 ui_config_dir_path_ /
"ui.cfg";
192 void init_app_secure_key();
Definition: GlobalSettingStation.h:48
std::filesystem::path GetLocaleDir() const
Get the Locale Dir object.
Definition: GlobalSettingStation.h:121
libconfig::Config ui_cfg_
UI Configure File.
Definition: GlobalSettingStation.h:186
std::filesystem::path GetCertsDir() const
Get the Certs Dir object.
Definition: GlobalSettingStation.h:139
std::filesystem::path GetLogDir() const
Get the Log Dir object.
Definition: GlobalSettingStation.h:86
std::filesystem::path GetStandaloneGpgBinDir() const
Get the Standalone Gpg Bin Dir object.
Definition: GlobalSettingStation.h:112
std::filesystem::path GetAppDir() const
Get the App Dir object.
Definition: GlobalSettingStation.h:75
std::filesystem::path GetStandaloneDatabaseDir() const
Get the Standalone Database Dir object.
Definition: GlobalSettingStation.h:95
~GlobalSettingStation() noexcept override
Destroy the Global Setting Station object.
std::filesystem::path GetResourceDir() const
Get the Resource Dir object.
Definition: GlobalSettingStation.h:130
Definition: GpgFunctionObject.h:49
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:127
Definition: CoreCommonUtil.cpp:29