on xenial help sign in
Only activate scope:// uris, the rest is previewed
5bcdb5dAlbert Astals
qml/Dash/CardCarousel.qml+1−1
@@ -49,7 +49,7 @@ DashRenderer {
49 objectName: "carouselDelegate" + index
49 objectName: "carouselDelegate" + index
50
50
51 function clicked() { cardCarousel.clicked(index, model.result, loader.item, model) }
51 function clicked() { cardCarousel.clicked(index, model.result, loader.item, model) }
52− function pressAndHold() { cardCarousel.pressAndHold(index) }
52+ function pressAndHold() { cardCarousel.pressAndHold(index, model) }
53
53
54 sourceComponent: cardTool.cardComponent
54 sourceComponent: cardTool.cardComponent
55 onLoaded: {
55 onLoaded: {
qml/Dash/CardGrid.qml+1−1
@@ -74,7 +74,7 @@ DashRenderer {
74 Connections {
74 Connections {
75 target: loader.item
75 target: loader.item
76 onClicked: root.clicked(index, result, loader.item, model)
76 onClicked: root.clicked(index, result, loader.item, model)
77− onPressAndHold: root.pressAndHold(index)
77+ onPressAndHold: root.pressAndHold(index, model)
78 }
78 }
79 }
79 }
80 }
80 }
qml/Dash/CardVerticalJournal.qml+1−1
@@ -62,7 +62,7 @@ DashRenderer {
62 Connections {
62 Connections {
63 target: loader.item
63 target: loader.item
64 onClicked: root.clicked(index, result, loader.item, model)
64 onClicked: root.clicked(index, result, loader.item, model)
65− onPressAndHold: root.pressAndHold(index)
65+ onPressAndHold: root.pressAndHold(index, model)
66 }
66 }
67 }
67 }
68 }
68 }
qml/Dash/DashRenderer.qml+2−1
@@ -47,5 +47,6 @@ Item {
47
47
48 /// Emitted when the user pressed and held on an item
48 /// Emitted when the user pressed and held on an item
49 /// @param index is the index of the held item
49 /// @param index is the index of the held item
50+ /// @param itemModel model of the item
50− signal pressAndHold(int index)
51+ signal pressAndHold(int index, var itemModel)
51}
52}
qml/Dash/GenericScopeView.qml+4−5
@@ -243,10 +243,7 @@ FocusScope {
243 return;
243 return;
244 }
244 }
245
245
246− if (scopeView.scope.id === "scopes" || scopeView.scope.id == "clickscope") {
246+ if (itemModel.uri.indexOf("scope://") === 0) {
247− // TODO Technically it is possible that calling activate() will make the scope emit
248− // previewRequested so that we show a preview but there's no scope that does that yet
249− // so it's not implemented
250 scopeView.scope.activate(result)
247 scopeView.scope.activate(result)
251 } else {
248 } else {
252 openPreview(index);
249 openPreview(index);
@@ -257,7 +254,9 @@ FocusScope {
257 if (scopeView.pressAndHoldOverride) {
254 if (scopeView.pressAndHoldOverride) {
258 scopeView.pressAndHoldOverride(index);
255 scopeView.pressAndHoldOverride(index);
259 } else {
256 } else {
257+ if (itemModel.uri.indexOf("scope://") !== 0) {
260− openPreview(index)
258+ openPreview(index)
259+ }
261 }
260 }
262 }
261 }
263
262