Quantcast
Channel: PowerDevil activity
Viewing all articles
Browse latest Browse all 1684

Jakob Petsovits opened merge request !338: kcmodule: Don't crash when a confi...

$
0
0

The bounds check in the data() method of PowerButtonActionModeland SleepModeModel was incomplete, so passing an invalid indexsuch as -1 (standard value for "not found") could cause a crash.

For power management settings, a user would run into this crash iftheir configuration from powerdevilrc listed a power button actionthat's not supported on the current system. For example, a usermay have selected "Sleep" as lid action, but subsequently changedtheir systemd configuration to disable suspend-to-RAM because itcaused problems. Or they could have migrated their OS to a newcomputer which does not support Sleep.

Fixing this allows us to assign currentIndex declarativelyinstead of waiting until Component.onCompleted to (hopefully) finda valid item in the model.

BUG: 482668

(cherry picked from commit 8ecf6430)


Viewing all articles
Browse latest Browse all 1684

Trending Articles