diff -r fe67489523b5 -r 6e838748867b src/parser.cpp --- a/src/parser.cpp Sun Nov 03 17:57:21 2019 +0200 +++ b/src/parser.cpp Sun Nov 03 18:09:47 2019 +0200 @@ -254,10 +254,10 @@ invertNext = true; continue; } - std::unique_ptr object = parseFromString(line); + std::unique_ptr object = parseFromString(line); if (invertNext) { - editor.setObjectProperty(object.get(), modelobjects::Property::IsInverted, true); + editor.setObjectProperty(object.get(), linetypes::Property::IsInverted, true); } editor.append(std::move(object)); invertNext = false; @@ -317,22 +317,22 @@ return result; } -static std::unique_ptr parseType0Line( +static std::unique_ptr parseType0Line( const QString& line, const QStringList& tokens) { Q_UNUSED(tokens) if (line.startsWith("0 //")) { - return std::make_unique(line.mid(std::strlen("0 //")).simplified()); + return std::make_unique(line.mid(std::strlen("0 //")).simplified()); } else { - return std::make_unique(line.mid(1).simplified()); + return std::make_unique(line.mid(1).simplified()); } } -static std::unique_ptr parseType1Line( +static std::unique_ptr parseType1Line( const QString& line, const QStringList& tokens) { @@ -349,7 +349,7 @@ const Vertex position = vertexFromStrings(tokens, positionPosition); const Matrix3x3 transform = matrixFromStrings(tokens, transformPosition); const QString& name = tokens[namePosition]; - return std::make_unique(position, transform, name, color); + return std::make_unique(position, transform, name, color); } template @@ -374,7 +374,7 @@ return std::make_unique(vertices, color); } -std::unique_ptr Parser::parseFromString(QString line) +std::unique_ptr Parser::parseFromString(QString line) { line = line.simplified(); try @@ -382,7 +382,7 @@ const QStringList tokens = line.split(QRegExp{R"(\s+)"}); if (tokens.empty() or tokens == QStringList{{""}}) { - return std::make_unique(); + return std::make_unique(); } bool ok_code; const int code = tokens[0].toInt(&ok_code); @@ -397,19 +397,19 @@ case 1: return parseType1Line(line, tokens); case 2: - return parsePolygon(line, tokens); + return parsePolygon(line, tokens); case 3: - return parsePolygon(line, tokens); + return parsePolygon(line, tokens); case 4: - return parsePolygon(line, tokens); + return parsePolygon(line, tokens); case 5: - return parsePolygon(line, tokens); + return parsePolygon(line, tokens); default: throw BodyParseError{utility::format("bad line type '%1'", code)}; } } catch(const BodyParseError& error) { - return std::make_unique(line, error.message); + return std::make_unique(line, error.message); } }