on xenial help sign in
Only activate scope:// uris, the rest is previewed

Also scope:// uris don't get a preview

commit5bcdb5db8f7a1289ff725a6094ea0514d2dfce66 authorAlbert Astals <albert.astals@canonical.com> dateTue 29 Jul 2014, 10:57 (12 years ago) parent7b9aa34
5 files changed+9−9
qml/Dash/CardCarousel.qml+1−1 qml/Dash/CardGrid.qml+1−1 qml/Dash/CardVerticalJournal.qml+1−1 qml/Dash/DashRenderer.qml+2−1 qml/Dash/GenericScopeView.qml+4−5
qml/Dash/CardCarousel.qml+1−1
@@ -49,7 +49,7 @@ DashRenderer {
4949 objectName: "carouselDelegate" + index
5050
5151 function clicked() { cardCarousel.clicked(index, model.result, loader.item, model) }
52− function pressAndHold() { cardCarousel.pressAndHold(index) }
52+ function pressAndHold() { cardCarousel.pressAndHold(index, model) }
5353
5454 sourceComponent: cardTool.cardComponent
5555 onLoaded: {
qml/Dash/CardGrid.qml+1−1
@@ -74,7 +74,7 @@ DashRenderer {
7474 Connections {
7575 target: loader.item
7676 onClicked: root.clicked(index, result, loader.item, model)
77− onPressAndHold: root.pressAndHold(index)
77+ onPressAndHold: root.pressAndHold(index, model)
7878 }
7979 }
8080 }
qml/Dash/CardVerticalJournal.qml+1−1
@@ -62,7 +62,7 @@ DashRenderer {
6262 Connections {
6363 target: loader.item
6464 onClicked: root.clicked(index, result, loader.item, model)
65− onPressAndHold: root.pressAndHold(index)
65+ onPressAndHold: root.pressAndHold(index, model)
6666 }
6767 }
6868 }
qml/Dash/DashRenderer.qml+2−1
@@ -47,5 +47,6 @@ Item {
4747
4848 /// Emitted when the user pressed and held on an item
4949 /// @param index is the index of the held item
50− signal pressAndHold(int index)
50+ /// @param itemModel model of the item
51+ signal pressAndHold(int index, var itemModel)
5152}
qml/Dash/GenericScopeView.qml+4−5
@@ -243,10 +243,7 @@ FocusScope {
243243 return;
244244 }
245245
246− if (scopeView.scope.id === "scopes" || scopeView.scope.id == "clickscope") {
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
246+ if (itemModel.uri.indexOf("scope://") === 0) {
250247 scopeView.scope.activate(result)
251248 } else {
252249 openPreview(index);
@@ -257,7 +254,9 @@ FocusScope {
257254 if (scopeView.pressAndHoldOverride) {
258255 scopeView.pressAndHoldOverride(index);
259256 } else {
260− openPreview(index)
257+ if (itemModel.uri.indexOf("scope://") !== 0) {
258+ openPreview(index)
259+ }
261260 }
262261 }
263262