summaryrefslogtreecommitdiff
path: root/src/history/historymanager.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2010-08-24 13:06:02 +0200
committerPierre Rossi <pierre.rossi@nokia.com>2010-08-25 11:02:57 +0200
commit8021b32b5288de901ec2c1defb3712211598925a (patch)
treed7810d9e3c205b5ae8520d07bce6507112e4ef57 /src/history/historymanager.cpp
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-8021b32b5288de901ec2c1defb3712211598925a.tar.xz
Awesome bar: support for multiple word search.
Also support searches starting by i (without messing with the <i> for urls) and page titles with characters such as '<' or '>'.
Diffstat (limited to 'src/history/historymanager.cpp')
-rw-r--r--src/history/historymanager.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp
index 5cd85cd7..4a3039f3 100644
--- a/src/history/historymanager.cpp
+++ b/src/history/historymanager.cpp
@@ -239,8 +239,18 @@ QList<HistoryItem> HistoryManager::find(const QString &text)
{
int index = m_historyFilterModel->historyLocation(url);
HistoryItem item = m_history.at(index);
-
- if(url.contains(text) || item.title.contains(text))
+
+ QStringList words = text.split(" ");
+ bool matches = true;
+ foreach (const QString &word, words)
+ {
+ if (!url.contains(word, Qt::CaseInsensitive)
+ && !item.title.contains(word, Qt::CaseInsensitive)) {
+ matches = false;
+ break;
+ }
+ }
+ if (matches)
list << item;
}