29 #ifndef GPGFRONTEND_GLOBALSETTINGSTATION_H
30 #define GPGFRONTEND_GLOBALSETTINGSTATION_H
32 #include "GpgFrontendBuildInstallInfo.h"
33 #include "core/GpgFrontendCore.h"
34 #include "core/GpgFunctionObject.h"
63 libconfig::Setting &GetUISettings() noexcept {
return ui_cfg_.getRoot(); }
70 [[nodiscard]] std::filesystem::path
GetAppDir()
const {
return app_path_; }
72 [[nodiscard]] std::filesystem::path GetAppDataPath()
const {
73 return app_data_path_;
81 [[nodiscard]] std::filesystem::path
GetLogDir()
const {
91 auto db_path = app_configure_path_ /
"db";
92 if (!std::filesystem::exists(db_path)) {
93 std::filesystem::create_directory(db_path);
98 [[nodiscard]] std::filesystem::path GetAppConfigPath()
const {
99 return app_configure_path_;
108 return app_resource_path_ /
"gpg1.4" /
"gpg";
117 return app_locale_path_;
126 return app_resource_path_;
135 return app_resource_path_ /
"certs";
142 void SyncSettings() noexcept;
145 std::filesystem::path app_path_ = QCoreApplication::applicationDirPath()
147 std::filesystem::path app_data_path_ =
148 QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
150 std::filesystem::path app_log_path_ =
151 app_data_path_ / "logs";
152 std::filesystem::path app_data_objs_path_ =
153 app_data_path_ / "objs";
155 #ifdef LINUX_INSTALL_BUILD
156 std::filesystem::path app_resource_path_ =
157 std::filesystem::path(APP_LOCALSTATE_PATH) /
160 std::filesystem::path app_resource_path_ =
161 RESOURCE_DIR_BOOST_PATH(app_path_);
164 #ifdef LINUX_INSTALL_BUILD
165 std::filesystem::path app_locale_path_ =
166 std::string(APP_LOCALE_PATH);
168 std::filesystem::path app_locale_path_ =
169 app_resource_path_ /
"locales";
172 std::filesystem::path app_configure_path_ =
173 QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)
175 std::filesystem::path ui_config_dir_path_ =
176 app_configure_path_ /
"conf";
177 std::filesystem::path ui_config_path_ =
178 ui_config_dir_path_ /
"main.cfg";
186 void init_app_secure_key();
Definition: GlobalSettingStation.h:43
std::filesystem::path GetLocaleDir() const
Get the Locale Dir object.
Definition: GlobalSettingStation.h:116
libconfig::Config ui_cfg_
UI Configure File.
Definition: GlobalSettingStation.h:180
std::filesystem::path GetCertsDir() const
Get the Certs Dir object.
Definition: GlobalSettingStation.h:134
std::filesystem::path GetLogDir() const
Get the Log Dir object.
Definition: GlobalSettingStation.h:81
std::filesystem::path GetStandaloneGpgBinDir() const
Get the Standalone Gpg Bin Dir object.
Definition: GlobalSettingStation.h:107
std::filesystem::path GetAppDir() const
Get the App Dir object.
Definition: GlobalSettingStation.h:70
std::filesystem::path GetStandaloneDatabaseDir() const
Get the Standalone Database Dir object.
Definition: GlobalSettingStation.h:90
~GlobalSettingStation() noexcept override
Destroy the Global Setting Station object.
std::filesystem::path GetResourceDir() const
Get the Resource Dir object.
Definition: GlobalSettingStation.h:125
Definition: GpgFunctionObject.h:150
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:251
Definition: CoreCommonUtil.cpp:31