Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
KSysGuard
Commits
2f460ece
Commit
2f460ece
authored
Sep 24, 2020
by
David Redondo
🏎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add context objects to connects in power plugin
parent
b88990d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
plugins/global/power/power.cpp
plugins/global/power/power.cpp
+2
-2
No files found.
plugins/global/power/power.cpp
View file @
2f460ece
...
...
@@ -109,13 +109,13 @@ PowerPlugin::PowerPlugin(QObject *parent, const QVariantList &args)
new
Battery
(
battery
.
as
<
Solid
::
Battery
>
(),
battery
.
displayName
(),
m_container
);
}
connect
(
Solid
::
DeviceNotifier
::
instance
(),
&
Solid
::
DeviceNotifier
::
deviceAdded
,
[
this
]
(
const
QString
&
udi
)
{
connect
(
Solid
::
DeviceNotifier
::
instance
(),
&
Solid
::
DeviceNotifier
::
deviceAdded
,
this
,
[
this
]
(
const
QString
&
udi
)
{
const
Solid
::
Device
device
(
udi
);
if
(
device
.
isDeviceInterface
(
Solid
::
DeviceInterface
::
Battery
))
{
new
Battery
(
device
.
as
<
Solid
::
Battery
>
(),
device
.
displayName
(),
m_container
);
}
});
connect
(
Solid
::
DeviceNotifier
::
instance
(),
&
Solid
::
DeviceNotifier
::
deviceRemoved
,
[
this
]
(
const
QString
&
udi
)
{
connect
(
Solid
::
DeviceNotifier
::
instance
(),
&
Solid
::
DeviceNotifier
::
deviceRemoved
,
this
,
[
this
]
(
const
QString
&
udi
)
{
const
Solid
::
Device
device
(
udi
);
if
(
device
.
isDeviceInterface
(
Solid
::
DeviceInterface
::
Battery
))
{
const
auto
object
=
m_container
->
object
(
device
.
as
<
Solid
::
Battery
>
()
->
serial
());
...
...
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