aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/thread/KeyServerSearchTask.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2024-01-23 07:21:28 +0000
committerGitHub <[email protected]>2024-01-23 07:21:28 +0000
commit56acf161d439ce73eceaa145c40fe703bb2c3f02 (patch)
treea5d4790a6b2efc8786a3c0f74a07f5a8032d4e94 /src/ui/thread/KeyServerSearchTask.cpp
parentfix: use more secure cdn links (diff)
parentfix: solve issues on detected gnupg path function and fix linking errors on w... (diff)
downloadGpgFrontend-56acf161d439ce73eceaa145c40fe703bb2c3f02.tar.gz
GpgFrontend-56acf161d439ce73eceaa145c40fe703bb2c3f02.zip
Merge pull request #126 from saturneric/dev/2.1.1/main
Develop 2.1.2.1
Diffstat (limited to 'src/ui/thread/KeyServerSearchTask.cpp')
-rw-r--r--src/ui/thread/KeyServerSearchTask.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/ui/thread/KeyServerSearchTask.cpp b/src/ui/thread/KeyServerSearchTask.cpp
index 863a4ca3..2f05b774 100644
--- a/src/ui/thread/KeyServerSearchTask.cpp
+++ b/src/ui/thread/KeyServerSearchTask.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2021 Saturneric
+ * Copyright (C) 2021 Saturneric <[email protected]>
*
* This file is part of GpgFrontend.
*
@@ -19,34 +19,34 @@
* 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<[email protected]><[email protected]> starting on May 12, 2021.
+ * All the source code of GpgFrontend was modified and released by
+ * Saturneric <[email protected]> starting on May 12, 2021.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "ui/thread/KeyServerSearchTask.h"
-#include <utility>
-
-GpgFrontend::UI::KeyServerSearchTask::KeyServerSearchTask(
- std::string keyserver_url, std::string search_string)
+GpgFrontend::UI::KeyServerSearchTask::KeyServerSearchTask(QString keyserver_url,
+ QString search_string)
: Task("key_server_search_task"),
keyserver_url_(std::move(keyserver_url)),
search_string_(std::move(search_string)),
- manager_(new QNetworkAccessManager(this)) {}
-
-void GpgFrontend::UI::KeyServerSearchTask::run() {
- SetFinishAfterRun(false);
+ manager_(new QNetworkAccessManager(this)) {
+ HoldOnLifeCycle(true);
+}
- QUrl url_from_remote =
- QString::fromStdString(keyserver_url_) +
- "/pks/lookup?search=" + QString::fromStdString(search_string_) +
- "&op=index&options=mr";
+auto GpgFrontend::UI::KeyServerSearchTask::Run() -> int {
+ QUrl url_from_remote = keyserver_url_ +
+ "/pks/lookup?search=" + search_string_ +
+ "&op=index&options=mr";
reply_ = manager_->get(QNetworkRequest(url_from_remote));
-
connect(reply_, &QNetworkReply::finished, this,
&KeyServerSearchTask::dealing_reply_from_server);
+
+ return 0;
}
void GpgFrontend::UI::KeyServerSearchTask::dealing_reply_from_server() {
@@ -56,5 +56,5 @@ void GpgFrontend::UI::KeyServerSearchTask::dealing_reply_from_server() {
buffer = reply_->readAll();
}
emit SignalKeyServerSearchResult(network_reply, buffer);
- emit SignalTaskRunnableEnd(0);
+ emit SignalTaskShouldEnd(0);
}