src/toolsets/algorithmtoolset.cpp

changeset 971
c00f9665a9f8
parent 970
c8aae45afd85
child 972
a34b73114823
--- a/src/toolsets/algorithmtoolset.cpp	Mon Aug 31 04:57:16 2015 +0300
+++ b/src/toolsets/algorithmtoolset.cpp	Mon Aug 31 20:50:12 2015 +0300
@@ -158,14 +158,14 @@
 			Vertex v = mo->position();
 			Matrix t = mo->transform();
 
-			v.apply ([](Axis, double& a)
+			v.apply ([&](Axis, double& a)
 			{
-				RoundToDecimals (a, m_config->roundPositionPrecision);
+				RoundToDecimals (a, m_config->roundPositionPrecision());
 			});
 
-			ApplyToMatrix (t, [](int, double& a)
+			ApplyToMatrix (t, [&](int, double& a)
 			{
-				RoundToDecimals (a, m_config->roundMatrixPrecision);
+				RoundToDecimals (a, m_config->roundMatrixPrecision());
 			});
 
 			mo->setPosition (v);
@@ -177,9 +177,9 @@
 			for (int i = 0; i < obj->numVertices(); ++i)
 			{
 				Vertex v = obj->vertex (i);
-				v.apply ([](Axis, double& a)
+				v.apply ([&](Axis, double& a)
 				{
-					RoundToDecimals (a, m_config->roundPositionPrecision);
+					RoundToDecimals (a, m_config->roundPositionPrecision());
 				});
 				obj->setVertex (i, v);
 				num += 3;
@@ -332,7 +332,7 @@
 	QDialog* dlg = new QDialog;
 	Ui_AddHistoryLine* ui = new Ui_AddHistoryLine;
 	ui->setupUi (dlg);
-	ui->m_username->setText (m_config->defaultUser);
+	ui->m_username->setText (m_config->defaultUser());
 	ui->m_date->setDate (QDate::currentDate());
 	ui->m_comment->setFocus();
 
@@ -377,13 +377,12 @@
 {
 	bool ok;
 	int segments = QInputDialog::getInt (m_window, APPNAME, "Amount of segments:",
-		m_window->config (m_config->splitLinesSegments), 0,
-		std::numeric_limits<int>::max(), 1, &ok);
+		m_config->splitLinesSegments(), 0, std::numeric_limits<int>::max(), 1, &ok);
 
 	if (not ok)
 		return;
 
-	m_config->splitLinesSegments = segments;
+	m_config->setSplitLinesSegments (segments);
 
 	for (LDObject* obj : Selection())
 	{
@@ -544,7 +543,7 @@
 	LDObjectList objs;
 	objs << LDSpawn<LDComment> (subtitle);
 	objs << LDSpawn<LDComment> ("Name: "); // This gets filled in when the subfile is saved
-	objs << LDSpawn<LDComment> (format ("Author: %1 [%2]", m_config->defaultName, m_config->defaultUser));
+	objs << LDSpawn<LDComment> (format ("Author: %1 [%2]", m_config->defaultName(), m_config->defaultUser()));
 	objs << LDSpawn<LDComment> ("!LDRAW_ORG Unofficial_Subpart");
 
 	if (not license.isEmpty())

mercurial