Various improvements (#547)
- Fixed crash when returning to Setup app (from any of the steps) - Fixed crash when returning to TimeDateSettings app (after locale selection) - Fixed GuiService inconsistent behaviour: now always perform operations async (e.g. to show/hide apps). This fixes crashes in some onHide() calls where onHide() might be called before onShow() was called. - Fix for incorrect WebServService path - Remove CYD-4848S040C SD card functionality, but added a GPIO fix for releasing 3-wire SPI pin sharing. - Fix for saving/loading settings for various apps
This commit is contained in:
committed by
GitHub
parent
a323f8e148
commit
ecad2248d9
@@ -60,8 +60,11 @@ bool hasFileForDevice(const std::string& addr_hex) {
|
||||
}
|
||||
|
||||
bool load(const std::string& addr_hex, PairedDevice& device) {
|
||||
auto file_path = getFilePath(addr_hex);
|
||||
if (!file::isFile(file_path)) return false;
|
||||
|
||||
std::map<std::string, std::string> map;
|
||||
if (!file::loadPropertiesFile(getFilePath(addr_hex), map)) return false;
|
||||
if (!file::loadPropertiesFile(file_path, map)) return false;
|
||||
if (!map.contains(KEY_ADDR)) return false;
|
||||
if (!hexToAddr(map[KEY_ADDR], device.addr)) return false;
|
||||
|
||||
@@ -83,7 +86,12 @@ bool save(const PairedDevice& device) {
|
||||
map[KEY_ADDR] = addr_hex;
|
||||
map[KEY_AUTO_CONNECT] = device.autoConnect ? "true" : "false";
|
||||
map[KEY_PROFILE_ID] = std::to_string(device.profileId);
|
||||
return file::savePropertiesFile(getFilePath(addr_hex), map);
|
||||
auto file_path = getFilePath(addr_hex);
|
||||
if (!file::findOrCreateParentDirectory(file_path, 0755)) {
|
||||
LOGGER.error("Failed to create parent dir for {}", file_path);
|
||||
return false;
|
||||
}
|
||||
return file::savePropertiesFile(file_path, map);
|
||||
}
|
||||
|
||||
bool remove(const std::string& addr_hex) {
|
||||
|
||||
Reference in New Issue
Block a user