aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowFileSlotFunction.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/main_window/MainWindowFileSlotFunction.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/main_window/MainWindowFileSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowFileSlotFunction.cpp44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp
index 598ba33c..6fe8062b 100644
--- a/src/ui/main_window/MainWindowFileSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp
@@ -167,14 +167,9 @@ void MainWindow::SlotFileEncrypt() {
GpgError error;
bool if_error = false;
- // Detect ascii mode
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- bool non_ascii_when_export = true;
- try {
- non_ascii_when_export = settings.lookup("general.non_ascii_when_export");
- } catch (...) {
- SPDLOG_ERROR("setting operation error: non_ascii_when_export");
- }
+ bool non_ascii_when_export =
+ GlobalSettingStation::GetInstance().LookupSettings(
+ "general.non_ascii_when_export", true);
// get file info
QFileInfo file_info(path);
@@ -390,14 +385,9 @@ void MainWindow::SlotFileSign() {
}
}
- // Detect ascii mode
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- bool non_ascii_when_export = true;
- try {
- non_ascii_when_export = settings.lookup("general.non_ascii_when_export");
- } catch (...) {
- SPDLOG_ERROR("setting operation error: non_ascii_when_export");
- }
+ bool non_ascii_when_export =
+ GlobalSettingStation::GetInstance().LookupSettings(
+ "general.non_ascii_when_export", true);
auto _channel = GPGFRONTEND_DEFAULT_CHANNEL;
auto _extension = ".asc";
@@ -469,14 +459,9 @@ void MainWindow::SlotFileVerify() {
std::filesystem::path sign_file_path = in_path, data_file_path;
- // Detect ascii mode
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- bool non_ascii_when_export = true;
- try {
- non_ascii_when_export = settings.lookup("general.non_ascii_when_export");
- } catch (...) {
- SPDLOG_ERROR("setting operation error: non_ascii_when_export");
- }
+ bool non_ascii_when_export =
+ GlobalSettingStation::GetInstance().LookupSettings(
+ "general.non_ascii_when_export", true);
auto _channel = GPGFRONTEND_DEFAULT_CHANNEL;
if (non_ascii_when_export) {
@@ -581,14 +566,9 @@ void MainWindow::SlotFileEncryptSign() {
}
}
- // detect ascii mode
- auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
- bool non_ascii_when_export = true;
- try {
- non_ascii_when_export = settings.lookup("general.non_ascii_when_export");
- } catch (...) {
- SPDLOG_ERROR("setting operation error: non_ascii_when_export");
- }
+ bool non_ascii_when_export =
+ GlobalSettingStation::GetInstance().LookupSettings(
+ "general.non_ascii_when_export", true);
// get file info
QFileInfo file_info(path);