Who tf wrote this, and why? | Biggest stability update ever

Bro, what the fuck is this bullshit? I swear imma go cry if I see more shit like that...
This commit is contained in:
VerstreuteSeele
2023-01-06 01:45:02 +01:00
parent f082ca1915
commit a026ab37bd
199 changed files with 152 additions and 1068 deletions
+8 -42
View File
@@ -17,7 +17,6 @@ struct FapLoader {
DialogsApp* dialogs;
Gui* gui;
FuriString* fap_path;
FuriString* fap_args;
ViewDispatcher* view_dispatcher;
Loading* loading;
};
@@ -105,26 +104,14 @@ static bool fap_loader_run_selected_app(FapLoader* loader) {
FURI_LOG_I(TAG, "Loaded in %ums", (size_t)(furi_get_tick() - start));
FURI_LOG_I(TAG, "FAP Loader is starting app");
if(strcmp(furi_string_get_cstr(loader->fap_args), "false") == 0) {
FuriThread* thread = flipper_application_spawn(loader->app, NULL);
furi_thread_start(thread);
furi_thread_join(thread);
FuriThread* thread = flipper_application_spawn(loader->app, NULL);
furi_thread_start(thread);
furi_thread_join(thread);
show_error = false;
int ret = furi_thread_get_return_code(thread);
show_error = false;
int ret = furi_thread_get_return_code(thread);
FURI_LOG_I(TAG, "FAP app returned: %i", ret);
} else {
FuriThread* thread = flipper_application_spawn(
loader->app, (void*)furi_string_get_cstr(loader->fap_args));
furi_thread_start(thread);
furi_thread_join(thread);
show_error = false;
int ret = furi_thread_get_return_code(thread);
FURI_LOG_I(TAG, "FAP app returned: %i", ret);
}
FURI_LOG_I(TAG, "FAP app returned: %i", ret);
} while(0);
if(show_error) {
@@ -169,28 +156,8 @@ static bool fap_loader_select_app(FapLoader* loader) {
}
static FapLoader* fap_loader_alloc(const char* path) {
FapLoader* loader = malloc(sizeof(FapLoader)); //-V773
char* tmp = malloc(strlen(path) + 1);
strcpy(tmp, path);
char* new_path;
new_path = strtok(tmp, "¯");
if(new_path) {
loader->fap_path = furi_string_alloc_set(new_path);
} else {
loader->fap_path = furi_string_alloc_set(path);
}
new_path = strtok(NULL, "¯");
if(new_path) {
loader->fap_args = furi_string_alloc_set(new_path);
} else {
loader->fap_args = furi_string_alloc_set("false");
}
FapLoader* loader = malloc(sizeof(FapLoader)); //-V799
loader->fap_path = furi_string_alloc_set(path);
loader->storage = furi_record_open(RECORD_STORAGE);
loader->dialogs = furi_record_open(RECORD_DIALOGS);
loader->gui = furi_record_open(RECORD_GUI);
@@ -207,7 +174,6 @@ static void fap_loader_free(FapLoader* loader) {
loading_free(loader->loading);
view_dispatcher_free(loader->view_dispatcher);
furi_string_free(loader->fap_path);
furi_string_free(loader->fap_args);
furi_record_close(RECORD_GUI);
furi_record_close(RECORD_DIALOGS);
furi_record_close(RECORD_STORAGE);