Renamed some methods of the Model class to remove the 'emplace' word (however cromulent it is, being from STL...) from them.

Sun, 05 Mar 2017 16:50:06 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 05 Mar 2017 16:50:06 +0200
changeset 1187
46dc716238fd
parent 1186
eae8b3bce545
child 1188
872c4a3f4151

Renamed some methods of the Model class to remove the 'emplace' word (however cromulent it is, being from STL...) from them.

src/canvas.cpp file | annotate | diff | comparison | revisions
src/dialogs/newpartdialog.cpp file | annotate | diff | comparison | revisions
src/documentloader.cpp file | annotate | diff | comparison | revisions
src/editmodes/circleMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/curvemode.cpp file | annotate | diff | comparison | revisions
src/editmodes/drawMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/linePathMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/rectangleMode.cpp file | annotate | diff | comparison | revisions
src/lddocument.cpp file | annotate | diff | comparison | revisions
src/linetypes/conditionaledge.cpp file | annotate | diff | comparison | revisions
src/linetypes/modelobject.cpp file | annotate | diff | comparison | revisions
src/model.cpp file | annotate | diff | comparison | revisions
src/model.h file | annotate | diff | comparison | revisions
src/primitives.cpp file | annotate | diff | comparison | revisions
src/toolsets/algorithmtoolset.cpp file | annotate | diff | comparison | revisions
--- a/src/canvas.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/canvas.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -256,7 +256,7 @@
 	{
 		PrimitiveTreeItem* item = static_cast<PrimitiveTreeItem*> (m_window->getPrimitivesTree()->currentItem());
 		QString primitiveName = item->primitive()->name;
-		LDSubfileReference* reference = currentDocument()->emplaceAt<LDSubfileReference>(m_window->suggestInsertPoint());
+		LDSubfileReference* reference = currentDocument()->insert<LDSubfileReference>(m_window->suggestInsertPoint());
 		reference->setFileInfo (m_documents->getDocumentByName(primitiveName));
 		currentDocument()->addToSelection(reference);
 		m_window->buildObjectList();
--- a/src/dialogs/newpartdialog.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/dialogs/newpartdialog.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -70,16 +70,16 @@
 
 void NewPartDialog::fillHeader (LDDocument* newdoc) const
 {
-	newdoc->emplace<LDComment>(title());
-	newdoc->emplace<LDComment>("Name: <untitled>.dat");
-	newdoc->emplace<LDComment>("Author: " + author());
-	newdoc->emplace<LDComment>("!LDRAW_ORG Unofficial_Part");
+	newdoc->append<LDComment>(title());
+	newdoc->append<LDComment>("Name: <untitled>.dat");
+	newdoc->append<LDComment>("Author: " + author());
+	newdoc->append<LDComment>("!LDRAW_ORG Unofficial_Part");
 	QString license = preferredLicenseText();
 
 	if (not license.isEmpty())
-		newdoc->emplace<LDComment>(license);
+		newdoc->append<LDComment>(license);
 
-	newdoc->emplace<LDEmpty>();
-	newdoc->emplace<LDBfc>(getWinding());
-	newdoc->emplace<LDEmpty>();
+	newdoc->append<LDEmpty>();
+	newdoc->append<LDBfc>(getWinding());
+	newdoc->append<LDEmpty>();
 }
--- a/src/documentloader.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/documentloader.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -113,7 +113,7 @@
 		while (line.endsWith ("\n") or line.endsWith ("\r"))
 			line.chop (1);
 
-		LDObject* obj = _model->addFromString(line);
+		LDObject* obj = _model->appendFromString(line);
 
 		// Check for parse errors and warn about them
 		if (obj->type() == LDObjectType::Error)
--- a/src/editmodes/circleMode.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/editmodes/circleMode.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -105,7 +105,7 @@
 			primitiveModel.ringNumber = component.num;
 			primitiveFile = primitives()->getPrimitive(primitiveModel);
 			Matrix matrix = Matrix::fromRotationMatrix(renderer()->currentCamera().transformationMatrix(component.scale));
-			model.emplace<LDSubfileReference>(primitiveFile, matrix, m_drawedVerts.first());
+			model.append<LDSubfileReference>(primitiveFile, matrix, m_drawedVerts.first());
 		}
 	}
 	else
@@ -139,7 +139,7 @@
 			v3.setCoordinate (localx, v3[localx] + c1[i].x1());
 			v3.setCoordinate (localy, v3[localy] + c1[i].y1());
 
