Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Weixuan Xiao
kdeconnect-kde
Commits
b0c9f48e
Commit
b0c9f48e
authored
Jan 23, 2014
by
Samoilenko Yuri
Browse files
QObject parent semantic in Device
parent
d9018cb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
kded/daemon.cpp
View file @
b0c9f48e
...
...
@@ -99,7 +99,7 @@ Daemon::Daemon(QObject *parent) : QObject(parent)
const
KConfigGroup
&
known
=
config
->
group
(
"trusted_devices"
);
const
QStringList
&
list
=
known
.
groupList
();
Q_FOREACH
(
const
QString
&
id
,
list
)
{
Device
*
device
=
new
Device
(
id
);
Device
*
device
=
new
Device
(
this
,
id
);
connect
(
device
,
SIGNAL
(
reachableStatusChanged
()),
this
,
SLOT
(
onDeviceReachableStatusChanged
()));
mDevices
[
id
]
=
device
;
...
...
@@ -166,7 +166,7 @@ void Daemon::onNewDeviceLink(const NetworkPackage& identityPackage, DeviceLink*
}
else
{
//kDebug(kdeconnect_kded()) << "It is a new device";
Device
*
device
=
new
Device
(
identityPackage
,
dl
);
Device
*
device
=
new
Device
(
this
,
identityPackage
,
dl
);
connect
(
device
,
SIGNAL
(
reachableStatusChanged
()),
this
,
SLOT
(
onDeviceReachableStatusChanged
()));
mDevices
[
id
]
=
device
;
...
...
kded/device.cpp
View file @
b0c9f48e
...
...
@@ -21,8 +21,9 @@
#include <QDBusConnection>
#include <QFile>
Device
::
Device
(
const
QString
&
id
)
:
m_deviceId
(
id
)
Device
::
Device
(
QObject
*
parent
,
const
QString
&
id
)
:
QObject
(
parent
)
,
m_deviceId
(
id
)
,
m_pairStatus
(
Device
::
Paired
)
,
m_protocolVersion
(
NetworkPackage
::
ProtocolVersion
)
//We don't know it yet
{
...
...
@@ -45,8 +46,9 @@ Device::Device(const QString& id)
QDBusConnection
::
sessionBus
().
registerObject
(
dbusPath
(),
this
,
QDBusConnection
::
ExportScriptableContents
|
QDBusConnection
::
ExportAdaptors
);
}
Device
::
Device
(
const
NetworkPackage
&
identityPackage
,
DeviceLink
*
dl
)
:
m_deviceId
(
identityPackage
.
get
<
QString
>
(
"deviceId"
))
Device
::
Device
(
QObject
*
parent
,
const
NetworkPackage
&
identityPackage
,
DeviceLink
*
dl
)
:
QObject
(
parent
)
,
m_deviceId
(
identityPackage
.
get
<
QString
>
(
"deviceId"
))
,
m_deviceName
(
identityPackage
.
get
<
QString
>
(
"deviceName"
))
,
m_deviceType
(
str2type
(
identityPackage
.
get
<
QString
>
(
"deviceType"
)))
,
m_pairStatus
(
Device
::
NotPaired
)
...
...
kded/device.h
View file @
b0c9f48e
...
...
@@ -64,14 +64,14 @@ public:
*
* We already know it but we need to wait for an incoming DeviceLink to communicate
*/
Device
(
const
QString
&
id
);
Device
(
QObject
*
parent
,
const
QString
&
id
);
/**
* Device known via an incoming connection sent to us via a devicelink.
*
* We know everything but we don't trust it yet
*/
Device
(
const
NetworkPackage
&
np
,
DeviceLink
*
dl
);
Device
(
QObject
*
parent
,
const
NetworkPackage
&
np
,
DeviceLink
*
dl
);
virtual
~
Device
();
...
...
Write
Preview
Supports
Markdown
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