Skip to content

Use KRuntimePlatform instead of tablet mode for mobile check

Nicolas Fella requested to merge work/nico/no-tablet-mode into master

We do various adaptions for Plasma Mobile throughout the powerdevil code.

For example when pressing the power button on the phone we want to lock the screen instead of suspending.

The original implementation for this used the QT_QUICK_CONTROLS_MOBILE environment variable to check whether we are on mobile, until 927e16a6 changed that to use the tablet mode.

This is problematic however. "Are we on a laptop in tablet mode" and "are we on a phone" are different things. In particular the former can change at runtime while the latter is static.

This is particularly relevant for the profile generation because that only runs once, so we get different permanent settings depending on whether or not the laptop is in tablet mode at the time of generation.

Using KRuntimePlatfrom we can check whether we are on a phone specifically and should apply phone-specifc settings

Fixes #16

Merge request reports