diff --git a/linphone-desktop/src/components/core/CoreHandlers.cpp b/linphone-desktop/src/components/core/CoreHandlers.cpp index ec909c3fe..73cc15fe5 100644 --- a/linphone-desktop/src/components/core/CoreHandlers.cpp +++ b/linphone-desktop/src/components/core/CoreHandlers.cpp @@ -34,7 +34,7 @@ #include "config.h" #define VERSION_UPDATE_CHECK_OBJECT_NAME "version-update-check-timer" -#define VERSION_UPDATE_CHECK_INTERVAL 86400000 /* 24 hours in milliseconds */ +#define VERSION_UPDATE_CHECK_INTERVAL 86400000 /* 24 hours in milliseconds. */ using namespace std; @@ -89,16 +89,16 @@ void CoreHandlers::notifyCoreStarted () { qInfo() << QStringLiteral("Core started."); emit coreStarted(); -#ifdef ENABLE_UPDATE_CHECK - QTimer *timer = new QTimer(this); - timer->setInterval(VERSION_UPDATE_CHECK_INTERVAL); - timer->setObjectName(VERSION_UPDATE_CHECK_OBJECT_NAME); - QObject::connect(timer, &QTimer::timeout, this, &App::checkForUpdate); - timer->start(); - App::checkForUpdate(); -#endif - } - ); + #ifdef ENABLE_UPDATE_CHECK + QTimer *timer = new QTimer(this); + timer->setInterval(VERSION_UPDATE_CHECK_INTERVAL); + + QObject::connect(timer, &QTimer::timeout, this, &App::checkForUpdate); + timer->start(); + + App::checkForUpdate(); + #endif // ifdef ENABLE_UPDATE_CHECK + }); } // ----------------------------------------------------------------------------- @@ -238,7 +238,6 @@ void CoreHandlers::onVersionUpdateCheckResultReceived ( const string &version, const string &url ) { - if (result == linphone::VersionUpdateCheckResultNewVersionAvailable) { + if (result == linphone::VersionUpdateCheckResultNewVersionAvailable) App::getInstance()->getNotifier()->notifyNewVersionAvailable(version, url); - } -} \ No newline at end of file +} diff --git a/linphone-desktop/src/components/core/CoreHandlers.hpp b/linphone-desktop/src/components/core/CoreHandlers.hpp index bb31c6399..63262e415 100644 --- a/linphone-desktop/src/components/core/CoreHandlers.hpp +++ b/linphone-desktop/src/components/core/CoreHandlers.hpp @@ -118,7 +118,7 @@ private: void onVersionUpdateCheckResultReceived ( const std::shared_ptr &, linphone::VersionUpdateCheckResult result, - const std::string &version, + const std::string &version, const std::string &url ) override; diff --git a/linphone-desktop/src/components/notifier/Notifier.cpp b/linphone-desktop/src/components/notifier/Notifier.cpp index a298ea4df..e43486b33 100644 --- a/linphone-desktop/src/components/notifier/Notifier.cpp +++ b/linphone-desktop/src/components/notifier/Notifier.cpp @@ -184,11 +184,9 @@ void Notifier::showNotification (QObject *notification, int timeout) { notification->setProperty(NOTIFICATION_PROPERTY_TIMER, QVariant::fromValue(timer)); // Destroy it after timeout. - QObject::connect( - timer, &QTimer::timeout, this, [this, notification]() { + QObject::connect(timer, &QTimer::timeout, this, [this, notification]() { deleteNotification(QVariant::fromValue(notification)); - } - ); + }); // Called explicitly (by a click on notification for example) QObject::connect(notification, SIGNAL(deleteNotification(QVariant)), this, SLOT(deleteNotification(QVariant))); @@ -261,12 +259,10 @@ void Notifier::notifyReceivedCall (const shared_ptr &call) { CallModel *callModel = &call->getData("call-model"); - QObject::connect( - callModel, &CallModel::statusChanged, notification, [this, notification](CallModel::CallStatus status) { + QObject::connect(callModel, &CallModel::statusChanged, notification, [this, notification](CallModel::CallStatus status) { if (status == CallModel::CallStatusEnded || status == CallModel::CallStatusConnected) deleteNotification(QVariant::fromValue(notification)); - } - ); + }); QVariantMap map; map["call"].setValue(callModel); @@ -275,7 +271,7 @@ void Notifier::notifyReceivedCall (const shared_ptr &call) { showNotification(notification, NOTIFICATION_TIMEOUT_RECEIVED_CALL); } -void Notifier::notifyNewVersionAvailable (const std::string &version, const std::string &url) { +void Notifier::notifyNewVersionAvailable (const string &version, const string &url) { QObject *notification = createNotification(Notifier::NewVersionAvailable); if (!notification) return; @@ -286,4 +282,4 @@ void Notifier::notifyNewVersionAvailable (const std::string &version, const std: ::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, map); showNotification(notification, NOTIFICATION_TIMEOUT_NEW_VERSION_AVAILABLE); -} \ No newline at end of file +}