Screensaver: Unbreak screensaver_stretch_images (#7403)

* Screensaver: Unbreak screensaver_stretch_images

We don't have real ternary operators in Lua, if the second argument evaluates to false, it doesn't work.
Invert the test to avoid this pitfall.
(c.f., http://lua-users.org/wiki/TernaryOperator).

Fix #7402, regression since #7371

* Free a few similar constructs (incidentally, some of 'em also tweaked in #7371 ^^).
This commit is contained in:
NiLuJe
2021-03-10 02:14:26 +01:00
committed by GitHub
parent 0674e6060a
commit 601d2fc3d2
3 changed files with 9 additions and 9 deletions

View File

@@ -694,13 +694,13 @@ function KOSync:saveSettings()
auto_sync = self.kosync_auto_sync,
pages_before_update = self.kosync_pages_before_update,
whisper_forward =
(self.kosync_whisper_forward == SYNC_STRATEGY.DEFAULT_FORWARD
and nil
or self.kosync_whisper_forward),
(self.kosync_whisper_forward ~= SYNC_STRATEGY.DEFAULT_FORWARD
and self.kosync_whisper_forward
or nil),
whisper_backward =
(self.kosync_whisper_backward == SYNC_STRATEGY.DEFAULT_BACKWARD
and nil
or self.kosync_whisper_backward),
(self.kosync_whisper_backward ~= SYNC_STRATEGY.DEFAULT_BACKWARD
and self.kosync_whisper_backward
or nil),
}
G_reader_settings:saveSetting("kosync", settings)
end