aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resource/lfs/locale/ts/GpgFrontend.zh_CN.ts10
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.cpp31
-rw-r--r--src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp8
-rw-r--r--src/ui/main_window/MainWindowUI.cpp2
4 files changed, 17 insertions, 34 deletions
diff --git a/resource/lfs/locale/ts/GpgFrontend.zh_CN.ts b/resource/lfs/locale/ts/GpgFrontend.zh_CN.ts
index e7c8ac1c..9653182c 100644
--- a/resource/lfs/locale/ts/GpgFrontend.zh_CN.ts
+++ b/resource/lfs/locale/ts/GpgFrontend.zh_CN.ts
@@ -1277,27 +1277,27 @@ This will result in loss of all cached form positions, statuses, key servers, et
<message>
<location filename="../../../../src/ui/dialog/help/GnupgTab.cpp" line="58"/>
<source>Component</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">组件</translation>
</message>
<message>
<location filename="../../../../src/ui/dialog/help/GnupgTab.cpp" line="58"/>
<source>Group</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">组</translation>
</message>
<message>
<location filename="../../../../src/ui/dialog/help/GnupgTab.cpp" line="58"/>
<source>Key</source>
- <translation type="unfinished">密钥</translation>
+ <translation type="unfinished">键</translation>
</message>
<message>
<location filename="../../../../src/ui/dialog/help/GnupgTab.cpp" line="59"/>
<source>Default Value</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">默认值</translation>
</message>
<message>
<location filename="../../../../src/ui/dialog/help/GnupgTab.cpp" line="60"/>
<source>Value</source>
- <translation type="unfinished">价值</translation>
+ <translation type="unfinished">值</translation>
</message>
</context>
<context>
diff --git a/src/core/function/gpg/GpgCommandExecutor.cpp b/src/core/function/gpg/GpgCommandExecutor.cpp
index b51db152..886c70db 100644
--- a/src/core/function/gpg/GpgCommandExecutor.cpp
+++ b/src/core/function/gpg/GpgCommandExecutor.cpp
@@ -185,13 +185,10 @@ void GpgCommandExecutor::ExecuteSync(ExecuteContext context) {
// to arvoid dead lock issue we need to check if current thread is the same as
// target thread. if it is, we can't call exec() because it will block the
// current thread.
- if (QThread::currentThread()->currentThreadId() !=
- target_task_runner->GetThread()->currentThreadId()) {
- GF_CORE_LOG_TRACE("blocking until gpg command finish...");
- // block until task finished
- // this is to keep reference vaild until task finished
- looper.exec();
- }
+ GF_CORE_LOG_TRACE("blocking until gpg command finish...");
+ // block until task finished
+ // this is to keep reference vaild until task finished
+ looper.exec();
}
void GpgCommandExecutor::ExecuteConcurrentlyAsync(ExecuteContexts contexts) {
@@ -217,8 +214,6 @@ void GpgCommandExecutor::ExecuteConcurrentlySync(ExecuteContexts contexts) {
auto remaining_tasks = contexts.size();
Thread::TaskRunnerPtr target_task_runner = nullptr;
- bool need_looper = false;
-
for (auto &context : contexts) {
const auto &cmd = context.cmd;
GF_CORE_LOG_DEBUG("gpg concurrently called cmd: {}", cmd);
@@ -243,22 +238,12 @@ void GpgCommandExecutor::ExecuteConcurrentlySync(ExecuteContexts contexts) {
}
target_task_runner->PostTask(task);
-
- // to arvoid dead lock issue we need to check if current thread is the same
- // as target thread. if it is, we can't call exec() because it will block
- // the current thread.
- if (QThread::currentThread()->currentThreadId() !=
- target_task_runner->GetThread()->currentThreadId()) {
- need_looper = true;
- }
}
- if (need_looper) {
- GF_CORE_LOG_TRACE("blocking until concurrent gpg commands finish...");
- // block until task finished
- // this is to keep reference vaild until task finished
- looper.exec();
- }
+ GF_CORE_LOG_TRACE("blocking until concurrent gpg commands finish...");
+ // block until task finished
+ // this is to keep reference vaild until task finished
+ looper.exec();
}
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp
index 8a0c9ca6..91bf93f5 100644
--- a/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp
+++ b/src/module/integrated/gnupg_info_gathering_module/GnuPGInfoGatheringModule.cpp
@@ -257,14 +257,12 @@ auto GnuPGInfoGatheringModule::Exec(EventRefrernce event) -> int {
},
getTaskRunner()});
- auto components = ListRTChildKeys(
- "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering",
- "gnupg.components");
+ auto components = ListRTChildKeys(GetModuleIdentifier(), "gnupg.components");
for (const auto &component : components) {
auto component_info_json = RetrieveRTValueTypedOrDefault(
- "com.bktus.gpgfrontend.module.integrated.gnupg-info-gathering",
- QString("gnupg.components.%1").arg(component), QByteArray{});
+ GetModuleIdentifier(), QString("gnupg.components.%1").arg(component),
+ QByteArray{});
auto jsonlized_component_info =
QJsonDocument::fromJson(component_info_json);
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp
index 110776cd..662c673f 100644
--- a/src/ui/main_window/MainWindowUI.cpp
+++ b/src/ui/main_window/MainWindowUI.cpp
@@ -415,7 +415,7 @@ void MainWindow::create_actions() {
[=]() { new AboutDialog(0, this); });
gnupg_act_ = new QAction(tr("GnuPG"), this);
- gnupg_act_->setIcon(QIcon(":/icons/:help.png"));
+ gnupg_act_->setIcon(QIcon(":/icons/help.png"));
gnupg_act_->setToolTip(tr("Information about Gnupg"));
connect(gnupg_act_, &QAction::triggered, this,
[=]() { new AboutDialog(1, this); });