Skip to content

Commit

Permalink
BUG: Fix out of core preferences file save bug (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarquisbq authored Jul 4, 2024
1 parent a6324ca commit 5f1e159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/simplnx/Core/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void Preferences::setPluginValue(const std::string& pluginName, const std::strin

Result<> Preferences::saveToFile(const std::filesystem::path& filepath) const
{
if(!std::filesystem::create_directories(filepath.parent_path()))
if(!std::filesystem::exists(filepath.parent_path()) && !std::filesystem::create_directories(filepath.parent_path()))
{
return MakeErrorResult(k_FailedToCreateDirectory_Code, k_FailedToCreateDirectory_Message);
}
Expand Down
8 changes: 4 additions & 4 deletions src/simplnx/Core/Preferences.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class SIMPLNX_EXPORT Preferences
friend class AbstractPlugin;

public:
static inline constexpr StringLiteral k_LargeDataSize_Key = "large_data_size";
static inline constexpr StringLiteral k_PreferredLargeDataFormat_Key = "large_data_format";
static inline constexpr StringLiteral k_LargeDataStructureSize_Key = "large_datastructure_size";
static inline constexpr StringLiteral k_ForceOocData_Key = "force_ooc_data";
static inline constexpr StringLiteral k_LargeDataSize_Key = "large_data_size"; // bytes
static inline constexpr StringLiteral k_PreferredLargeDataFormat_Key = "large_data_format"; // string
static inline constexpr StringLiteral k_LargeDataStructureSize_Key = "large_datastructure_size"; // bytes
static inline constexpr StringLiteral k_ForceOocData_Key = "force_ooc_data"; // boolean

static std::filesystem::path DefaultFilePath(const std::string& applicationName);

Expand Down

0 comments on commit 5f1e159

Please sign in to comment.