From 8a5782ab9eb4cacde003886148bf153145bef448 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 2 May 2023 03:44:29 +0100 Subject: [PATCH] Format --- applications/main/archive/helpers/favorite_timeout.c | 8 +++----- applications/main/archive/scenes/archive_scene_browser.c | 7 ++++--- .../xtreme_app/scenes/xtreme_app_scene_interface_common.c | 6 +++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/applications/main/archive/helpers/favorite_timeout.c b/applications/main/archive/helpers/favorite_timeout.c index 703f6c796..b46057d82 100644 --- a/applications/main/archive/helpers/favorite_timeout.c +++ b/applications/main/archive/helpers/favorite_timeout.c @@ -11,7 +11,8 @@ bool process_favorite_launch(char** args) { void favorite_timeout_callback(void* _ctx) { FavoriteTImeoutCtx* ctx = _ctx; - while(scene_manager_handle_back_event(ctx->scene_manager)); + while(scene_manager_handle_back_event(ctx->scene_manager)) + ; view_dispatcher_stop(ctx->view_dispatcher); } @@ -22,10 +23,7 @@ void favorite_timeout_run(ViewDispatcher* view_dispatcher, SceneManager* scene_m return; } - FavoriteTImeoutCtx ctx = { - .view_dispatcher = view_dispatcher, - .scene_manager = scene_manager - }; + FavoriteTImeoutCtx ctx = {.view_dispatcher = view_dispatcher, .scene_manager = scene_manager}; FuriTimer* timer = furi_timer_alloc(favorite_timeout_callback, FuriTimerTypeOnce, &ctx); furi_timer_start(timer, timeout * furi_kernel_get_tick_frequency()); view_dispatcher_run(view_dispatcher); diff --git a/applications/main/archive/scenes/archive_scene_browser.c b/applications/main/archive/scenes/archive_scene_browser.c index 0f4d48db1..f0884ab73 100644 --- a/applications/main/archive/scenes/archive_scene_browser.c +++ b/applications/main/archive/scenes/archive_scene_browser.c @@ -36,7 +36,8 @@ static void archive_loader_callback(const void* message, void* context) { } } -static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected, bool favorites) { +static void + archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected, bool favorites) { UNUSED(browser); Loader* loader = furi_record_open(RECORD_LOADER); @@ -48,13 +49,13 @@ static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selec } status = loader_start(loader, flipper_app_name[selected->type], param); } else { + const char* str = furi_string_get_cstr(selected->path); if(favorites) { - const char* str = furi_string_get_cstr(selected->path); char arg[strlen(str) + 4]; snprintf(arg, sizeof(arg), "fav%s", str); status = loader_start(loader, flipper_app_name[selected->type], arg); } else { - status = loader_start(loader, flipper_app_name[selected->type], furi_string_get_cstr(selected->path)); + status = loader_start(loader, flipper_app_name[selected->type], str); } } diff --git a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_common.c b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_common.c index 08b7425f6..54b0241d9 100644 --- a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_common.c +++ b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_common.c @@ -78,7 +78,11 @@ void xtreme_app_scene_interface_common_on_enter(void* context) { variable_item_set_current_value_text(item, value ? "ON" : "OFF"); item = variable_item_list_add( - var_item_list, "Favorite Timeout", 61, xtreme_app_scene_interface_common_favorite_timeout_changed, app); + var_item_list, + "Favorite Timeout", + 61, + xtreme_app_scene_interface_common_favorite_timeout_changed, + app); variable_item_set_current_value_index(item, xtreme_settings->favorite_timeout); char text[4]; snprintf(text, sizeof(text), "%lu S", xtreme_settings->favorite_timeout);