on xenial help sign in
Search history is now persistent across all scopes and remains in QML. Fixes: https://bugs.launchpad.net/bugs/1226221.
16cade2Nicolas d'Offay
Components/PageHeader.qml+1−1
@@ -30,7 +30,7 @@ Item {
30
30
31 property bool searchEntryEnabled: false
31 property bool searchEntryEnabled: false
32 property alias searchQuery: searchField.text
32 property alias searchQuery: searchField.text
33− property ListModel searchHistory: SearchHistoryModel {}
33+ property ListModel searchHistory
34 property Scope scope
34 property Scope scope
35
35
36 height: units.gu(8.5)
36 height: units.gu(8.5)
Dash/Dash.qml+3
@@ -26,6 +26,8 @@ Showable {
26
26
27 visible: shown
27 visible: shown
28
28
29+ property ListModel searchHistory: SearchHistoryModel {}
30+
29 property alias contentProgress: dashContent.contentProgress
31 property alias contentProgress: dashContent.contentProgress
30 property string showScopeOnLoaded: "home.scope"
32 property string showScopeOnLoaded: "home.scope"
31 property real contentScale: 1.0
33 property real contentScale: 1.0
@@ -63,6 +65,7 @@ Showable {
63 anchors.fill: parent
65 anchors.fill: parent
64 model: filteredScopes
66 model: filteredScopes
65 scopes: scopes
67 scopes: scopes
68+ searchHistory: dash.searchHistory
66 onMovementStarted: dashbar.startNavigation()
69 onMovementStarted: dashbar.startNavigation()
67 onMovementEnded: dashbar.stopNavigation()
70 onMovementEnded: dashbar.stopNavigation()
68 onContentFlickStarted: dashbar.finishNavigation()
71 onContentFlickStarted: dashbar.finishNavigation()
Dash/DashApps.qml+3
@@ -30,6 +30,9 @@ GenericScopeView {
30 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
30 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
31 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications
31 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications
32
32
33+ //FIXME an alias to itself shouldn't be required. More than likely a Qt bug. Try removing with newer Qt.
34+ property alias searchHistory: scopeView.searchHistory
35+
33 ListModel {
36 ListModel {
34 id: dummyVisibilityModifier
37 id: dummyVisibilityModifier
35
38
Dash/DashContent.qml+2−1
@@ -27,6 +27,7 @@ Item {
27 property alias currentIndex: dashContentList.currentIndex
27 property alias currentIndex: dashContentList.currentIndex
28
28
29 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
29 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
30+ property ListModel searchHistory
30
31
31 signal movementStarted()
32 signal movementStarted()
32 signal movementEnded()
33 signal movementEnded()
@@ -127,7 +128,7 @@ Item {
127 onLoaded: {
128 onLoaded: {
128 item.scope = Qt.binding(function() { return scope })
129 item.scope = Qt.binding(function() { return scope })
129 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
130 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
130− item.searchHistory = Qt.binding(function() { return shell.searchHistory })
131+ item.searchHistory = Qt.binding(function() { return dashContent.searchHistory })
131 dashContentList.movementStarted.connect(item.movementStarted)
132 dashContentList.movementStarted.connect(item.movementStarted)
132 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
133 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
133 dashContent.scopeLoaded(item.scope.id)
134 dashContent.scopeLoaded(item.scope.id)
Dash/GenericScopeView.qml+1
@@ -293,6 +293,7 @@ FocusScope {
293 text: scopeView.scope.name
293 text: scopeView.scope.name
294 searchEntryEnabled: true
294 searchEntryEnabled: true
295 scope: scopeView.scope
295 scope: scopeView.scope
296+ searchHistory: scopeView.searchHistory
296 }
297 }
297 }
298 }
298
299
Shell.qml−2
@@ -61,8 +61,6 @@ FocusScope {
61 }
61 }
62 }
62 }
63
63
64− property ListModel searchHistory: SearchHistoryModel {}
65−
66 property var applicationManager: ApplicationManagerWrapper {}
64 property var applicationManager: ApplicationManagerWrapper {}
67
65
68 Binding {
66 Binding {
tests/qmltests/Components/tst_PageHeader.qml+1
@@ -214,6 +214,7 @@ Item {
214 scope: scopeMock
214 scope: scopeMock
215
215
216 searchEntryEnabled: true
216 searchEntryEnabled: true
217+ searchHistory: SearchHistoryModel {}
217 text: "%^$%^%^&%^&%^$%GHR%"
218 text: "%^$%^%^&%^&%^$%GHR%"
218 }
219 }
219
220
tests/qmltests/Dash/tst_DashContent.qml+1−2
@@ -26,8 +26,6 @@ Item {
26 width: units.gu(40)
26 width: units.gu(40)
27 height: units.gu(80)
27 height: units.gu(80)
28
28
29− property ListModel searchHistory: ListModel {}
30−
31 Item {
29 Item {
32 // Fake. Make a few components less noisy
30 // Fake. Make a few components less noisy
33 id: greeter
31 id: greeter
@@ -60,6 +58,7 @@ Item {
60 scopes : scopesModel
58 scopes : scopesModel
61
59
62 scopeMapper : scopeDelegateMapper
60 scopeMapper : scopeDelegateMapper
61+ searchHistory: ListModel {}
63 }
62 }
64
63
65 ScopeDelegateMapper {
64 ScopeDelegateMapper {