port away from ViewSearch

This commit is contained in:
Marco Martin 2015-08-03 14:23:38 +02:00
parent 13ad9aa53b
commit f3698b6d69
3 changed files with 11 additions and 12 deletions

View file

@ -82,7 +82,7 @@ add_subdirectory( shell )
add_subdirectory( generators )
add_subdirectory( autotests )
add_subdirectory(doc)
#add_subdirectory(doc)
include(OkularConfigureChecks.cmake)

View file

@ -36,14 +36,13 @@ PlasmaComponents.Page {
id: toolBarContent
width: root.width
height: searchField.height
MobileComponents.ViewSearch {
PlasmaComponents.TextField {
id: searchField
enabled: documentItem.supportsSearch
anchors.centerIn: parent
busy: documentItem.searchInProgress
onSearchQueryChanged: {
if (searchQuery.length > 2) {
filterModel.filterRegExp = ".*" + searchQuery + ".*";
onTextChanged: {
if (text.length > 2) {
filterModel.filterRegExp = ".*" + text + ".*";
} else {
filterModel.filterRegExp = "";
}

View file

@ -31,17 +31,17 @@ ThumbnailsBase {
id: toolBarContent
width: root.width
height: searchField.height
MobileComponents.ViewSearch {
PlasmaComponents.TextField {
id: searchField
enabled: documentItem.supportsSearch
anchors.centerIn: parent
busy: documentItem.searchInProgress
onSearchQueryChanged: {
if (searchQuery.length > 2) {
documentItem.searchText(searchQuery)
onTextChanged: {
if (text.length > 2) {
documentItem.searchText(text);
} else {
view.currentIndex = pageArea.delegate.pageNumber
documentItem.resetSearch()
view.currentIndex = pageArea.delegate.pageNumber;
documentItem.resetSearch();
}
}
}