-			LDQuadrilateral* quad = model.emplace<LDQuadrilateral>(v0, v1, v2, v3);
+			LDQuadrilateral* quad = model.append<LDQuadrilateral>(v0, v1, v2, v3);
 			quad->setColor(MainColor);
 
 			// Ensure the quads always are BFC-front towards the camera
@@ -149,7 +149,7 @@
 	}
 
 	if (circleOrDisc and primitiveFile)
-		model.emplace<LDSubfileReference>(primitiveFile, transform, m_drawedVerts.first());
+		model.append<LDSubfileReference>(primitiveFile, transform, m_drawedVerts.first());
 
 	finishDraw (model);
 }
--- a/src/editmodes/curvemode.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/editmodes/curvemode.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -87,7 +87,7 @@
 	if (countof(m_drawedVerts) == 4)
 	{
 		Model model {m_documents};
-		model.emplace<LDBezierCurve>(m_drawedVerts[0], m_drawedVerts[1], m_drawedVerts[2], m_drawedVerts[3]);
+		model.append<LDBezierCurve>(m_drawedVerts[0], m_drawedVerts[1], m_drawedVerts[2], m_drawedVerts[3]);
 		finishDraw(model);
 	}
 }
--- a/src/editmodes/drawMode.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/editmodes/drawMode.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -74,15 +74,15 @@
 	{
 	    case 2:
 			// 2 verts - make a line
-		    model.emplace<LDEdgeLine>(verts[0], verts[1]);
+		    model.append<LDEdgeLine>(verts[0], verts[1]);
 		    break;
 
 		case 3:
 		case 4:
 		{
 		    LDObject* obj = (countof(verts) == 3) ?
-			            static_cast<LDObject*>(model.emplace<LDTriangle>()) :
-			            static_cast<LDObject*>(model.emplace<LDQuadrilateral>());
+			            static_cast<LDObject*>(model.append<LDTriangle>()) :
+			            static_cast<LDObject*>(model.append<LDQuadrilateral>());
 
 			for (int i = 0; i < countof(verts); ++i)
 				obj->setVertex (i, verts[i]);
--- a/src/editmodes/linePathMode.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/editmodes/linePathMode.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -84,7 +84,7 @@
 	Model model {m_documents};
 
 	for (int i = 0; i < countof(m_drawedVerts) - 1; ++i)
-		model.emplace<LDEdgeLine>(m_drawedVerts[i], m_drawedVerts[i + 1]);
+		model.append<LDEdgeLine>(m_drawedVerts[i], m_drawedVerts[i + 1]);
 
 	finishDraw(model);
 }
--- a/src/editmodes/rectangleMode.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/editmodes/rectangleMode.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -43,7 +43,7 @@
 	if (countof(m_drawedVerts) == 2)
 	{
 		Model model {m_documents};
-		LDQuadrilateral* quad = model.emplace<LDQuadrilateral>();
+		LDQuadrilateral* quad = model.append<LDQuadrilateral>();
 		updateRectVerts();
 
 		for (int i = 0; i < quad->numVertices(); ++i)
--- a/src/lddocument.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/lddocument.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -281,7 +281,7 @@
 			if (fileInfo)
 				reference->setFileInfo (fileInfo);
 			else
-				emplaceReplacement<LDError>(reference, reference->asText(), format("Could not open %1", reference->fileInfo()->name()));
+				replace<LDError>(reference, reference->asText(), format("Could not open %1", reference->fileInfo()->name()));
 		}
 
 		// Reparse gibberish files. It could be that they are invalid because
@@ -433,7 +433,7 @@
 		if (deep and object->type() == LDObjectType::SubfileReference)
 			static_cast<LDSubfileReference*>(object)->inlineContents(model, deep, renderinline);
 		else
-			model.addFromString(object->asText());
+			model.appendFromString(object->asText());
 	}
 }
 
--- a/src/linetypes/conditionaledge.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/linetypes/conditionaledge.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -52,7 +52,7 @@
 
 LDEdgeLine* LDConditionalEdge::becomeEdgeLine()
 {
-	LDEdgeLine* replacement = model()->emplaceReplacement<LDEdgeLine>(this);
+	LDEdgeLine* replacement = model()->replace<LDEdgeLine>(this);
 
 	if (replacement)
 	{
--- a/src/linetypes/modelobject.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/linetypes/modelobject.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -443,7 +443,7 @@
 	}
 
 	// Not inverted, thus prefix it with a new invertnext.
-	this->model()->emplaceAt<LDBfc>(idx, BfcStatement::InvertNext);
+	this->model()->insert<LDBfc>(idx, BfcStatement::InvertNext);
 }
 
 // =============================================================================
