From 7e6c16b287b609a91cbb663aa8575c5ede0aff5a Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 19 Nov 2020 18:14:42 +0100 Subject: [PATCH] Change progress and max progress to qint64 in taskmanager --- src/core/taskmanager.cpp | 8 ++++---- src/core/taskmanager.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/taskmanager.cpp b/src/core/taskmanager.cpp index 6ae9b128f..54983beb5 100644 --- a/src/core/taskmanager.cpp +++ b/src/core/taskmanager.cpp @@ -61,7 +61,7 @@ QList TaskManager::GetTasks() { } -void TaskManager::SetTaskBlocksCollectionScans(int id) { +void TaskManager::SetTaskBlocksCollectionScans(const int id) { { QMutexLocker l(&mutex_); @@ -76,7 +76,7 @@ void TaskManager::SetTaskBlocksCollectionScans(int id) { } -void TaskManager::SetTaskProgress(int id, int progress, int max) { +void TaskManager::SetTaskProgress(const int id, const qint64 progress, const qint64 max) { { QMutexLocker l(&mutex_); @@ -90,7 +90,7 @@ void TaskManager::SetTaskProgress(int id, int progress, int max) { emit TasksChanged(); } -void TaskManager::IncreaseTaskProgress(int id, int progress, int max) { +void TaskManager::IncreaseTaskProgress(const int id, const qint64 progress, const qint64 max) { { QMutexLocker l(&mutex_); @@ -105,7 +105,7 @@ void TaskManager::IncreaseTaskProgress(int id, int progress, int max) { } -void TaskManager::SetTaskFinished(int id) { +void TaskManager::SetTaskFinished(const int id) { bool resume_collection_watchers = false; diff --git a/src/core/taskmanager.h b/src/core/taskmanager.h index 444b44676..55be352ec 100644 --- a/src/core/taskmanager.h +++ b/src/core/taskmanager.h @@ -37,10 +37,11 @@ class TaskManager : public QObject { explicit TaskManager(QObject *parent = nullptr); struct Task { + Task() : id(0), progress(0), progress_max(0), blocks_collection_scans(false) {} int id; QString name; - int progress; - int progress_max; + qint64 progress; + qint64 progress_max; bool blocks_collection_scans; }; @@ -61,13 +62,13 @@ class TaskManager : public QObject { QList GetTasks(); int StartTask(const QString &name); - void SetTaskBlocksCollectionScans(int id); - void SetTaskProgress(int id, int progress, int max = 0); - void IncreaseTaskProgress(int id, int progress, int max = 0); - void SetTaskFinished(int id); - int GetTaskProgress(int id); + void SetTaskBlocksCollectionScans(const int id); + void SetTaskProgress(const int id, const qint64 progress, const qint64 max = 0); + void IncreaseTaskProgress(const int id, const qint64 progress, const qint64 max = 0); + void SetTaskFinished(const int id); + int GetTaskProgress(const int id); -signals: + signals: void TasksChanged(); void PauseCollectionWatchers();