17 #include <type_traits>
19 #include "../util/btassert.h"
25 #include <installmgr.h>
50 return normalizeCompletionPercentage<int>((done / total) * 100);
53 template <
typename T,
class =
void>
58 std::void_t<decltype(std::declval<T &>().setTimeoutMillis(0))>>
64 using namespace sword;
71 , m_firstCallOfPreStatus(true)
74 if constexpr (HasSetTimeoutMillis<BtInstallMgr>::value)
102 const int totalPercent = calculateIntPercentage<double>(dlnow +
m_completedBytes,
void percentCompleted(const int total, const int file)
BtInstallMgr(QObject *parent=nullptr)
bool m_firstCallOfPreStatus
void statusUpdate(double dltotal, double dlnow) override
bool isUserDisclaimerConfirmed() const override
void preStatus(long totalBytes, long completedBytes, const char *message) override
int calculateIntPercentage(T done, T total)
T normalizeCompletionPercentage(const T value)