Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Frameworks
Solid
Commits
fc791894
Commit
fc791894
authored
Sep 22, 2014
by
Lukáš Tinkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no need for a qRegisterMetatype(), Q_DECLARE_METATYPE does it
plus some docu additions
parent
62ab4206
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
src/solid/power/inhibition.cpp
src/solid/power/inhibition.cpp
+2
-2
src/solid/power/power.cpp
src/solid/power/power.cpp
+1
-2
src/solid/power/power.h
src/solid/power/power.h
+7
-2
No files found.
src/solid/power/inhibition.cpp
View file @
fc791894
...
...
@@ -41,7 +41,7 @@ Inhibition::~Inhibition()
{
delete
d_ptr
->
backendObject
;
delete
d_ptr
;
}
;
}
void
Inhibition
::
start
()
{
...
...
@@ -58,4 +58,4 @@ Inhibition::State Inhibition::state() const
return
d_ptr
->
backendObject
->
state
();
}
#include "inhibition.moc"
\ No newline at end of file
#include "inhibition.moc"
src/solid/power/power.cpp
View file @
fc791894
...
...
@@ -45,7 +45,6 @@ Power* Power::self()
Power
::
Power
(
QObject
*
parent
)
:
QObject
(
parent
),
d
(
new
Private
)
{
qRegisterMetaType
<
Solid
::
Inhibition
::
State
>
(
"Inhibition::State"
);
d
->
notifier
=
PowerBackendLoader
::
notifier
();
connect
(
d
->
notifier
,
&
PowerNotifier
::
acPluggedChanged
,
this
,
&
Power
::
acPluggedChanged
);
}
...
...
@@ -75,4 +74,4 @@ RequestStateJob* Power::requestState(Power::State state, QObject* parent)
job
->
setState
(
state
);
return
job
;
}
\ No newline at end of file
}
src/solid/power/power.h
View file @
fc791894
...
...
@@ -104,14 +104,19 @@ public:
explicit
Power
(
QObject
*
parent
=
0
);
Q_SIGNALS:
/**
* Emitted when the system changes the power source
* @param plugged whether the system runs on AC
*/
void
acPluggedChanged
(
bool
plugged
);
private:
private:
class
Private
;
Private
*
d
;
Private
*
const
d
;
};
}
Q_DECLARE_METATYPE
(
Solid
::
Power
::
State
)
Q_DECLARE_OPERATORS_FOR_FLAGS
(
Solid
::
Power
::
States
)
#endif //SOLID_POWER_H
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