Update min/max values for lifecycle settings

It doesn't make sense to allow setting these to negative values, so lets
help the user out by refusing to do so if they try.

But leave `-1` as an allowed value for the "discard" option so users can
have "freeze" enabled but turn the discard state off.

Remove the mention of -1 from the freeze setting since we don't allow
that anymore.
This commit is contained in:
toofar 2025-05-24 16:08:38 +12:00 committed by owl
parent fec97696ae
commit 734b30f7d1
No known key found for this signature in database
GPG Key ID: C2308C68A80FC991
2 changed files with 10 additions and 6 deletions

View File

@ -369,17 +369,21 @@ qt.chromium.use_recommended_page_lifecycle_state:
# yamllint enable rule:line-length
qt.chromium.lifecycle_state_freeze_delay:
type: Int
type:
name: Int
minval: 0
maxval: maxint
default: 0
backend: QtWebEngine
desc: >-
The amount of time (in milliseconds) to wait before transitioning a page to
the frozen lifecycle state.
Set to -1 to disable this state (will also disable the discard state).
qt.chromium.lifecycle_state_discard_delay:
type: Int
type:
name: Int
minval: -1
maxval: maxint
default: 0
backend: QtWebEngine
desc: >-

View File

@ -352,9 +352,9 @@ class TestPageLifecycle:
"""For negative delay values, the timer shouldn't be scheduled."""
self.set_config(
config_stub,
freeze_delay=-1,
discard_delay=-1,
)
webengine_tab._on_recommended_state_changed(QWebEnginePage.LifecycleState.Frozen)
webengine_tab._on_recommended_state_changed(QWebEnginePage.LifecycleState.Discarded)
assert not webengine_tab._lifecycle_timer.isActive()
def test_pinned_tabs_untouched(