| 12 | #include "StatsAppUsage.h" |
| 13 | |
| 14 | static Q_LOGGING_CATEGORY(log, "Stats.App") |
| 15 | CStatsAppUsage::CStatsAppUsage(const QString& szVersion, |
| 16 | const QString& szUrl, QObject *parent) |
| 17 | : QObject{parent} |
| 18 | , m_szVersion(szVersion) |
| 19 | , m_szUrl(szUrl) |
| 20 | , m_szExt("txt") |
| 21 | , m_bRunOneDay(false) |
| 22 | { |
| 23 | qDebug(log) << Q_FUNC_INFO; |
| 24 | if(m_szUrl.isEmpty()) { |
| 25 | m_szUrl = "https://github.com/KangLin/" |
| 26 | + QCoreApplication::applicationName() + "/releases/download"; |
| 27 | } |
| 28 | bool check = connect(&m_Timer, &QTimer::timeout, |
| 29 | this, &CStatsAppUsage::slotTimeout); |
| 30 | Q_ASSERT(check); |
| 31 | check = connect(&m_ThreadPool, &CThreadPool::sigRunning, |
| 32 | this, &CStatsAppUsage::Start); |
| 33 | Q_ASSERT(check); |
| 34 | check = connect(&m_ThreadPool, &CThreadPool::sigFinished, |
| 35 | this, &CStatsAppUsage::sigFinished); |
| 36 | Q_ASSERT(check); |
| 37 | m_ThreadPool.Start(CreateWorkerFileTransfer); |
| 38 | } |
| 39 | |
| 40 | CStatsAppUsage::~CStatsAppUsage() |
| 41 | { |