on xenial help sign in
Fix previews being requested when calling activate

If we assign previewListView a model, it'll call preview() on it and since activate() is not for previews that is unneeded. There's a way for scopes to request a preview though, but none implements it yet, so added it as TODO

commita21122817120174c1b50c8167e98b790e8be9ed7 authorAlbert Astals <albert.astals@canonical.com> dateMon 24 Feb 2014, 13:33 (13 years ago) parentb6cff45
1 file changed+7−7
qml/Dash/GenericScopeView.qml+7−7
qml/Dash/GenericScopeView.qml+7−7
@@ -191,16 +191,16 @@ FocusScope {
191191 Connections {
192192 target: rendererLoader.item
193193 onClicked: {
194− // Prepare the preview in case activate() triggers a preview only
195− previewListView.model = target.model;
196− previewListView.currentIndex = -1
197− previewListView.currentIndex = index;
198−
199− var item = target.model.get(index);
200−
201194 if (scopeView.scope.id === "scopes" || (scopeView.scope.id == "clickscope" && categoryId == "local")) {
195+ // TODO Techincally it is possible that calling activate() will make the scope emit
196+ // previewRequested so that we show a preview but there's no scope that does that yet
197+ // so it's not implemented
198+ var item = target.model.get(index);
202199 scopeView.scope.activate(item.result)
203200 } else {
201+ previewListView.model = target.model;
202+ previewListView.currentIndex = -1
203+ previewListView.currentIndex = index;
204204 previewListView.open = true
205205 }
206206 }