[Everywhere] FileInfo::hasExtension for multiple values (#9774)

* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
This commit is contained in:
Benjamin Bræstrup Sayoc
2023-08-07 17:55:19 +02:00
committed by GitHub
parent 8b2c2dab51
commit da2ae719f2
16 changed files with 56 additions and 68 deletions

View File

@@ -1124,14 +1124,13 @@ void DrawViewSection::makeLineSets(void)
std::string fileSpec = PatIncluded.getValue();
Base::FileInfo fi(fileSpec);
std::string ext = fi.extension();
if (!fi.isReadable()) {
Base::Console().Message("%s can not read hatch file: %s\n", getNameInDocument(),
fileSpec.c_str());
return;
}
if (ext == "pat" || ext == "PAT") {
if (fi.hasExtension("pat")) {
if (!fileSpec.empty() && !NameGeomPattern.isEmpty()) {
m_lineSets.clear();
m_lineSets = DrawGeomHatch::makeLineSets(fileSpec, NameGeomPattern.getValue());