mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 15:04:19 +00:00
use non prefixed names for regular files with random name
This commit is contained in:
parent
f88da8b0c3
commit
ce67472dc4
6 changed files with 15 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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*"
|
||||
|
|
|
Loading…
Reference in a new issue