Commit abfd1631 authored by Ronan's avatar Ronan
Browse files

fix(src/components/core/CoreHandlers): remove useless define `VERSION_UPDATE_CHECK_OBJECT_NAME`

parent 543542bc
......@@ -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
}
......@@ -118,7 +118,7 @@ private:
void onVersionUpdateCheckResultReceived (
const std::shared_ptr<linphone::Core> &,
linphone::VersionUpdateCheckResult result,
const std::string &version,
const std::string &version,
const std::string &url
) override;
......
......@@ -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<linphone::Call> &call) {
CallModel *callModel = &call->getData<CallModel>("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<linphone::Call> &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
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment