Add template based SelectionSingleton::countObjectsOfType

Also convert code to use this new method
This commit is contained in:
Benjamin Nauck
2025-01-10 19:09:50 +01:00
parent 7a5a3d1ffc
commit 08c9a191e2
22 changed files with 148 additions and 165 deletions

View File

@@ -510,10 +510,7 @@ bool SketcherGui::isCommandActive(Gui::Document* doc, bool actsOnSelection)
if (!actsOnSelection) {
return true;
}
else if (Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId())
> 0) {
return true;
}
return Gui::Selection().countObjectsOfType<Sketcher::SketchObject>() > 0;
}
}
@@ -531,11 +528,7 @@ bool SketcherGui::isSketcherBSplineActive(Gui::Document* doc, bool actsOnSelecti
if (!actsOnSelection) {
return true;
}
else if (Gui::Selection().countObjectsOfType(
Sketcher::SketchObject::getClassTypeId())
> 0) {
return true;
}
return Gui::Selection().countObjectsOfType<Sketcher::SketchObject>() > 0;
}
}
}