aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/GpgFrontendUIInit.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2023-04-08 08:58:02 +0000
committerGitHub <[email protected]>2023-04-08 08:58:02 +0000
commit344096f325d686cf9810df6764fdb10ec8709d4a (patch)
treec629f58099a7e01084cb0fc09a165e1cf858ed9e /src/ui/GpgFrontendUIInit.cpp
parentMerge pull request #95 from saturneric/dev/2.1.0/main (diff)
parentfeat: update the online translation way (diff)
downloadGpgFrontend-344096f325d686cf9810df6764fdb10ec8709d4a.tar.gz
GpgFrontend-344096f325d686cf9810df6764fdb10ec8709d4a.zip
Merge pull request #96 from saturneric/dev/2.1.0/main
Develop 2.1.1.2
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r--src/ui/GpgFrontendUIInit.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index c6360ca7..bfe4d828 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -33,6 +33,8 @@
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
+#include <string>
+
#include "core/GpgConstants.h"
#include "core/function/GlobalSettingStation.h"
#include "core/thread/CtxCheckTask.h"
@@ -74,25 +76,26 @@ void InitGpgFrontendUI(QApplication* app) {
CommonUtils::GetInstance();
// application proxy configure
-
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- bool proxy_enable = false;
- try {
- proxy_enable = settings.lookup("proxy.enable");
- } catch (...) {
- SPDLOG_ERROR("setting operation error: proxy_enable");
- }
- SPDLOG_DEBUG("loading proxy configure, proxy_enable: {}", proxy_enable);
+ bool proxy_enable =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.enable", false);
// if enable proxy for application
if (proxy_enable) {
try {
- std::string proxy_type = settings.lookup("proxy.proxy_type");
- std::string proxy_host = settings.lookup("proxy.proxy_host");
- int proxy_port = settings.lookup("proxy.port");
- std::string proxy_username = settings.lookup("proxy.username");
- std::string proxy_password = settings.lookup("proxy.password");
-
+ std::string proxy_type =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.proxy_type",
+ std::string{});
+ std::string proxy_host =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.proxy_host",
+ std::string{});
+ int proxy_port =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.port", 0);
+ std::string proxy_username =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.username",
+ std::string{});
+ std::string proxy_password =
+ GlobalSettingStation::GetInstance().LookupSettings("proxy.password",
+ std::string{});
SPDLOG_DEBUG("proxy settings: type {}, host {}, port: {}", proxy_type,
proxy_host, proxy_port);