Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all
Unified · Split
| @@ -60,6 +60,7 @@ · 59 unmodified lines | ||
| 60 | 60 | #include <ParticlesScriptingInterface.h> |
| 61 | 61 | #include <PerfStat.h> |
| 62 | 62 | #include <ResourceCache.h> |
| 63 | +#include <UserActivityLogger.h> | |
| 63 | 64 | #include <UUID.h> |
| 64 | 65 | #include <OctreeSceneStats.h> |
| 65 | 66 | #include <LocalVoxelsList.h> |
| @@ -268,6 +269,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 202 unmodified lines | ||
| 268 | 269 | |
| 269 | 270 | // set the account manager's root URL and trigger a login request if we don't have the access token |
| 270 | 271 | accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL); |
| 272 | + UserActivityLogger::getInstance().launch(); | |
| 271 | 273 | |
| 272 | 274 | // once the event loop has started, check and signal for an access token |
| 273 | 275 | QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection); |
| @@ -396,7 +398,19 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 122 unmodified lines | ||
| 396 | 398 | } |
| 397 | 399 | |
| 398 | 400 | Application::~Application() { |
| 399 | − | |
| 401 | + int DELAI_TIME = 1000; | |
| 402 | + QEventLoop loop; | |
| 403 | + QTimer timer; | |
| 404 | + connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit); | |
| 405 | + JSONCallbackParameters params; | |
| 406 | + params.jsonCallbackReceiver = &loop; | |
| 407 | + params.errorCallbackReceiver = &loop; | |
| 408 | + params.jsonCallbackMethod = "quit"; | |
| 409 | + params.errorCallbackMethod = "quit"; | |
| 410 | + UserActivityLogger::getInstance().close(params); | |
| 411 | + timer.start(DELAI_TIME); | |
| 412 | + loop.exec(); | |
| 413 | + | |
| 400 | 414 | qInstallMessageHandler(NULL); |
| 401 | 415 | |
| 402 | 416 | // make sure we don't call the idle timer any more |
| @@ -3558,6 +3572,7 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 3155 unmodified lines | ||
| 3558 | 3572 | |
| 3559 | 3573 | _scriptEnginesHash.insertMulti(scriptURLString, scriptEngine); |
| 3560 | 3574 | _runningScriptsWidget->setRunningScripts(getRunningScripts()); |
| 3575 | + UserActivityLogger::getInstance().loadedScript(scriptURLString); | |
| 3561 | 3576 | } |
| 3562 | 3577 | |
| 3563 | 3578 | // setup the packet senders and jurisdiction listeners of the script engine's scripting interfaces so |