diff options
author | Alex Zolotarev <alex@maps.me> | 2015-01-25 02:09:41 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:36:48 +0300 |
commit | fa889fbae07fddcc26626f59b282f50d7e5a1070 (patch) | |
tree | 92e9e95dd5e5a9f608b6bea39987abde52e9fb7e /qt/main.cpp | |
parent | 4fcc18f24851b1ae1e2ced1b071925d5b3d9b653 (diff) |
[android][c++][ios] Integrated builds with Alohalytics statistics.
Diffstat (limited to 'qt/main.cpp')
-rw-r--r-- | qt/main.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/qt/main.cpp b/qt/main.cpp index 51ed6e6eda..000a5cfcc2 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -12,7 +12,10 @@ #include "../std/cstdio.hpp" +#include "../3party/Alohalytics/src/alohalytics.h" + #include <QtCore/QLocale> +#include <QtCore/QDir> #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include <QtGui/QApplication> @@ -64,10 +67,19 @@ int main(int argc, char * argv[]) QApplication a(argc, argv); - (void)GetPlatform(); + // Initialize platform-dependent code. + Platform & pl = GetPlatform(); + // Initialize statistics engine. + string const statisticsDir = pl.WritableDir() + "stats/"; + QDir().mkpath(statisticsDir.c_str()); +#ifdef DEBUG + alohalytics::Stats::Instance().SetDebugMode(true); +#endif + alohalytics::Stats::Instance().SetClientId("D:" + pl.UniqueClientId()) + .SetStoragePath(statisticsDir) + .SetServerUrl("http://stats.alohalytics.org/dev"); // checking default measurement system. - Settings::Units u; if (!Settings::Get("Units", u)) |