Browse Source

Match table name with container type

The table name is used as the container type in the resulting metadata, so we need to use the container type string as table name correctly, or none of the profiles can be found.

Contributes to issue CURA-6096.
Ghostkeeper 3 years ago
parent
commit
034f62ea2c

+ 4 - 1
cura/Settings/DatabaseHandlers/IntentDatabaseHandler.py

@@ -1,3 +1,6 @@
+# Copyright (c) 2021 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
 from UM.Settings.SQLQueryFactory import SQLQueryFactory
 from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
 from UM.Settings.InstanceContainer import InstanceContainer
@@ -7,7 +10,7 @@ class IntentDatabaseHandler(DatabaseMetadataContainerController):
     """The Database handler for Intent containers"""
 
     def __init__(self) -> None:
-        super().__init__(SQLQueryFactory(table = "intents",
+        super().__init__(SQLQueryFactory(table = "intent",
                                          fields = {
                                              "id": "text",
                                              "name": "text",

+ 4 - 1
cura/Settings/DatabaseHandlers/QualityDatabaseHandler.py

@@ -1,3 +1,6 @@
+# Copyright (c) 2021 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
 from UM.Settings.SQLQueryFactory import SQLQueryFactory, metadata_type
 from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
 from UM.Settings.InstanceContainer import InstanceContainer
@@ -7,7 +10,7 @@ class QualityDatabaseHandler(DatabaseMetadataContainerController):
     """The Database handler for Quality containers"""
 
     def __init__(self):
-        super().__init__(SQLQueryFactory(table = "qualities",
+        super().__init__(SQLQueryFactory(table = "quality",
                                          fields = {
                                              "id": "text",
                                              "name": "text",

+ 4 - 1
cura/Settings/DatabaseHandlers/VariantDatabaseHandler.py

@@ -1,3 +1,6 @@
+# Copyright (c) 2021 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
 from UM.Settings.SQLQueryFactory import SQLQueryFactory
 from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
 from UM.Settings.InstanceContainer import InstanceContainer
@@ -7,7 +10,7 @@ class VariantDatabaseHandler(DatabaseMetadataContainerController):
     """The Database handler for Variant containers"""
 
     def __init__(self):
-        super().__init__(SQLQueryFactory(table = "variants",
+        super().__init__(SQLQueryFactory(table = "variant",
                                          fields = {
                                              "id": "text",
                                              "name": "text",