@@ -625,7 +625,7 @@
 
 	for (LDPolygon& poly : polygons)
 	{
-		LDEdgeLine* line = model.emplace<LDEdgeLine>(poly.vertices[0], poly.vertices[1]);
+		LDEdgeLine* line = model.append<LDEdgeLine>(poly.vertices[0], poly.vertices[1]);
 		line->setColor (poly.color);
 	}
 }
--- a/src/model.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/model.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -316,7 +316,7 @@
 		if (countof(tokens) <= 0)
 		{
 			// Line was empty, or only consisted of whitespace
-			return emplaceAt<LDEmpty>(position);
+			return insert<LDEmpty>(position);
 		}
 
 		if (countof(tokens[0]) != 1 or not tokens[0][0].isDigit())
@@ -338,18 +338,18 @@
 					for (BfcStatement statement : iterateEnum<BfcStatement>())
 					{
 						if (commentTextSimplified == format("BFC %1", LDBfc::statementToString (statement)))
-							return emplaceAt<LDBfc>(position, statement);
+							return insert<LDBfc>(position, statement);
 					}
 
 					// MLCAD is notorious for stuffing these statements in parts it
 					// creates. The above block only handles valid statements, so we
 					// need to handle MLCAD-style invertnext, clip and noclip separately.
 					if (commentTextSimplified == "BFC CERTIFY INVERTNEXT")
-						return emplaceAt<LDBfc>(position, BfcStatement::InvertNext);
+						return insert<LDBfc>(position, BfcStatement::InvertNext);
 					else if (commentTextSimplified == "BFC CERTIFY CLIP")
-						return emplaceAt<LDBfc>(position, BfcStatement::Clip);
+						return insert<LDBfc>(position, BfcStatement::Clip);
 					else if (commentTextSimplified == "BFC CERTIFY NOCLIP")
-						return emplaceAt<LDBfc>(position, BfcStatement::NoClip);
+						return insert<LDBfc>(position, BfcStatement::NoClip);
 				}
 
 				if (countof(tokens) > 2 and tokens[1] == "!LDFORGE")
@@ -359,7 +359,7 @@
 					{
 						CheckTokenCount (tokens, 16);
 						CheckTokenNumbers (tokens, 3, 15);
-						LDBezierCurve* obj = emplaceAt<LDBezierCurve>(position);
+						LDBezierCurve* obj = insert<LDBezierCurve>(position);
 						obj->setColor (StringToNumber (tokens[3]));
 
 						for (int i = 0; i < 4; ++i)
@@ -370,7 +370,7 @@
 				}
 
 				// Just a regular comment:
-				return emplaceAt<LDComment>(position, commentText);
+				return insert<LDComment>(position, commentText);
 		    }
 
 		    case 1:
@@ -384,7 +384,7 @@
 				// here because the error object needs the document reference.
 				if (not document)
 				{
-					LDError* obj = emplaceAt<LDError>(position, line, format ("Could not open %1", tokens[14]));
+					LDError* obj = insert<LDError>(position, line, format ("Could not open %1", tokens[14]));
 					obj->setFileReferenced (tokens[14]);
 					return obj;
 				}
@@ -395,7 +395,7 @@
 				for (int i = 0; i < 9; ++i)
 					transform.value(i) = tokens[i + 5].toDouble(); // 5 - 13
 
-				LDSubfileReference* obj = emplaceAt<LDSubfileReference>(position, document, transform, referncePosition);
+				LDSubfileReference* obj = insert<LDSubfileReference>(position, document, transform, referncePosition);
 				obj->setColor (StringToNumber (tokens[1]));
 				return obj;
 		    }
@@ -406,7 +406,7 @@
 				CheckTokenNumbers (tokens, 1, 7);
 
 				// Line
-				LDEdgeLine* obj = emplaceAt<LDEdgeLine>(position);
+				LDEdgeLine* obj = insert<LDEdgeLine>(position);
 				obj->setColor (StringToNumber (tokens[1]));
 
 				for (int i = 0; i < 2; ++i)
@@ -421,7 +421,7 @@
 				CheckTokenNumbers (tokens, 1, 10);
 
 				// Triangle
-				LDTriangle* obj = emplaceAt<LDTriangle>(position);
+				LDTriangle* obj = insert<LDTriangle>(position);
 				obj->setColor (StringToNumber (tokens[1]));
 
 				for (int i = 0; i < 3; ++i)
@@ -440,9 +440,9 @@
 				LDObject* obj;
 
 				if (num == 4)
-					obj = emplaceAt<LDQuadrilateral>(position);
+					obj = insert<LDQuadrilateral>(position);
 				else
-					obj = emplaceAt<LDConditionalEdge>(position);
+					obj = insert<LDConditionalEdge>(position);
 
 				obj->setColor (StringToNumber (tokens[1]));
 
@@ -459,14 +459,14 @@
 	catch (QString& errorMessage)
 	{
 		// Strange line we couldn't parse
-		return emplaceAt<LDError>(position, line, errorMessage);
+		return insert<LDError>(position, line, errorMessage);
 	}
 }
 
 /*
  * Given an LDraw object string, parses it and inserts it into the model.
  */
-LDObject* Model::addFromString(QString line)
+LDObject* Model::appendFromString(QString line)
 {
 	return insertFromString(size(), line);
 }
--- a/src/model.h	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/model.h	Sun Mar 05 16:50:06 2017 +0200
@@ -36,12 +36,12 @@
 	Model(const Model& other) = delete;
 
 	bool swapObjects(LDObject* one, LDObject* other);
-	template<typename T, typename... Args> T* emplace(Args&& ...args);
-	template<typename T, typename... Args> T* emplaceAt(int position, Args&& ...args);
-	template<typename T, typename... Args> T* emplaceReplacement(LDObject* object, Args&& ...args);
+	template<typename T, typename... Args> T* append(Args&& ...args);
+	template<typename T, typename... Args> T* insert(int position, Args&& ...args);
+	template<typename T, typename... Args> T* replace(LDObject* object, Args&& ...args);
 	void removeAt(int position);
 	void remove(LDObject* object);
-	void replace(LDObject *object, Model& model);
+	void replace(LDObject* object, Model& model);
 	void clear();
 	void merge(Model& other, int position = -1, Filter filter = nullptr, Callback callback = nullptr);
 	int size() const;
@@ -54,7 +54,7 @@
 	bool isEmpty() const;
 	class DocumentManager* documentManager() const;
 	LDObject* insertFromString(int position, QString line);
-	LDObject* addFromString(QString line);
+	LDObject* appendFromString(QString line);
 	LDObject* replaceWithFromString(LDObject* object, QString line);
 
 signals:
@@ -89,10 +89,10 @@
  *
  * This constructor can be invoked as such:
  *
- *     model->emplace<LDLine>(v1, v2);
+ *     model->append<LDLine>(v1, v2);
  */
 template<typename T, typename... Args>
-T* Model::emplace(Args&& ...args)
+T* Model::append(Args&& ...args)
 {
 	T* object = _objects.append<T>(args..., this);
 	finalizeNewObject(size() - 1, object);
@@ -100,11 +100,11 @@
 }
 
 /*
- * Like emplace<>() but also takes a position as the first argument and emplaces the object at the given position instead of the
+ * Like append<>() but also takes a position as the first argument and emplaces the object at the given position instead of the
  * end of the model.
  */
 template<typename T, typename... Args>
-T* Model::emplaceAt(int position, Args&& ...args)
+T* Model::insert(int position, Args&& ...args)
 {
 	T* object = _objects.insert<T>(position, args..., this);
 	finalizeNewObject(position, object);
@@ -112,11 +112,11 @@
 }
 
 /*
- * Like emplace<>() but instead of inserting the constructed object, the new object replaces the object given in the first parameter.
+ * Like append<>() but instead of inserting the constructed object, the new object replaces the object given in the first parameter.
  * If the old object cannot be replaced, the new object will not be constructed at all.
  */
 template<typename T, typename... Args>
