abalaji added inline comments.
INLINE COMMENTS
> suspendsession.cpp:137
> Q_EMIT aboutToSuspend();
> - suspendJob =
> backend()->suspend(PowerDevil::BackendInterface::ToRam);
> + if (m_suspendThenHibernateEnabled) {
> + suspendJob =
> backend()->suspend(PowerDevil::BackendInterface::SuspendThenHibernate);
How about avoiding the duplicate `suspendJob = backend()->suspend()` calls by
doing:
suspendJob = backend()->suspend(m_suspendThenHibernateEnabled
? PowerDevil::BackendInterface::SuspendThenHibernate :
PowerDevil::BackendInterface::ToRam);
> suspendsession.cpp:177
> {
> if (config.isValid() && config.hasKey("idleTime") &&
> config.hasKey("suspendType")) {
> // Add the idle timeout
Factor the `config.isValid()` out of the two `if` statements
> suspendsessionconfig.cpp:57
> configGroup().writeEntry("idleTime", m_idleTime->value() * 60 * 1000);
> + if (m_suspendThenHibernateEnabled) {
> + configGroup().writeEntry<bool>(
Again
configGroup().writeEntry<bool>("suspendThenHibernate",
m_suspendThenHibernateEnabled != nullptr &&
m_suspendThenHibernateEnabled->isChecked());
> suspendsessionconfig.cpp:106
> hlay->addWidget(m_comboBox);
> + hlay->addWidget(m_idleTime);
> hlay->addStretch();
Stray line swap
> suspendsessionconfig.cpp:121
> + } else {
> + m_suspendThenHibernateEnabled->deleteLater();
> + m_suspendThenHibernateEnabled = nullptr;
Not sure if this is necessary, just `delete m_suspendThenHibernateEnabled`
might be enough.
REPOSITORY
R122 Powerdevil
BRANCH
arcpatch-D16425_1
REVISION DETAIL
https://phabricator.kde.org/D16425
To: avaldes, broulik, ngraham
Cc: reverendhomer, meven, soriano, abalaji, graesslin, ngraham, plasma-devel,
jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed,
jensreuterberg, abetts, sebas, apol, mart