From a2cb9efc54c78c47e41196f0121ca00255a4a7ab Mon Sep 17 00:00:00 2001 From: lionelc Date: Tue, 30 Mar 2010 11:37:25 +0200 Subject: add title for history items --- src/history/historymanager.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/history/historymanager.cpp') diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 39c128f4..7aded714 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -362,7 +362,7 @@ void HistoryManager::load() // Add item to completion object QString _url = item.url; - _url.remove(QRegExp("^http://|/$")); + //_url.remove(QRegExp("^http://|/$")); m_completion->addItem(_url); } if (needToSort) @@ -504,3 +504,27 @@ bool HistoryManager::clearDownloadsHistory() QFile downloadFile(downloadFilePath); return downloadFile.remove(); } + + +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; +} + -- cgit v1.2.1