Skip to content

Commit ce67472

Browse files
committed
use non prefixed names for regular files with random name
1 parent f88da8b commit ce67472

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

applications/main/ibutton/scenes/ibutton_scene_save_name.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void ibutton_scene_save_name_on_enter(void* context) {
1717
const bool is_new_file = furi_string_empty(ibutton->file_path);
1818

1919
if(is_new_file) {
20-
name_generator_make_auto(
20+
name_generator_make_auto_basic(
2121
ibutton->key_name, IBUTTON_KEY_NAME_SIZE, IBUTTON_APP_FILENAME_PREFIX);
2222
}
2323

applications/main/lfrfid/scenes/lfrfid_scene_save_name.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void lfrfid_scene_save_name_on_enter(void* context) {
1212
if(key_name_is_empty) {
1313
furi_string_set(app->file_path, LFRFID_APP_FOLDER);
1414

15-
name_generator_make_auto(
15+
name_generator_make_auto_basic(
1616
app->text_store, LFRFID_TEXT_STORE_SIZE, LFRFID_APP_FILENAME_PREFIX);
1717

1818
furi_string_set(folder_path, LFRFID_APP_FOLDER);

applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static void nfc_protocol_support_scene_save_name_on_enter(NfcApp* instance) {
481481
bool name_is_empty = furi_string_empty(instance->file_name);
482482
if(name_is_empty) {
483483
furi_string_set(instance->file_path, NFC_APP_FOLDER);
484-
name_generator_make_auto(
484+
name_generator_make_auto_basic(
485485
instance->text_store, NFC_TEXT_STORE_SIZE, NFC_APP_FILENAME_PREFIX);
486486
furi_string_set(folder_path, NFC_APP_FOLDER);
487487
} else {

lib/toolbox/name_generator.c

+8
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ void name_generator_make_auto(char* name, size_t max_name_size, const char* pref
6060
name_generator_make_auto_datetime(name, max_name_size, prefix, NULL);
6161
}
6262

63+
void name_generator_make_auto_basic(char* name, size_t max_name_size, const char* prefix) {
64+
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDetailedFilename)) {
65+
name_generator_make_detailed_datetime(name, max_name_size, prefix, NULL);
66+
} else {
67+
name_generator_make_random(name, max_name_size);
68+
}
69+
}
70+
6371
void name_generator_make_random_prefixed(char* name, size_t max_name_size, const char* prefix) {
6472
furi_assert(name);
6573
furi_assert(max_name_size);

lib/toolbox/name_generator.h

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ void name_generator_make_auto_datetime(
2121
const char* prefix,
2222
DateTime* custom_time);
2323

24+
// Generate name without prefix in random names
25+
void name_generator_make_auto_basic(char* name, size_t max_name_size, const char* prefix);
26+
2427
/** Generates random name
2528
*
2629
* @param name buffer to write random name

targets/f7/api_symbols.csv

+1
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,7 @@ Function,-,music_worker_set_volume,void,"MusicWorker*, float"
26452645
Function,-,music_worker_start,void,MusicWorker*
26462646
Function,-,music_worker_stop,void,MusicWorker*
26472647
Function,+,name_generator_make_auto,void,"char*, size_t, const char*"
2648+
Function,+,name_generator_make_auto_basic,void,"char*, size_t, const char*"
26482649
Function,+,name_generator_make_auto_datetime,void,"char*, size_t, const char*, DateTime*"
26492650
Function,+,name_generator_make_detailed,void,"char*, size_t, const char*"
26502651
Function,+,name_generator_make_detailed_datetime,void,"char*, size_t, const char*, DateTime*"

0 commit comments

Comments
 (0)