@@ -67,24 +67,28 @@ FocusScope {
67 subPageLoader.closeSubPage()
67 subPageLoader.closeSubPage()
70+ property var maybePreviewResult;
71+ property var maybePreviewIndex;
72+ property var maybePreviewResultsModel;
73+ property var maybePreviewLimitedCategoryItemCount;
70− function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
75+ function itemClicked(index, result, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
71− if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope" || (scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
76+ scopeView.maybePreviewResult = result;
72− // TODO Technically it is possible that calling activate() will make the scope emit
77+ scopeView.maybePreviewIndex = index;
73− // previewRequested so that we show a preview but there's no scope that does that yet
78+ scopeView.maybePreviewResultsModel = resultsModel;
74− // so it's not implemented
79+ scopeView.maybePreviewLimitedCategoryItemCount = limitedCategoryItemCount;
75− scope.activate(result)
81+ scope.activate(result, categoryId);
77− if (scope.preview(result)) {
78− openPreview(index, resultsModel, limitedCategoryItemCount);
83− function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
84+ function itemPressedAndHeld(index, result, resultsModel, limitedCategoryItemCount, categoryId) {
84− if (itemModel.uri.indexOf("scope://") !== 0 && !(scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
85+ scopeView.maybePreviewResult = undefined;
86+ scopeView.maybePreviewIndex = undefined;
87+ scopeView.maybePreviewResultsModel = undefined;
88+ scopeView.maybePreviewLimitedCategoryItemCount = undefined;
85− if (scope.preview(result)) {
90+ if (scope.preview(result, categoryId)) {
86− openPreview(index, resultsModel, limitedCategoryItemCount);
91+ openPreview(index, resultsModel, limitedCategoryItemCount);
@@ -144,6 +148,15 @@ FocusScope {
144 target: scopeView.scope
148 target: scopeView.scope
145 onShowDash: subPageLoader.closeSubPage()
149 onShowDash: subPageLoader.closeSubPage()
146 onHideDash: subPageLoader.closeSubPage()
150 onHideDash: subPageLoader.closeSubPage()
151+ onPreviewRequested: { // (QVariant const& result)
152+ if (result === scopeView.maybePreviewResult) {
153+ scopeView.maybePreviewResult = undefined;
154+ openPreview(scopeView.maybePreviewIndex, scopeView.maybePreviewResultsModel, scopeView.maybePreviewLimitedCategoryItemCount);
155+ scopeView.maybePreviewIndex = undefined;
156+ scopeView.maybePreviewResultsModel = undefined;
157+ scopeView.maybePreviewLimitedCategoryItemCount = undefined;
149 Connections {
162 Connections {
@@ -345,12 +358,12 @@ FocusScope {
346 Connections {
359 Connections {
347 target: rendererLoader.item
360 target: rendererLoader.item
348− onClicked: {
361+ onClicked: { // (int index, var result, var item, var itemModel)
349− scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount(), baseItem.category);
362+ scopeView.itemClicked(index, result, itemModel, target.model, categoryItemCount(), baseItem.category);
352− onPressAndHold: {
365+ onPressAndHold: { // (int index, var result, var itemModel)
353− scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount(), baseItem.category);
366+ scopeView.itemPressedAndHeld(index, result, target.model, categoryItemCount(), baseItem.category);
356 function categoryItemCount() {
369 function categoryItemCount() {