summaryrefslogtreecommitdiff
path: root/src/plugins/languageclient/progressmanager.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2021-06-03 11:21:28 +0200
committerDavid Schulz <david.schulz@qt.io>2021-06-04 09:33:24 +0000
commitf4ed1d20ec259281cab4e009cd454ff6a274a3e8 (patch)
treec370bb8a35364c5c1ad17cacb873ff84da95efee /src/plugins/languageclient/progressmanager.cpp
parentaa8d2dc2d1ec7575fe9a8fc1170e97cd7f7c951d (diff)
downloadqt-creator-f4ed1d20ec259281cab4e009cd454ff6a274a3e8.tar.gz
LanguageClient: Use double for progress reports
Some servers *cough* clangd *cough* report their progress in double instead of the uint defined by the protocol. Since this does not make a huge difference for the LanguageClient or json switch to double for progress. Change-Id: I76454285e5a3b582d6c6a23a6dfbeb5f1cd7631f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/languageclient/progressmanager.cpp')
-rw-r--r--src/plugins/languageclient/progressmanager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/languageclient/progressmanager.cpp b/src/plugins/languageclient/progressmanager.cpp
index a854337833..d25da8a3e0 100644
--- a/src/plugins/languageclient/progressmanager.cpp
+++ b/src/plugins/languageclient/progressmanager.cpp
@@ -107,9 +107,8 @@ void ProgressManager::reportProgress(const ProgressToken &token,
}
}
if (progress.futureInterface) {
- const Utils::optional<int> &progressValue = report.percentage();
- if (progressValue.has_value())
- progress.futureInterface->setProgressValue(*progressValue);
+ if (const Utils::optional<double> &percentage = report.percentage(); percentage.has_value())
+ progress.futureInterface->setProgressValue(*percentage);
}
}