mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
fix: File provider sometimes not saving path to project file
This commit is contained in:
@@ -297,10 +297,13 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
nlohmann::json FileProvider::storeSettings(nlohmann::json settings) const {
|
||||
std::string path;
|
||||
if (auto projectPath = ProjectFile::getPath(); !projectPath.empty())
|
||||
settings["path"] = hex::toUTF8String(std::fs::relative(this->m_path, projectPath.parent_path()));
|
||||
else
|
||||
settings["path"] = hex::toUTF8String(this->m_path);
|
||||
path = hex::toUTF8String(std::fs::proximate(this->m_path, projectPath.parent_path()));
|
||||
if (path.empty())
|
||||
path = hex::toUTF8String(this->m_path);
|
||||
|
||||
settings["path"] = path;
|
||||
|
||||
return Provider::storeSettings(settings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user