From ccbc7ee39a3e1fc34f8c56cd7524c86fde41562c Mon Sep 17 00:00:00 2001
From: megabigbug <megabigbug@arrakis.(none)>
Date: Thu, 20 May 2010 20:06:07 +0200
Subject: improve search of title for an url in the history: use hash table
 from HistoryFilterModel

---
 src/history/historymanager.cpp | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

(limited to 'src')

diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp
index e7e80841..8a29aa90 100644
--- a/src/history/historymanager.cpp
+++ b/src/history/historymanager.cpp
@@ -517,23 +517,6 @@ bool HistoryManager::clearDownloadsHistory()
 
 QString HistoryManager::titleForHistoryUrl(QString url)
 {
-    QString title = "";
-
-    int i = 0;
-    while (i < history().count() && title.isEmpty())
-    {
-        if (history().at(i).url == url)
-        {
-            title = history().at(i).title;
-        }
-        i++;
-    }
-
-    if (title.isEmpty())
-    {
-        title = url;
-    }
-
-    return title;
+    return history().at(m_historyFilterModel->historyLocation(url)).title;
 }
 
-- 
cgit v1.2.1