diff options
| author | lionelc <lionelc@lionelc.(none)> | 2010-03-30 11:37:25 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-02 22:01:06 +0200 | 
| commit | a2cb9efc54c78c47e41196f0121ca00255a4a7ab (patch) | |
| tree | b091956d703ef49ae2e6e1a36cdb2e28fd732d7f /src | |
| parent | display bookmark and history item only if string typed is longer than 3 chars (diff) | |
| download | rekonq-a2cb9efc54c78c47e41196f0121ca00255a4a7ab.tar.xz | |
add title for history items
Diffstat (limited to 'src')
| -rw-r--r-- | src/bookmarks/bookmarksmanager.cpp | 5 | ||||
| -rw-r--r-- | src/history/historymanager.cpp | 26 | ||||
| -rw-r--r-- | src/history/historymanager.h | 2 | ||||
| -rw-r--r-- | src/urlbar/urlresolver.cpp | 2 | 
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;      } | 
