src/libraries.cpp

changeset 205
1a4342d80de7
parent 201
5d201ee4a9c3
child 218
63125c36de73
--- a/src/libraries.cpp	Wed Jun 08 19:33:00 2022 +0300
+++ b/src/libraries.cpp	Wed Jun 08 20:41:21 2022 +0300
@@ -220,16 +220,20 @@
  * @param errors Where to stream any encountered errors
  * @return color table
  */
-ldraw::ColorTable LibraryManager::loadColorTable(QTextStream& errors) const
+ColorTable LibraryManager::loadColorTable(QTextStream& errors) const
 {
-	ldraw::ColorTable result;
+	ColorTable result;
 	for (const Library& library : this->libraries)
 	{
 		const QString path = library.path.filePath("LDConfig.ldr");
 		QFile file{path};
 		if (file.open(QIODevice::ReadOnly | QIODevice::Text))
 		{
-			(void) result.load(file, errors);
+			const auto loadedTable = ::loadColorTable(file, errors);
+			if (loadedTable) {
+				result = std::move(*loadedTable);
+			}
+			break;
 		}
 	}
 	return result;

mercurial