From 62626aaea9052c86668a3127d327cbc3a436a709 Mon Sep 17 00:00:00 2001 From: Alexander Zhylin Date: Tue, 28 Jul 2026 15:46:18 +0300 Subject: [PATCH] Correct cancel editing the file description after file upload --- TODO.md | 27 ++------------------------- src/modals/upload_props_dialogue.c | 4 ---- src/windows/text_edit.c | 5 ++++- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/TODO.md b/TODO.md index a5ed23d..c844be6 100644 --- a/TODO.md +++ b/TODO.md @@ -1,40 +1,17 @@ # TODO: ## Current: -- [ ] File upload multiline description (window) -- [ ] Sorting in the file list +- [ ] Sorting in the file list (local files) - [ ] Resume download - [ ] Separate common structures in the common.h -- [x] Rewrite cancel download. Use packages and check every time for a confirmation to continue download -- [x] Show download/upload progress in percentages -- [x] Break line automatically in modal widgets -- [x] Cancel upload/download -- [x] Input: fix non-Latin letters -- [x] Get rid of unsigned integers -- [x] Check registration / enter server name again -- [x] PageUp/PageDown key functionality in lists -- [x] Permission checkboxes for file upload/edit -- [x] Upload menu disappears after alert (when opening link to non-existing directory for example). ## Global tasks: - [ ] Testing - [ ] Documentation -## Bugs: -- [x] Sometimes segfaults while navigating through modal menu - ## Features: -- [x] Search files -- [x] Correct spacing in the search bar -- [x] Finish registration -- [x] Privilege settings for files - [ ] Files removal - [ ] Encryption -- [x] UTF-8 support - [ ] Check MD5 sum after download/upload - [ ] Hotkeys for buttons -- [ ] Manipulation by UI-cursor - -## Fixes: -- [x] Check and fix registration and login -- [x] CMAKE \ No newline at end of file +- [ ] Manipulation by UI-cursor \ No newline at end of file diff --git a/src/modals/upload_props_dialogue.c b/src/modals/upload_props_dialogue.c index f541f19..7888ee5 100644 --- a/src/modals/upload_props_dialogue.c +++ b/src/modals/upload_props_dialogue.c @@ -40,10 +40,6 @@ void upload_props_dialogue_modal_cb(w_cb_args_t *args) { app->query_args->file->size, privileges); /* app->query_args->file->description = malloc(desc_input->value_len + 9); reserve space for \n:END:\n */ - app->query_args->file->description = - malloc(sizeof("[Empty description]\n:END:\n")); - strcpy(app->query_args->file->description, - "[Empty description]\n:END:\n"); d->needs_destroy = true; app->query_args->state = S_UPLOAD_REQUESTED; break; diff --git a/src/windows/text_edit.c b/src/windows/text_edit.c index dd15642..089f1c8 100644 --- a/src/windows/text_edit.c +++ b/src/windows/text_edit.c @@ -18,8 +18,8 @@ #include #include "d_array.h" -#include "text_edit.h" #include "file_list.h" +#include "text_edit.h" #include "widget_core.h" /* TODO: расширять capacity линии при достижении лимита */ @@ -210,6 +210,9 @@ static int32_t process_user_input(app_t *app, w_cb_args_t *d_args) { /* Save */ break; case KEY_F(8): + server_send_string(app->query_args, "[Empty description]\n:END:\n"); + app->query_args->state = S_WAIT_SERVER; + app->callback_after_notification = callback_after_notification; /* Cancel */ break; default: