Skip to content

Commit

Permalink
don't search for faces files if grid value is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
computergeek1507 committed Dec 10, 2024
1 parent f878a35 commit 9c0caeb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions xLights/ModelFaceDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,12 +647,15 @@ void ModelFaceDialog::OnMatrixModelsGridCellChange(wxGridEvent& event)
value = value.Truncate(value.size()-1);
}

TryToFindPath(value);
if (!value.IsEmpty()) {
TryToFindPath(value);
}

faceData[name][key.ToStdString()] = value;
MatrixModelsGrid->SetCellValue(r, c, value);

TryToSetAllMatrixModels(name, key.ToStdString(), value, r, c);
if (!value.IsEmpty()) {
TryToSetAllMatrixModels(name, key.ToStdString(), value, r, c);
}
ValidateMatrixGrid(r, c);
}

Expand Down Expand Up @@ -815,6 +818,9 @@ void ModelFaceDialog::DoSetMatrixModels(wxFileName fn, std::string actualkey, st

void ModelFaceDialog::TryToFindPath(wxString& filename) const
{
if (filename.IsEmpty()) {
return;
}
if (FileExists(filename)) {
return;
}
Expand Down Expand Up @@ -844,6 +850,9 @@ void ModelFaceDialog::TryToFindPath(wxString& filename) const

void ModelFaceDialog::TryToSetAllMatrixModels(std::string name, std::string key, std::string new_filename, int row, int col)
{
if (new_filename.empty()) {
return;
}
wxFileName fn = wxFileName(new_filename);

std::string k = ExtractKey(key);
Expand Down

0 comments on commit 9c0caeb

Please sign in to comment.