[Merge] lp:~rpadovani/webbrowser-app/searchenginesmodel into lp:webbrowser-app
Olivier Tilloy
olivier.tilloy at canonical.com
Thu Mar 26 16:24:08 UTC 2015
Thanks for your initial work on this.
I’ve realized that such a custom model is not needed though. Here is a small code snippet that demonstrates how to show a list of all available search engines using the FolderListModel element:
import QtQuick 2.0
import Qt.labs.folderlistmodel 2.1
import Ubuntu.Components 1.1
import Ubuntu.Components.ListItems 1.0 as ListItem
ListView {
model: FolderListModel {
folder: dataLocation +"/searchengines"
showDirs: false
nameFilters: ["*.xml"]
sortField: FolderListModel.Name
}
delegate: ListItem.Standard {
SearchEngine {
id: searchEngineDelegate
filename: model.fileBaseName
}
text: searchEngineDelegate.name
onClicked: browser.searchEngine = searchEngineDelegate.filename
}
}
--
https://code.launchpad.net/~rpadovani/webbrowser-app/searchenginesmodel/+merge/250893
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~rpadovani/webbrowser-app/searchenginesmodel into lp:webbrowser-app.
More information about the Ubuntu-reviews
mailing list