summaryrefslogtreecommitdiff
path: root/src/history
diff options
context:
space:
mode:
Diffstat (limited to 'src/history')
-rw-r--r--src/history/historymanager.cpp26
-rw-r--r--src/history/historymanager.h2
2 files changed, 27 insertions, 1 deletions
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);