-T* Model::emplaceReplacement(LDObject* object, Args&& ...args)
+T* Model::replace(LDObject* object, Args&& ...args)
 {
 	if (object->model() == this)
 	{
--- a/src/primitives.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/primitives.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -267,7 +267,7 @@
 		{
 		case Circle:
 		    {
-			    LDEdgeLine* line = model.emplace<LDEdgeLine>();
+			    LDEdgeLine* line = model.append<LDEdgeLine>();
 				line->setVertex(0, Vertex {x0, 0.0f, z0});
 				line->setVertex(1, Vertex {x1, 0.0f, z1});
 				line->setColor(EdgeColor);
@@ -316,7 +316,7 @@
 				Vertex v1 = {x1, y1, z1};
 				Vertex v2 = {x2, y2, z2};
 				Vertex v3 = {x3, y3, z3};
-				LDQuadrilateral* quad = model.emplace<LDQuadrilateral>(v0, v1, v2, v3);
+				LDQuadrilateral* quad = model.append<LDQuadrilateral>(v0, v1, v2, v3);
 				quad->setColor(MainColor);
 
 				if (type == Cylinder)
@@ -348,7 +348,7 @@
 
 				// Disc negatives need to go the other way around, otherwise
 				// they'll end up upside-down.
-				LDTriangle* segment = model.emplace<LDTriangle>();
+				LDTriangle* segment = model.append<LDTriangle>();
 				segment->setColor(MainColor);
 				segment->setVertex(type == Disc ? 0 : 2, v0);
 				segment->setVertex(1, v1);
@@ -380,7 +380,7 @@
 			v0 = {v0[X] * ringNumber, 1.0, v0[Z] * ringNumber};
 		}
 
-		LDConditionalEdge* line = model.emplace<LDConditionalEdge>();
+		LDConditionalEdge* line = model.append<LDConditionalEdge>();
 		line->setColor(EdgeColor);
 		line->setVertex(0, v0);
 		line->setVertex(1, v1);
@@ -480,14 +480,14 @@
 
 	document->setFrozen(false);
 	document->history()->setIgnoring(false);
-	document->emplace<LDComment>(description);
-	document->emplace<LDComment>(format("Name: %1", fileName));
-	document->emplace<LDComment>(format("Author: %1", author));
-	document->emplace<LDComment>(format("!LDRAW_ORG Unofficial_%1Primitive", hires ?  "48_" : ""));
-	document->emplace<LDComment>(license);
-	document->emplace<LDEmpty>();
-	document->emplace<LDBfc>(BfcStatement::CertifyCCW);
-	document->emplace<LDEmpty>();
+	document->append<LDComment>(description);
+	document->append<LDComment>(format("Name: %1", fileName));
+	document->append<LDComment>(format("Author: %1", author));
+	document->append<LDComment>(format("!LDRAW_ORG Unofficial_%1Primitive", hires ?  "48_" : ""));
+	document->append<LDComment>(license);
+	document->append<LDEmpty>();
+	document->append<LDBfc>(BfcStatement::CertifyCCW);
+	document->append<LDEmpty>();
 	spec.generateBody(*document);
 	document->addHistoryStep();
 	return document;
--- a/src/toolsets/algorithmtoolset.cpp	Sun Mar 05 16:47:52 2017 +0200
+++ b/src/toolsets/algorithmtoolset.cpp	Sun Mar 05 16:50:06 2017 +0200
@@ -72,8 +72,8 @@
 		// │   │  --→  │╱    ╱  │
 		// 1───2       1    1───2
 		Model replacement {m_documents};
-		LDTriangle* triangle1 = replacement.emplace<LDTriangle>(v0, v1, v3);
-		LDTriangle* triangle2 = replacement.emplace<LDTriangle>(v1, v2, v3);
+		LDTriangle* triangle1 = replacement.append<LDTriangle>(v0, v1, v3);
+		LDTriangle* triangle2 = replacement.append<LDTriangle>(v1, v2, v3);
 
 		// The triangles also inherit the quad's color
 		triangle1->setColor(object->color());
@@ -129,17 +129,17 @@
 		if (type == LDObjectType::Quadrilateral)
 		{
 			LDQuadrilateral* quad = static_cast<LDQuadrilateral*>(object);
-			lines.emplace<LDEdgeLine>(quad->vertex (0), quad->vertex (1));
-			lines.emplace<LDEdgeLine>(quad->vertex (1), quad->vertex (2));
-			lines.emplace<LDEdgeLine>(quad->vertex (2), quad->vertex (3));
-			lines.emplace<LDEdgeLine>(quad->vertex (3), quad->vertex (0));
+			lines.append<LDEdgeLine>(quad->vertex (0), quad->vertex (1));
+			lines.append<LDEdgeLine>(quad->vertex (1), quad->vertex (2));
+			lines.append<LDEdgeLine>(quad->vertex (2), quad->vertex (3));
+			lines.append<LDEdgeLine>(quad->vertex (3), quad->vertex (0));
 		}
 		else
 		{
 			LDTriangle* triangle = static_cast<LDTriangle*>(object);
-			lines.emplace<LDEdgeLine>(triangle->vertex (0), triangle->vertex (1));
-			lines.emplace<LDEdgeLine>(triangle->vertex (1), triangle->vertex (2));
-			lines.emplace<LDEdgeLine>(triangle->vertex (2), triangle->vertex (0));
+			lines.append<LDEdgeLine>(triangle->vertex (0), triangle->vertex (1));
+			lines.append<LDEdgeLine>(triangle->vertex (1), triangle->vertex (2));
+			lines.append<LDEdgeLine>(triangle->vertex (2), triangle->vertex (0));
 		}
 
 		count += countof(lines.objects());
@@ -363,7 +363,7 @@
 	int idx = obj ? obj->lineNumber() : 0;
 
 	// Create the comment object based on input
-	currentDocument()->emplaceAt<LDComment>(idx++, format("!HISTORY %1 [%2] %3",
+	currentDocument()->insert<LDComment>(idx++, format("!HISTORY %1 [%2] %3",
 	    ui.m_date->date().toString ("yyyy-MM-dd"),
 	    ui.m_username->text(),
 	    ui.m_comment->text()));
@@ -371,7 +371,7 @@
 	// If we're adding a history line right before a scemantic object, pad it
 	// an empty line
 	if (obj and obj->next() and obj->next()->isScemantic())
-		currentDocument()->emplaceAt<LDEmpty>(idx);
+		currentDocument()->insert<LDEmpty>(idx);
 
 	m_window->buildObjectList();
 }
@@ -412,9 +412,9 @@
 			});
 
 			if (obj->type() == LDObjectType::EdgeLine)
-				segments.emplace<LDEdgeLine>(v0, v1);
+				segments.append<LDEdgeLine>(v0, v1);
 			else
-				segments.emplace<LDConditionalEdge>(v0, v1, obj->vertex (2), obj->vertex (3));
+				segments.append<LDConditionalEdge>(v0, v1, obj->vertex (2), obj->vertex (3));
 		}
 
 		currentDocument()->replace(obj, segments);
@@ -513,23 +513,23 @@
 	subfile->setName(LDDocument::shortenName(fullSubfileName));
 
 	Model header {m_documents};
-	header.emplace<LDComment>(subfileTitle);
-	header.emplace<LDComment>("Name: "); // This gets filled in when the subfile is saved
-	header.emplace<LDComment>(format("Author: %1 [%2]", m_config->defaultName(), m_config->defaultUser()));
-	header.emplace<LDComment>("!LDRAW_ORG Unofficial_Subpart");
+	header.append<LDComment>(subfileTitle);
+	header.append<LDComment>("Name: "); // This gets filled in when the subfile is saved
+	header.append<LDComment>(format("Author: %1 [%2]", m_config->defaultName(), m_config->defaultUser()));
+	header.append<LDComment>("!LDRAW_ORG Unofficial_Subpart");
 
 	QString license = preferredLicenseText();
 	if (not license.isEmpty())
-		header.emplace<LDComment>(license);
+		header.append<LDComment>(license);
 
-	header.emplace<LDEmpty>();
-	header.emplace<LDBfc>(winding);
-	header.emplace<LDEmpty>();
+	header.append<LDEmpty>();
+	header.append<LDBfc>(winding);
+	header.append<LDEmpty>();
 	subfile->merge(header);
 
 	// Copy the body over to the new document
 	for (LDObject* object : selectedObjects())
-		subfile->addFromString(object->asText());
+		subfile->appendFromString(object->asText());
 
 	// Try save it
 	if (m_window->save(subfile, true))
@@ -544,7 +544,7 @@
 			currentDocument()->remove(object);
 
 		// Add a reference to the new subfile to where the selection was
-		currentDocument()->emplaceAt<LDSubfileReference>(referencePosition, subfile, Matrix::identity, Vertex {0, 0, 0});
+		currentDocument()->insert<LDSubfileReference>(referencePosition, subfile, Matrix::identity, Vertex {0, 0, 0});
 
 		// Refresh stuff
 		m_window->updateDocumentList();

mercurial