mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 00:50:35 +02:00
Added application version to logger
This commit is contained in:
parent
f33ad8a100
commit
d102795314
3 changed files with 13 additions and 10 deletions
|
@ -269,7 +269,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
|
|
||||||
// set the account manager's root URL and trigger a login request if we don't have the access token
|
// set the account manager's root URL and trigger a login request if we don't have the access token
|
||||||
accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL);
|
accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||||
UserActivityLogger::getInstance().launch();
|
UserActivityLogger::getInstance().launch(applicationVersion());
|
||||||
|
|
||||||
// once the event loop has started, check and signal for an access token
|
// once the event loop has started, check and signal for an access token
|
||||||
QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
|
||||||
|
|
|
@ -66,26 +66,29 @@ void UserActivityLogger::requestError(QNetworkReply::NetworkError error,const QS
|
||||||
qDebug() << error << ": " << string;
|
qDebug() << error << ": " << string;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLogger::launch() {
|
void UserActivityLogger::launch(QString applicationVersion) {
|
||||||
const QString ACTION_NAME = "launch";
|
const QString ACTION_NAME = "launch";
|
||||||
QJsonObject actionDetails;
|
QJsonObject actionDetails;
|
||||||
|
|
||||||
QString OS_KEY = "OS";
|
QString APP_VERION = "application_version";
|
||||||
QString VERSION_KEY = "Version";
|
QString OS_KEY = "os";
|
||||||
|
QString VERSION_KEY = "version";
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
actionDetails.insert(OS_KEY, QJsonValue(QString("Mac")));
|
actionDetails.insert(OS_KEY, QJsonValue(QString("osx")));
|
||||||
actionDetails.insert(VERSION_KEY, QJsonValue(QSysInfo::macVersion()));
|
actionDetails.insert(VERSION_KEY, QJsonValue(QSysInfo::macVersion()));
|
||||||
#elif Q_OS_LINUX
|
#elif Q_OS_LINUX
|
||||||
actionDetails.insert(OS_KEY, QJsonValue(QString("Linux")));
|
actionDetails.insert(OS_KEY, QJsonValue(QString("linux")));
|
||||||
#elif Q_OS_WIN
|
#elif Q_OS_WIN
|
||||||
actionDetails.insert(OS_KEY, QJsonValue(QString("Windows")));
|
actionDetails.insert(OS_KEY, QJsonValue(QString("windows")));
|
||||||
actionDetails.insert(VERSION_KEY, QJsonValue(QSysInfo::windowsVersion()));
|
actionDetails.insert(VERSION_KEY, QJsonValue(QSysInfo::windowsVersion()));
|
||||||
#elif Q_OS_UNIX
|
#elif Q_OS_UNIX
|
||||||
actionDetails.insert(OS_KEY, QJsonValue(QString("Unknown UNIX")));
|
actionDetails.insert(OS_KEY, QJsonValue(QString("unknown unix")));
|
||||||
#else
|
#else
|
||||||
actionDetails.insert(OS_KEY, QJsonValue(QString("Unknown system")));
|
actionDetails.insert(OS_KEY, QJsonValue(QString("unknown system")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
actionDetails.insert(APP_VERION, applicationVersion);
|
||||||
|
|
||||||
logAction(ACTION_NAME, actionDetails);
|
logAction(ACTION_NAME, actionDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters());
|
void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters());
|
||||||
|
|
||||||
void launch();
|
void launch(QString applicationVersion);
|
||||||
void close(JSONCallbackParameters params = JSONCallbackParameters());
|
void close(JSONCallbackParameters params = JSONCallbackParameters());
|
||||||
void changedDisplayName(QString displayName);
|
void changedDisplayName(QString displayName);
|
||||||
void changedModel(QString typeOfModel, QString modelURL);
|
void changedModel(QString typeOfModel, QString modelURL);
|
||||||
|
|
Loading…
Reference in a new issue