refactor: Eliminated relative path includes (#1961)
## Summary Relative includes can hide inappropriate dependency relationships. In this case, I found that lib/KOReaderSync/KOReaderCredentialStore.cpp was dependent on src/JsonSettingsIO.h -- a lib -> app dependency, the opposite direction dependencies should flow in this project. This change replaces all relative includes with root-relative includes, and corrects the KOReaderCredentialStore dependency by moving its JSON settings serialization local to the KOReaderSync library. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**PARTIALLY**_
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <ObfuscationUtils.h>
|
||||
#include <Serialization.h>
|
||||
|
||||
#include "../../src/JsonSettingsIO.h"
|
||||
#include "KOReaderJsonIO.h"
|
||||
|
||||
// Initialize the static instance
|
||||
KOReaderCredentialStore KOReaderCredentialStore::instance;
|
||||
@@ -36,7 +36,7 @@ void legacyDeobfuscate(std::string& data) {
|
||||
|
||||
bool KOReaderCredentialStore::saveToFile() const {
|
||||
Storage.mkdir("/.crosspoint");
|
||||
return JsonSettingsIO::saveKOReader(*this, KOREADER_FILE_JSON);
|
||||
return KOReaderJsonIO::save(*this, KOREADER_FILE_JSON);
|
||||
}
|
||||
|
||||
bool KOReaderCredentialStore::loadFromFile() {
|
||||
@@ -45,7 +45,7 @@ bool KOReaderCredentialStore::loadFromFile() {
|
||||
String json = Storage.readFile(KOREADER_FILE_JSON);
|
||||
if (!json.isEmpty()) {
|
||||
bool resave = false;
|
||||
bool result = JsonSettingsIO::loadKOReader(*this, json.c_str(), &resave);
|
||||
bool result = KOReaderJsonIO::load(*this, json.c_str(), &resave);
|
||||
if (result && resave) {
|
||||
saveToFile();
|
||||
LOG_DBG("KRS", "Resaved KOReader credentials to update format");
|
||||
|
||||
Reference in New Issue
Block a user