use non prefixed names for regular files with random name

This commit is contained in:
MX 2024-03-15 09:33:27 +03:00
parent f88da8b0c3
commit ce67472dc4
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
6 changed files with 15 additions and 3 deletions

View file

@ -17,7 +17,7 @@ void ibutton_scene_save_name_on_enter(void* context) {
const bool is_new_file = furi_string_empty(ibutton->file_path);
if(is_new_file) {
name_generator_make_auto(
name_generator_make_auto_basic(
ibutton->key_name, IBUTTON_KEY_NAME_SIZE, IBUTTON_APP_FILENAME_PREFIX);
}

View file

@ -12,7 +12,7 @@ void lfrfid_scene_save_name_on_enter(void* context) {
if(key_name_is_empty) {
furi_string_set(app->file_path, LFRFID_APP_FOLDER);
name_generator_make_auto(
name_generator_make_auto_basic(
app->text_store, LFRFID_TEXT_STORE_SIZE, LFRFID_APP_FILENAME_PREFIX);
furi_string_set(folder_path, LFRFID_APP_FOLDER);

View file

@ -481,7 +481,7 @@ static void nfc_protocol_support_scene_save_name_on_enter(NfcApp* instance) {
bool name_is_empty = furi_string_empty(instance->file_name);
if(name_is_empty) {
furi_string_set(instance->file_path, NFC_APP_FOLDER);
name_generator_make_auto(
name_generator_make_auto_basic(
instance->text_store, NFC_TEXT_STORE_SIZE, NFC_APP_FILENAME_PREFIX);
furi_string_set(folder_path, NFC_APP_FOLDER);
} else {

View file

@ -60,6 +60,14 @@ void name_generator_make_auto(char* name, size_t max_name_size, const char* pref
name_generator_make_auto_datetime(name, max_name_size, prefix, NULL);
}
void name_generator_make_auto_basic(char* name, size_t max_name_size, const char* prefix) {
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDetailedFilename)) {
name_generator_make_detailed_datetime(name, max_name_size, prefix, NULL);
} else {
name_generator_make_random(name, max_name_size);
}
}
void name_generator_make_random_prefixed(char* name, size_t max_name_size, const char* prefix) {
furi_assert(name);
furi_assert(max_name_size);

View file

@ -21,6 +21,9 @@ void name_generator_make_auto_datetime(
const char* prefix,
DateTime* custom_time);
// Generate name without prefix in random names
void name_generator_make_auto_basic(char* name, size_t max_name_size, const char* prefix);
/** Generates random name
*
* @param name buffer to write random name

View file

@ -2645,6 +2645,7 @@ Function,-,music_worker_set_volume,void,"MusicWorker*, float"
Function,-,music_worker_start,void,MusicWorker*
Function,-,music_worker_stop,void,MusicWorker*
Function,+,name_generator_make_auto,void,"char*, size_t, const char*"
Function,+,name_generator_make_auto_basic,void,"char*, size_t, const char*"
Function,+,name_generator_make_auto_datetime,void,"char*, size_t, const char*, DateTime*"
Function,+,name_generator_make_detailed,void,"char*, size_t, const char*"
Function,+,name_generator_make_detailed_datetime,void,"char*, size_t, const char*, DateTime*"

1 entry status name type params
2645 Function - music_worker_start void MusicWorker*
2646 Function - music_worker_stop void MusicWorker*
2647 Function + name_generator_make_auto void char*, size_t, const char*
2648 Function + name_generator_make_auto_basic void char*, size_t, const char*
2649 Function + name_generator_make_auto_datetime void char*, size_t, const char*, DateTime*
2650 Function + name_generator_make_detailed void char*, size_t, const char*
2651 Function + name_generator_make_detailed_datetime void char*, size_t, const char*, DateTime*