Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
linphone-desktop
Commits
abfd1631
Commit
abfd1631
authored
Jun 05, 2017
by
Ronan
Browse files
fix(src/components/core/CoreHandlers): remove useless define `VERSION_UPDATE_CHECK_OBJECT_NAME`
parent
543542bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
+20
-25
linphone-desktop/src/components/core/CoreHandlers.cpp
linphone-desktop/src/components/core/CoreHandlers.cpp
+13
-14
linphone-desktop/src/components/core/CoreHandlers.hpp
linphone-desktop/src/components/core/CoreHandlers.hpp
+1
-1
linphone-desktop/src/components/notifier/Notifier.cpp
linphone-desktop/src/components/notifier/Notifier.cpp
+6
-10
No files found.
linphone-desktop/src/components/core/CoreHandlers.cpp
View file @
abfd1631
...
...
@@ -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
}
linphone-desktop/src/components/core/CoreHandlers.hpp
View file @
abfd1631
...
...
@@ -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
;
...
...
linphone-desktop/src/components/notifier/Notifier.cpp
View file @
abfd1631
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment