Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
363d03e6
Commit
363d03e6
authored
Nov 15, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unstable
parent
c1e6d7d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
Notification.cpp
tests/src/components/notification/Notification.cpp
+24
-2
No files found.
tests/src/components/notification/Notification.cpp
View file @
363d03e6
...
...
@@ -5,8 +5,8 @@
#include "Notification.hpp"
#define NOTIFICATION_SHOW_METHOD_NAME "show"
#define NOTIFICATION_EDGE_PROPERTY_NAME "edge"
#define NOTIFICATION_EDGE_PROPERTY_NAME "edge"
#define NOTIFICATION_HEIGHT_PROPERTY "popupHeight"
#define NOTIFICATION_WIDTH_PROPERTY "popupWidth"
...
...
@@ -72,15 +72,37 @@ void Notification::showCallMessage (
qDebug
()
<<
"Show call notification message. (addr="
<<
sip_address
<<
")"
;
m_mutex
.
lock
();
// Check existing instances.
if
(
m_n_instances
+
1
>=
N_MAX_NOTIFICATIONS
)
{
qWarning
()
<<
"Unable to create another notification"
;
m_mutex
.
unlock
();
return
;
}
// Create instance and set attributes.
QObject
*
object
=
m_components
[
Notification
::
Call
]
->
create
();
if
(
!
setNotificationEdge
(
*
object
,
m_edge
))
{
delete
object
;
m_mutex
.
unlock
();
return
;
}
m_n_instances
++
;
m_mutex
.
unlock
();
// Display popup.
QMetaObject
::
invokeMethod
(
object
,
"show"
,
Qt
::
DirectConnection
);
QTimer
::
singleShot
(
timeout
,
object
,
[
object
]()
{
// Destroy it after timeout.
QTimer
::
singleShot
(
timeout
,
this
,
[
object
,
this
]()
{
delete
object
;
m_mutex
.
lock
();
m_n_instances
--
;
m_mutex
.
unlock
();
});
}
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