solid: new Solid::PowerManagement::supportedSleepStatesChanged() signal

to be used by the powerdevil runner

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-09 18:33:12 +03:00
parent 1807acdaf1
commit 4900d60892
2 changed files with 19 additions and 6 deletions

View file

@ -184,10 +184,12 @@ void Solid::PowerManagementPrivate::slotCanSuspendChanged(bool newState)
}
if (newState) {
supportedSleepStates+= Solid::PowerManagement::SuspendState;
supportedSleepStates += Solid::PowerManagement::SuspendState;
} else {
supportedSleepStates-= Solid::PowerManagement::SuspendState;
supportedSleepStates -= Solid::PowerManagement::SuspendState;
}
emit supportedSleepStatesChanged();
}
void Solid::PowerManagementPrivate::slotCanHibernateChanged(bool newState)
@ -197,10 +199,12 @@ void Solid::PowerManagementPrivate::slotCanHibernateChanged(bool newState)
}
if (newState) {
supportedSleepStates+= Solid::PowerManagement::HibernateState;
supportedSleepStates += Solid::PowerManagement::HibernateState;
} else {
supportedSleepStates-= Solid::PowerManagement::HibernateState;
supportedSleepStates -= Solid::PowerManagement::HibernateState;
}
emit supportedSleepStatesChanged();
}
void Solid::PowerManagementPrivate::slotCanHybridSuspendChanged(bool newState)
@ -210,10 +214,12 @@ void Solid::PowerManagementPrivate::slotCanHybridSuspendChanged(bool newState)
}
if (newState) {
supportedSleepStates+= Solid::PowerManagement::HybridSuspendState;
supportedSleepStates += Solid::PowerManagement::HybridSuspendState;
} else {
supportedSleepStates-= Solid::PowerManagement::HybridSuspendState;
supportedSleepStates -= Solid::PowerManagement::HybridSuspendState;
}
emit supportedSleepStatesChanged();
}
void Solid::PowerManagementPrivate::slotPowerSaveStatusChanged(bool newState)

View file

@ -147,6 +147,13 @@ namespace Solid
*/
void resumingFromSuspend();
/**
* This signal is emitted whenever the supported sleep states change.
*
* @since 4.23
*/
void supportedSleepStatesChanged();
protected:
Notifier();
};