Skip to content

Commit

Permalink
Properly fix unquoting file name
Browse files Browse the repository at this point in the history
Init member
  • Loading branch information
Blake-Madden committed Nov 3, 2024
1 parent 5e9d64b commit af6fe30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/gui/datamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ void I18NResultsTreeModel::AddRow(wxString fileName, wxString warningId, wxStrin
return strVal;
};

fileName = unquote(fileName);
for (auto& currentNode : m_root->GetChildren())
{
if (*currentNode == fileName)
{
I18NResultsTreeModelNode* childNode = new I18NResultsTreeModelNode(
currentNode.get(), unquote(fileName), unquote(warningId), unquote(issue),
currentNode.get(), fileName, unquote(warningId), unquote(issue),
unquote(explanation), line, column);
currentNode->Append(childNode);

Expand All @@ -52,7 +53,7 @@ void I18NResultsTreeModel::AddRow(wxString fileName, wxString warningId, wxStrin
m_root->Append(newFile);

I18NResultsTreeModelNode* childNode =
new I18NResultsTreeModelNode(newFile, unquote(fileName), unquote(warningId), unquote(issue),
new I18NResultsTreeModelNode(newFile, fileName, unquote(warningId), unquote(issue),
unquote(explanation), line, column);
newFile->Append(childNode);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/datamodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class I18NResultsTreeModelNode
bool m_container{ true };

private:
I18NResultsTreeModelNode* m_parent;
I18NResultsTreeModelNode* m_parent{ nullptr };
I18NResultsTreeModelNodePtrArray m_children;
};

Expand Down
11 changes: 1 addition & 10 deletions src/gui/i18napp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,16 +1048,7 @@ void I18NFrame::Process()
wxStringTokenizerMode(wxTOKEN_STRTOK | wxTOKEN_RET_EMPTY | wxTOKEN_RET_EMPTY_ALL));
while (tokenizer.HasMoreTokens())
{
wxString fileName = tokenizer.GetNextToken();
// strip quotes
if (fileName.starts_with(L'\"'))
{
fileName.erase(0, 1);
}
if (fileName.ends_with(L'\"'))
{
fileName.erase(fileName.length() - 1);
}
const wxString fileName = tokenizer.GetNextToken();
const wxString lineNo = tokenizer.GetNextToken();
const wxString columnNo = tokenizer.GetNextToken();
const wxString warningValue = tokenizer.GetNextToken();
Expand Down

0 comments on commit af6fe30

Please sign in to comment.