@@ -95,23 +95,25 @@ FocusScope {
9595 scopeView.maybePreviewLimitedCategoryItemCount = undefined;
9696 scopeView.maybePreviewCategoryId = "";
9797
98− if (scope.preview(result, categoryId)) {
99− openPreview(index, resultsModel, limitedCategoryItemCount, categoryId);
100− }
98+ openPreview(result, index, resultsModel, limitedCategoryItemCount, categoryId);
10199 }
102100
103− function openPreview(index, resultsModel, limitedCategoryItemCount, categoryId) {
104− if (limitedCategoryItemCount > 0) {
105− previewLimitModel.model = resultsModel;
106− previewLimitModel.limit = limitedCategoryItemCount;
107− subPageLoader.model = previewLimitModel;
108− } else {
109− subPageLoader.model = resultsModel;
101+ function openPreview(result, index, resultsModel, limitedCategoryItemCount, categoryId) {
102+ var previewStack = scope.preview(result, categoryId);
103+ if (previewStack) {
104+ if (limitedCategoryItemCount > 0) {
105+ previewLimitModel.model = resultsModel;
106+ previewLimitModel.limit = limitedCategoryItemCount;
107+ subPageLoader.model = previewLimitModel;
108+ } else {
109+ subPageLoader.model = resultsModel;
110+ }
111+ subPageLoader.initialIndex = -1;
112+ subPageLoader.initialIndex = index;
113+ subPageLoader.categoryId = categoryId;
114+ subPageLoader.previewStack = previewStack;
115+ subPageLoader.openSubPage("preview");
110116 }
111− subPageLoader.initialIndex = -1;
112− subPageLoader.initialIndex = index;
113− subPageLoader.categoryId = categoryId;
114− subPageLoader.openSubPage("preview");
115117 }
116118
117119 Binding {
@@ -159,7 +161,8 @@ FocusScope {
159161 onHideDash: subPageLoader.closeSubPage()
160162 onPreviewRequested: { // (QVariant const& result)
161163 if (result === scopeView.maybePreviewResult) {
162− openPreview(scopeView.maybePreviewIndex,
164+ openPreview(result,
165+ scopeView.maybePreviewIndex,
163166 scopeView.maybePreviewResultsModel,
164167 scopeView.maybePreviewLimitedCategoryItemCount,
165168 scopeView.maybePreviewCategoryId);
@@ -758,6 +761,7 @@ FocusScope {
758761 property var scope: scopeView.scope
759762 property var scopeStyle: scopeView.scopeStyle
760763 property int initialIndex: -1
764+ property var previewStack;
761765 property string categoryId
762766 property var model: null
763767
@@ -791,6 +795,8 @@ FocusScope {
791795 item.initialIndex = Qt.binding(function() { return subPageLoader.initialIndex; } )
792796 item.model = Qt.binding(function() { return subPageLoader.model; } )
793797 item.categoryId = Qt.binding(function() { return subPageLoader.categoryId; } )
798+ item.initialIndexPreviewStack = subPageLoader.previewStack;
799+ subPageLoader.previewStack = null;
794800 }
795801 open = true;
796802 }