From c1a5fff98cab4adf04210ba8120459b8e87a8fa3 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 15 Oct 2023 16:17:28 +0800 Subject: fix: solve some issues on linux .desktop file --- src/ui/thread/ProxyConnectionTestTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index c7d623d7..d32bf2be 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -34,7 +34,7 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url, network_manager_(new QNetworkAccessManager(this)) {} void GpgFrontend::UI::ProxyConnectionTestTask::run() { - SetFinishAfterRun(false); + HoldOnLifeCycle(true); auto* network_reply = network_manager_->get(QNetworkRequest{url_}); auto* timer = new QTimer(this); -- cgit v1.2.3 From 7c21fdd97132e63572a6aca6fa0492d2ce74e777 Mon Sep 17 00:00:00 2001 From: saturneric Date: Mon, 16 Oct 2023 03:47:52 +0800 Subject: feat: start to add plugin system and do some improve on project configuration --- src/ui/thread/ProxyConnectionTestTask.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index d32bf2be..d48d0c36 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -26,6 +26,8 @@ #include "ProxyConnectionTestTask.h" +#include + GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url, int timeout) : Task("proxy_connection_test_task"), -- cgit v1.2.3 From 95997d27106daf91336847f50efaaa32279b7fc7 Mon Sep 17 00:00:00 2001 From: saturneric Date: Mon, 16 Oct 2023 17:54:05 +0800 Subject: fix: check and update copyright at files --- src/ui/thread/ProxyConnectionTestTask.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index d48d0c36..01313cf7 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2021 Saturneric + * Copyright (C) 2021 Saturneric * * This file is part of GpgFrontend. * @@ -19,8 +19,10 @@ * The initial version of the source code is inherited from * the gpg4usb project, which is under GPL-3.0-or-later. * - * The source code version of this software was modified and released - * by Saturneric starting on May 12, 2021. + * All the source code of GpgFrontend was modified and released by + * Saturneric starting on May 12, 2021. + * + * SPDX-License-Identifier: GPL-3.0-or-later * */ -- cgit v1.2.3 From 70196cf01757824a578e4d9c49a210bf136de266 Mon Sep 17 00:00:00 2001 From: saturneric Date: Wed, 18 Oct 2023 22:45:33 +0800 Subject: feat: using pool for concurrent executions, not stable yet --- src/ui/thread/ProxyConnectionTestTask.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index 01313cf7..9a723727 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -35,11 +35,11 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url, : Task("proxy_connection_test_task"), url_(std::move(url)), timeout_(timeout), - network_manager_(new QNetworkAccessManager(this)) {} - -void GpgFrontend::UI::ProxyConnectionTestTask::run() { + network_manager_(new QNetworkAccessManager(this)) { HoldOnLifeCycle(true); +} +void GpgFrontend::UI::ProxyConnectionTestTask::run() { auto* network_reply = network_manager_->get(QNetworkRequest{url_}); auto* timer = new QTimer(this); @@ -74,5 +74,5 @@ void GpgFrontend::UI::ProxyConnectionTestTask::slot_process_network_reply( } emit SignalProxyConnectionTestResult(result_); - emit SignalTaskRunnableEnd(0); + emit SignalTaskShouldEnd(0); } -- cgit v1.2.3 From 644aa4397b03dbef73f8bfedc13925b51cad836b Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 5 Jan 2024 20:55:15 +0800 Subject: feat: integrate logging api to core --- src/ui/thread/ProxyConnectionTestTask.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index 9a723727..b952d0b9 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -45,13 +45,13 @@ void GpgFrontend::UI::ProxyConnectionTestTask::run() { connect(network_reply, &QNetworkReply::finished, this, [this, network_reply]() { - SPDLOG_DEBUG("key server domain reply: {} received", - url_.toStdString()); + GF_UI_LOG_DEBUG("key server domain reply: {} received", + url_.toStdString()); this->slot_process_network_reply(network_reply); }); connect(timer, &QTimer::timeout, this, [this, network_reply]() { - SPDLOG_DEBUG("timeout for key server: {}", url_.toStdString()); + GF_UI_LOG_DEBUG("timeout for key server: {}", url_.toStdString()); if (network_reply->isRunning()) { network_reply->abort(); this->slot_process_network_reply(network_reply); @@ -64,8 +64,8 @@ void GpgFrontend::UI::ProxyConnectionTestTask::run() { void GpgFrontend::UI::ProxyConnectionTestTask::slot_process_network_reply( QNetworkReply* reply) { auto buffer = reply->readAll(); - SPDLOG_DEBUG("key server domain reply: {}, buffer size: {}", - url_.toStdString(), buffer.size()); + GF_UI_LOG_DEBUG("key server domain reply: {}, buffer size: {}", + url_.toStdString(), buffer.size()); if (reply->error() == QNetworkReply::NoError && !buffer.isEmpty()) { result_ = "Reachable"; -- cgit v1.2.3 From 0266ff1bbce2feccec34ab789f9e378948d1b24d Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 11 Jan 2024 11:05:45 +0800 Subject: feat: improve api and ui of keys import and export --- src/ui/thread/ProxyConnectionTestTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index b952d0b9..5929c9d1 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -39,7 +39,7 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url, HoldOnLifeCycle(true); } -void GpgFrontend::UI::ProxyConnectionTestTask::run() { +void GpgFrontend::UI::ProxyConnectionTestTask::Run() { auto* network_reply = network_manager_->get(QNetworkRequest{url_}); auto* timer = new QTimer(this); -- cgit v1.2.3 From 4994f4eaa1211d402b791660ad6221154a4c2405 Mon Sep 17 00:00:00 2001 From: saturneric Date: Tue, 16 Jan 2024 11:49:50 +0800 Subject: fix: make task and threading system safer --- src/ui/thread/ProxyConnectionTestTask.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp') diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp index 5929c9d1..6b0993fe 100644 --- a/src/ui/thread/ProxyConnectionTestTask.cpp +++ b/src/ui/thread/ProxyConnectionTestTask.cpp @@ -39,7 +39,7 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url, HoldOnLifeCycle(true); } -void GpgFrontend::UI::ProxyConnectionTestTask::Run() { +auto GpgFrontend::UI::ProxyConnectionTestTask::Run() -> int { auto* network_reply = network_manager_->get(QNetworkRequest{url_}); auto* timer = new QTimer(this); @@ -59,6 +59,7 @@ void GpgFrontend::UI::ProxyConnectionTestTask::Run() { }); timer->start(timeout_); + return 0; } void GpgFrontend::UI::ProxyConnectionTestTask::slot_process_network_reply( -- cgit v1.2.3