on xenial help sign in
Search history is now persistent across all scopes and remains in QML. Fixes: https://bugs.launchpad.net/bugs/1226221.

Approved by PS Jenkins bot, Albert Astals Cid.

commit16cade2daff36778dbf3dd9d01bda71b1147b6f2 authorNicolas d'Offay <nicolas.doffay@canonical.com> dateThu 21 Nov 2013, 13:06 (13 years ago) parent53781fff35cd95
8 files changed+12−6
Components/PageHeader.qml+1−1 Dash/Dash.qml+3 Dash/DashApps.qml+3 Dash/DashContent.qml+2−1 Dash/GenericScopeView.qml+1 Shell.qml−2 tests/qmltests/Components/tst_PageHeader.qml+1 tests/qmltests/Dash/tst_DashContent.qml+1−2
Components/PageHeader.qml+1−1
@@ -30,7 +30,7 @@ Item {
3030
3131 property bool searchEntryEnabled: false
3232 property alias searchQuery: searchField.text
33− property ListModel searchHistory: SearchHistoryModel {}
33+ property ListModel searchHistory
3434 property Scope scope
3535
3636 height: units.gu(8.5)
Dash/Dash.qml+3
@@ -26,6 +26,8 @@ Showable {
2626
2727 visible: shown
2828
29+ property ListModel searchHistory: SearchHistoryModel {}
30+
2931 property alias contentProgress: dashContent.contentProgress
3032 property string showScopeOnLoaded: "home.scope"
3133 property real contentScale: 1.0
@@ -63,6 +65,7 @@ Showable {
6365 anchors.fill: parent
6466 model: filteredScopes
6567 scopes: scopes
68+ searchHistory: dash.searchHistory
6669 onMovementStarted: dashbar.startNavigation()
6770 onMovementEnded: dashbar.stopNavigation()
6871 onContentFlickStarted: dashbar.finishNavigation()
Dash/DashApps.qml+3
@@ -30,6 +30,9 @@ GenericScopeView {
3030 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
3131 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications
3232
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+
3336 ListModel {
3437 id: dummyVisibilityModifier
3538
Dash/DashContent.qml+2−1
@@ -27,6 +27,7 @@ Item {
2727 property alias currentIndex: dashContentList.currentIndex
2828
2929 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
30+ property ListModel searchHistory
3031
3132 signal movementStarted()
3233 signal movementEnded()
@@ -127,7 +128,7 @@ Item {
127128 onLoaded: {
128129 item.scope = Qt.binding(function() { return scope })
129130 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 })
131132 dashContentList.movementStarted.connect(item.movementStarted)
132133 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
133134 dashContent.scopeLoaded(item.scope.id)
Dash/GenericScopeView.qml+1
@@ -293,6 +293,7 @@ FocusScope {
293293 text: scopeView.scope.name
294294 searchEntryEnabled: true
295295 scope: scopeView.scope
296+ searchHistory: scopeView.searchHistory
296297 }
297298 }
298299
Shell.qml−2
@@ -61,8 +61,6 @@ FocusScope {
6161 }
6262 }
6363
64− property ListModel searchHistory: SearchHistoryModel {}
65−
6664 property var applicationManager: ApplicationManagerWrapper {}
6765
6866 Binding {
tests/qmltests/Components/tst_PageHeader.qml+1
@@ -214,6 +214,7 @@ Item {
214214 scope: scopeMock
215215
216216 searchEntryEnabled: true
217+ searchHistory: SearchHistoryModel {}
217218 text: "%^$%^%^&%^&%^$%GHR%"
218219 }
219220
tests/qmltests/Dash/tst_DashContent.qml+1−2
@@ -26,8 +26,6 @@ Item {
2626 width: units.gu(40)
2727 height: units.gu(80)
2828
29− property ListModel searchHistory: ListModel {}
30−
3129 Item {
3230 // Fake. Make a few components less noisy
3331 id: greeter
@@ -60,6 +58,7 @@ Item {
6058 scopes : scopesModel
6159
6260 scopeMapper : scopeDelegateMapper
61+ searchHistory: ListModel {}
6362 }
6463
6564 ScopeDelegateMapper {