| 12 | const QLatin1String GAnalyticsWorker::dateTimeFormat("yyyy,MM,dd-hh:mm::ss:zzz"); |
| 13 | |
| 14 | GAnalyticsWorker::GAnalyticsWorker(GAnalytics *parent) |
| 15 | : QObject(parent), q(parent), m_logLevel(GAnalytics::Error) |
| 16 | { |
| 17 | m_appName = QCoreApplication::instance()->applicationName(); |
| 18 | m_appVersion = QCoreApplication::instance()->applicationVersion(); |
| 19 | m_request.setUrl(QUrl("https://www.google-analytics.com/collect")); |
| 20 | m_request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); |
| 21 | m_request.setHeader(QNetworkRequest::UserAgentHeader, getUserAgent()); |
| 22 | |
| 23 | m_language = QLocale::system().name().toLower().replace("_", "-"); |
| 24 | m_screenResolution = getScreenResolution(); |
| 25 | |
| 26 | m_timer.setInterval(m_timerInterval); |
| 27 | connect(&m_timer, &QTimer::timeout, this, &GAnalyticsWorker::postMessage); |
| 28 | } |
| 29 | |
| 30 | void GAnalyticsWorker::enable(bool state) |
| 31 | { |
nothing calls this directly
no test coverage detected