@@ -20,6 +20,9 @@ import QtQuick 2.4
20// TODO sanitize input, move to persistent storage
20// TODO sanitize input, move to persistent storage
22ListModel {
22ListModel {
24+ property int searchesToRemember: 3
23 function addQuery(newQuery) {
26 function addQuery(newQuery) {
24 // strip whitespaces
27 // strip whitespaces
25 newQuery = newQuery.replace(/^\s+|\s+$/g, '');
28 newQuery = newQuery.replace(/^\s+|\s+$/g, '');
@@ -34,9 +37,9 @@ ListModel {
35 // add a new entry
38 // add a new entry
36 insert(0, { "query": newQuery })
39 insert(0, { "query": newQuery })
37− if (count > 3) {
40+ if (count > searchesToRemember) {
38 // remove entries if there's more than three
41 // remove entries if there's more than three
39− remove(3)
42+ remove(searchesToRemember)