Commit fc791894 authored by Lukáš Tinkl's avatar Lukáš Tinkl

no need for a qRegisterMetatype(), Q_DECLARE_METATYPE does it

plus some docu additions
parent 62ab4206
......@@ -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"
......@@ -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
}
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment