Commit 3e034d3c authored by Martin Klapetek's avatar Martin Klapetek
Browse files

[Kickoff] Fix breadcrumb navigation

Workaround for ListModel not being able to store QVariant(QModelIndex)
values. Now it's stored in another model property. Makes the breadcrumb
navigation work again.

BUG: 328654
parent 9fc18c11
......@@ -93,6 +93,8 @@ Item {
Repeater {
model: ListModel {
id: crumbModel
// Array of the category indexes
property var indexes: []
}
Breadcrumb {
......@@ -162,8 +164,9 @@ Item {
model: Kickoff.ApplicationModel {}
} // VisualDataModel
function addBreadcrumb(modelIndex, title) {
crumbModel.append({"text": title, "modelIndex": modelIndex, "depth": crumbModel.count+1})
function addBreadcrumb(categoryIndex, title) {
crumbModel.append({"text": title, "depth": crumbModel.count+1})
crumbModel.indexes.push(categoryIndex);
}
PlasmaCore.Svg {
......
......@@ -42,15 +42,16 @@ Item {
enabled: crumbRoot.depth < crumbModel.count
onClicked: {
while (crumbModel.count > 0 &&
crumbRoot.depth < crumbModel.get(crumbModel.count-1).depth) {
// Remove all the breadcrumbs in front of the clicked one
while (crumbModel.count > 0 && crumbRoot.depth < crumbModel.get(crumbModel.count-1).depth) {
crumbModel.remove(crumbModel.count-1)
}
crumbModel.indexes.pop()
}
if (crumbRoot.root) {
applicationsView.newModelIndex = 0;
} else {
applicationsView.newModelIndex = model.modelIndex;
applicationsView.newModelIndex = crumbModel.indexes[index];
}
appViewScrollArea.state = "OutgoingRight";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment