mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[apps, poincare] Optimize the preferences singletons' usage by removing superfluous checks in the setters, and performing manual CSE in the callers.
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
This commit is contained in:
committed by
EmilieNumworks
parent
ddebc06fa5
commit
70a8d06cfe
@@ -114,8 +114,9 @@ VariableBoxController * AppsContainer::variableBoxController() {
|
||||
|
||||
void AppsContainer::suspend(bool checkIfPowerKeyReleased) {
|
||||
resetShiftAlphaStatus();
|
||||
GlobalPreferences * globalPreferences = GlobalPreferences::sharedGlobalPreferences();
|
||||
#ifdef EPSILON_BOOT_PROMPT
|
||||
if (activeApp()->snapshot()!= onBoardingAppSnapshot() && activeApp()->snapshot() != hardwareTestAppSnapshot() && GlobalPreferences::sharedGlobalPreferences()->showPopUp()) {
|
||||
if (activeApp()->snapshot()!= onBoardingAppSnapshot() && activeApp()->snapshot() != hardwareTestAppSnapshot() && globalPreferences->showPopUp()) {
|
||||
activeApp()->displayModalViewController(&m_promptController, 0.f, 0.f);
|
||||
}
|
||||
#endif
|
||||
@@ -123,7 +124,7 @@ void AppsContainer::suspend(bool checkIfPowerKeyReleased) {
|
||||
/* Ion::Power::suspend() completely shuts down the LCD controller. Therefore
|
||||
* the frame memory is lost. That's why we need to force a window redraw
|
||||
* upon wakeup, otherwise the screen is filled with noise. */
|
||||
Ion::Backlight::setBrightness(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel());
|
||||
Ion::Backlight::setBrightness(globalPreferences->brightnessLevel());
|
||||
m_backlightDimmingTimer.reset();
|
||||
window()->redraw(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user