aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/thread/Task.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-10-28 18:46:15 +0000
committersaturneric <[email protected]>2023-10-28 18:46:15 +0000
commitfd46d4667611c0db9cea3f06205727399b6fb5fd (patch)
tree8755059620d00d1690673d963cd0d913df92ae1c /src/core/thread/Task.cpp
parentfeat: introduce clang-tidy config and modify clang-format config (diff)
downloadGpgFrontend-fd46d4667611c0db9cea3f06205727399b6fb5fd.tar.gz
GpgFrontend-fd46d4667611c0db9cea3f06205727399b6fb5fd.zip
refactor: start to tidy up code using clang-tidy
Diffstat (limited to 'src/core/thread/Task.cpp')
-rw-r--r--src/core/thread/Task.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/thread/Task.cpp b/src/core/thread/Task.cpp
index 0e0f63ac..d7f1dab9 100644
--- a/src/core/thread/Task.cpp
+++ b/src/core/thread/Task.cpp
@@ -28,16 +28,11 @@
#include "core/thread/Task.h"
-#include <qobjectdefs.h>
-#include <qtmetamacros.h>
-
#include <boost/stacktrace.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
-#include <memory>
-
-#include "spdlog/spdlog.h"
+#include <utility>
namespace GpgFrontend::Thread {
@@ -56,11 +51,11 @@ class Task::Impl : public QObject {
: QObject(parent),
parent_(parent),
uuid_(generate_uuid()),
- name_(name),
- runnable_(runnable),
+ name_(std::move(name)),
+ runnable_(std::move(runnable)),
callback_([](int, const DataObjectPtr &) {}),
callback_thread_(QThread::currentThread()),
- data_object_(data_object) {
+ data_object_(std::move(data_object)) {
SPDLOG_TRACE("task {} created with runnable, callback_thread_: {}",
GetFullID(), static_cast<void *>(callback_thread_));
init();
@@ -71,11 +66,11 @@ class Task::Impl : public QObject {
: QObject(parent),
parent_(parent),
uuid_(generate_uuid()),
- name_(name),
- runnable_(runnable),
- callback_(callback),
+ name_(std::move(name)),
+ runnable_(std::move(runnable)),
+ callback_(std::move(callback)),
callback_thread_(QThread::currentThread()),
- data_object_(data_object) {
+ data_object_(std::move(data_object)) {
SPDLOG_TRACE(
"task {} created with runnable and callback, callback_thread_: {}",
GetFullID(), static_cast<void *>(callback_thread_));