on xenial help sign in
Do not use the same filepath parameter for all the card creator createQmlObject calls

Seems that something deep down in Qt is deciding that if the filepath is the same the qmlcomponent has to be the same and we get weird errors like the fallback of one category showing up at the fallback of other Fixes: #1536379 Approved by: Michał Sawicz

commita78e41b52afafbecbc85375d0aaf4e9bcf400416 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 29 Jan 2016, 11:52 (11 years ago) parentfebe07a65de3d7
2 files changed+3−3
plugins/Dash/CardCreator.js+2−2 plugins/Dash/CardCreatorCache.qml+1−1
plugins/Dash/CardCreator.js+2−2
@@ -825,7 +825,7 @@ function cardString(template, components) {
825825 return code;
826826}
827827
828−function createCardComponent(parent, template, components) {
828+function createCardComponent(parent, template, components, identifier) {
829829 var imports = 'import QtQuick 2.4; \n\
830830 import Ubuntu.Components 1.3; \n\
831831 import Ubuntu.Settings.Components 0.1; \n\
@@ -835,7 +835,7 @@ function createCardComponent(parent, template, components) {
835835 var code = imports + 'Component {\n' + card + '}\n';
836836
837837 try {
838− return Qt.createQmlObject(code, parent, "createCardComponent");
838+ return Qt.createQmlObject(code, parent, identifier);
839839 } catch (e) {
840840 console.error("ERROR: Invalid component created.");
841841 console.error("Template:");
plugins/Dash/CardCreatorCache.qml+1−1
@@ -32,7 +32,7 @@ QtObject {
3232 var allString = tString + cString;
3333 var component = cache[allString];
3434 if (component === undefined) {
35− component = CardCreator.createCardComponent(root, template, components);
35+ component = CardCreator.createCardComponent(root, template, components, allString);
3636 cache[allString] = component;
3737 }
3838 return component;