Gui: Change variable name import->importCommand

import is a reserved word in c++latest
This commit is contained in:
Chris Hennes
2025-02-18 21:24:26 -06:00
parent 84b3f39785
commit 699e1bd463

View File

@@ -83,15 +83,16 @@ bool MacroFile::commit()
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
str.setCodec("UTF-8");
#endif
QStringList import;
import << QStringLiteral("import FreeCAD");
QStringList importCommand;
importCommand << QStringLiteral("import FreeCAD");
QStringList body;
for (const auto& it : std::as_const(this->macroInProgress)) {
if (it.startsWith(QLatin1String("import ")) ||
it.startsWith(QLatin1String("#import "))) {
if (import.indexOf(it) == -1)
import.push_back(it);
if (importCommand.indexOf(it) == -1) {
importCommand.push_back(it);
}
}
else {
body.push_back(it);
@@ -110,7 +111,7 @@ bool MacroFile::commit()
// write the data to the text file
str << header;
for (const auto& it : std::as_const(import)) {
for (const auto& it : std::as_const(importCommand)) {
str << it << QLatin1Char('\n');
}
str << QLatin1Char('\n');