Skip to content

Commit 65dd674

Browse files
committed
App: enable app usage stats
1 parent bade77d commit 65dd674

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,7 @@ jobs:
315315
- name: Upload To Github Release
316316
if: ${{ startsWith(github.ref, 'refs/tags/') }}
317317
run: |
318-
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/update.json ${{github.workspace}}/Release.md ${{github.workspace}}/CheckSum.md
319-
320-
#${{github.workspace}}/App/Client/Resource/Stats/*
318+
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/update.json ${{github.workspace}}/Release.md ${{github.workspace}}/CheckSum.md ${{github.workspace}}/App/Client/Resource/Stats/*
321319
322320
- name: Upload test tag To Github Release
323321
if: ${{ startsWith(github.ref, 'refs/heads/master') }}

App/Client/main.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,8 @@ int main(int argc, char *argv[])
184184
#endif // #ifdef HAVE_UPDATE
185185

186186
CStatsAppUsage* pStats = nullptr;
187-
/*
188-
int randomInt = 0;
189-
int nMin = 10;
190-
int nMax = 50;
191-
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
192-
randomInt = QRandomGenerator::global()->bounded(nMin, nMax);
193-
#else
194-
qsrand(static_cast<uint>(QTime::currentTime().msec())); // 使用当前时间的毫秒数来设置种子
195-
randomInt = nMin + qrand() % (nMax - nMin + 1); // 生成一个0到99之间的随机数
196-
#endif
197-
QTimer::singleShot(randomInt, [&](){
187+
//*
188+
QTimer::singleShot(RabbitCommon::CTools::GetRandomNumber(10, 50), [&](){
198189
pStats = new CStatsAppUsage("v" + QApplication::applicationVersion());
199190
app.processEvents();
200191
});//*/

Src/StatsAppUsage.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#include "plugin_export.h"
88
#include "ThreadPool.h"
99

10+
/*!
11+
* \brief 应用使用统计信息
12+
*
13+
* 当前使用下载相应资源文件来统计应用的使用信息。
14+
* 相关的资源位于: App/Client/Resource/Stats/
15+
* 在 CI 中安装资源 .github/workflows/build.yml 中安装。
16+
*
17+
*/
1018
class PLUGIN_EXPORT CStatsAppUsage : public QObject
1119
{
1220
Q_OBJECT

0 commit comments

Comments
 (0)