Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
libbluedevil
Commits
47bc8b9b
Commit
47bc8b9b
authored
Apr 05, 2013
by
Àlex Fiestas
Browse files
Avoid creating Adapter objects for dbusPath that we already have
CCBUG:314356
parent
0fa1e2be
Changes
1
Hide whitespace changes
Inline
Side-by-side
bluedevil/bluedevilmanager.cpp
View file @
47bc8b9b
...
...
@@ -161,6 +161,11 @@ Adapter *Manager::Private::findUsableAdapter()
void
Manager
::
Private
::
_k_adapterAdded
(
const
QDBusObjectPath
&
objectPath
)
{
qDebug
()
<<
"Added: "
<<
objectPath
.
path
();
if
(
m_adaptersHash
.
contains
(
objectPath
.
path
()))
{
qDebug
()
<<
"Already in the adapterHash"
;
return
;
}
Adapter
*
const
adapter
=
new
Adapter
(
objectPath
.
path
(),
m_q
);
connect
(
adapter
,
SIGNAL
(
poweredChanged
(
bool
)),
m_q
,
SLOT
(
_k_adapterPoweredChanged
(
bool
)));
...
...
@@ -301,7 +306,7 @@ Adapter *Manager::defaultAdapter()
if
(
!
d
->
m_defaultAdapter
)
{
const
QString
adapterPath
=
d
->
m_bluezManagerInterface
->
DefaultAdapter
().
value
().
path
();
if
(
!
adapterPath
.
isEmpty
())
{
if
(
!
adapterPath
.
isEmpty
()
&&
!
d
->
m_adaptersHash
.
contains
(
adapterPath
)
)
{
d
->
m_defaultAdapter
=
new
Adapter
(
adapterPath
,
const_cast
<
Manager
*>
(
this
));
connect
(
d
->
m_defaultAdapter
,
SIGNAL
(
poweredChanged
(
bool
)),
SLOT
(
_k_adapterPoweredChanged
(
bool
)));
d
->
m_adaptersHash
.
insert
(
adapterPath
,
d
->
m_defaultAdapter
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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