Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -398,22 +398,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 397 unmodified lines | |||
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | Application::~Application() { | 400 | Application::~Application() { |
| 401 | // In order to get the end of the session, we nned to give the account manager enough time to send the packet. | ||
| 402 | QEventLoop loop; | ||
| 403 | // Here we connect the callbacks to stop the event loop | ||
| 404 | JSONCallbackParameters params; | ||
| 405 | params.jsonCallbackReceiver = &loop; | ||
| 406 | params.errorCallbackReceiver = &loop; | ||
| 407 | params.jsonCallbackMethod = "quit"; | ||
| 408 | params.errorCallbackMethod = "quit"; | ||
| 409 | // In case something goes wrong, we also setup a timer so that the delai is not greater than DELAY_TIME | ||
| 410 | int DELAY_TIME = 1000; | 401 | int DELAY_TIME = 1000; |
| 411 | QTimer timer; | 402 | UserActivityLogger::getInstance().close(DELAY_TIME); |
| 412 | connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit); | ||
| 413 | // Now we can log it | ||
| 414 | UserActivityLogger::getInstance().close(params); | ||
| 415 | timer.start(DELAY_TIME); | ||
| 416 | loop.exec(); | ||
| 417 | 403 | ||
| 418 | qInstallMessageHandler(NULL); | 404 | qInstallMessageHandler(NULL); |
| 419 | 405 | ||