summaryrefslogtreecommitdiff
path: root/src/history/historymanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-04 23:21:46 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-05 00:49:37 +0200
commitdeab0dd37edbc4007a3c2cf32d31811aff0e7e2d (patch)
treeb2a2884a69dd03428cdb9bcf15150a17ebbff867 /src/history/historymanager.cpp
parentThis should fix the Ctrl+w bug. Anyway, it really doesn't solve it: there is ... (diff)
downloadrekonq-deab0dd37edbc4007a3c2cf32d31811aff0e7e2d.tar.xz
Awesome bar speed up
This commit introduces notable changes and needs a lot of tests Courtesy patch from Mathias Kraus. Thanks :) BUG: 237390
Diffstat (limited to 'src/history/historymanager.cpp')
-rw-r--r--src/history/historymanager.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp
index c0f87935..d531c189 100644
--- a/src/history/historymanager.cpp
+++ b/src/history/historymanager.cpp
@@ -69,8 +69,9 @@ HistoryManager::HistoryManager(QObject *parent)
, m_historyModel(0)
, m_historyFilterModel(0)
, m_historyTreeModel(0)
- , m_completion(new KCompletion)
+ , m_completion(new AwesomeUrlCompletion)
{
+ kDebug() << "Loading HistoryManager...";
// take care of the completion object
m_completion->setOrder(KCompletion::Weighted);
@@ -87,6 +88,7 @@ HistoryManager::HistoryManager(QObject *parent)
// QWebHistoryInterface will delete the history manager
QWebHistoryInterface::setDefaultInterface(this);
+ kDebug() << "Loading HistoryManager... DONE";
}
@@ -131,7 +133,8 @@ void HistoryManager::addHistoryEntry(const QString &url)
// Add item to completion object
QString _url(url);
_url.remove(QRegExp("^http://|/$"));
- m_completion->addItem(_url);
+ UrlSearchItem urlSearchItem(UrlSearchItem::History, _url, QString(), item.dateTime, 1, QString(), QString());
+ m_completion->addItem(urlSearchItem);
}
@@ -251,20 +254,21 @@ void HistoryManager::removeHistoryEntry(const HistoryItem &item)
void HistoryManager::removeHistoryEntry(const KUrl &url, const QString &title)
{
+ HistoryItem item;
for (int i = 0; i < m_history.count(); ++i)
{
if (url == m_history.at(i).url
&& (title.isEmpty() || title == m_history.at(i).title))
{
- removeHistoryEntry(m_history.at(i));
+ item = m_history.at(i);
+ removeHistoryEntry(item);
break;
}
}
// Remove item from completion object
- QString _url = url.path();
- _url.remove(QRegExp("^http://|/$"));
- m_completion->removeItem(_url);
+ UrlSearchItem urlSearchItem(UrlSearchItem::History, item.url, item.title, item.dateTime, 0, QString(), QString());
+ m_completion->removeItem(urlSearchItem);
}
@@ -367,9 +371,10 @@ void HistoryManager::load()
lastInsertedItem = item;
// Add item to completion object
- QString _url = item.url;
+ //QString _url = item.url;
//_url.remove(QRegExp("^http://|/$"));
- m_completion->addItem(_url);
+ UrlSearchItem urlSearchItem(UrlSearchItem::History, item.url, item.title, item.dateTime, 1, QString(), QString());
+ m_completion->addItem(urlSearchItem);
}
if (needToSort)
qSort(list.begin(), list.end());
@@ -453,7 +458,7 @@ void HistoryManager::save()
}
-KCompletion * HistoryManager::completionObject() const
+AwesomeUrlCompletion * HistoryManager::completionObject() const
{
return m_completion;
}