mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Notif settings on external, begone goofy load/save
This commit is contained in:
@@ -2,28 +2,8 @@
|
||||
|
||||
#include <toolbox/tar/tar_archive.h>
|
||||
|
||||
#include <notification/notification_settings_filename.h>
|
||||
|
||||
#define LFS_BACKUP_DEFAULT_LOCATION EXT_PATH(LFS_BACKUP_DEFAULT_FILENAME)
|
||||
|
||||
static void backup_name_converter(FuriString* filename) {
|
||||
if(furi_string_empty(filename) || (furi_string_get_char(filename, 0) == '.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Filenames are already prefixed with '.' */
|
||||
const char* const names[] = {
|
||||
NOTIFICATION_SETTINGS_FILE_NAME,
|
||||
};
|
||||
|
||||
for(size_t i = 0; i < COUNT_OF(names); i++) {
|
||||
if(furi_string_equal(filename, &names[i][1])) {
|
||||
furi_string_set(filename, names[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool lfs_backup_create(Storage* storage, const char* destination) {
|
||||
const char* final_destination =
|
||||
destination && strlen(destination) ? destination : LFS_BACKUP_DEFAULT_LOCATION;
|
||||
@@ -37,5 +17,5 @@ bool lfs_backup_exists(Storage* storage, const char* source) {
|
||||
|
||||
bool lfs_backup_unpack(Storage* storage, const char* source) {
|
||||
const char* final_source = source && strlen(source) ? source : LFS_BACKUP_DEFAULT_LOCATION;
|
||||
return storage_int_restore(storage, final_source, backup_name_converter) == FSE_OK;
|
||||
return storage_int_restore(storage, final_source, NULL) == FSE_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user