summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp5
-rw-r--r--src/history/historymanager.cpp26
-rw-r--r--src/history/historymanager.h2
-rw-r--r--src/urlbar/urlresolver.cpp2
4 files changed, 33 insertions, 2 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 9c3201e6..95adf387 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -330,6 +330,11 @@ QString BookmarkProvider::titleForBookmarkUrl(QString url)
bookmark = bookGroup.next(bookmark);
}
+ if (title.isEmpty())
+ {
+ title = url;
+ }
+
return title;
}
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;
+}
+
diff --git a/src/history/historymanager.h b/src/history/historymanager.h
index 8fc5c30e..9a844672 100644
--- a/src/history/historymanager.h
+++ b/src/history/historymanager.h
@@ -141,6 +141,8 @@ public:
void updateHistoryEntry(const KUrl &url, const QString &title);
void removeHistoryEntry(const KUrl &url, const QString &title = QString());
+ QString titleForHistoryUrl(QString url);
+
int historyLimit() const;
void setHistoryLimit(int limit);
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 5593f566..3877a6c2 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -181,7 +181,7 @@ UrlSearchList UrlResolver::historyResolution()
QStringList historyResults = historyCompletion->substringCompletion(_urlString);
Q_FOREACH(const QString &s, historyResults)
{
- UrlSearchItem it(s, s, QString("view-history"));
+ UrlSearchItem it(s, Application::historyManager()->titleForHistoryUrl(s), QString("view-history"));
list << it;
}