Skip to content

Commit

Permalink
Don't save or load empty exclusion paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Oct 12, 2024
1 parent c33dae0 commit 433ea08
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/gui/app_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ void I18NOptions::Save(const wxString& filePath)
auto* exclPathsNode = new wxXmlNode(root, wxXML_ELEMENT_NODE, L"excluded-paths");
for (const auto& exclFile : m_excludedPaths)
{
auto* pathNode = new wxXmlNode(exclPathsNode, wxXML_ELEMENT_NODE, L"excluded-path");
pathNode->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxString{}, exclFile));
if (!exclFile.empty())
{
auto* pathNode = new wxXmlNode(exclPathsNode, wxXML_ELEMENT_NODE, L"excluded-path");
pathNode->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxString{}, exclFile));
}
}

node = new wxXmlNode(root, wxXML_ELEMENT_NODE, L"checks");
Expand Down Expand Up @@ -127,7 +130,10 @@ void I18NOptions::Load(const wxString& filePath)
wxXmlNode* excludedChild = child->GetChildren();
while (excludedChild != nullptr)
{
m_excludedPaths.push_back(excludedChild->GetNodeContent());
if (!excludedChild->GetNodeContent().empty())
{
m_excludedPaths.push_back(excludedChild->GetNodeContent());
}
excludedChild = excludedChild->GetNext();
}
}
Expand Down

0 comments on commit 433ea08

Please sign in to comment.