[webkit-qt] Issue with QWebHistory::itemAt(int i) in Qt-4.7b2

Richard Moore rich at kde.org
Tue Aug 17 08:16:16 PDT 2010


>From the docs:

The history uses the concept of a current item, dividing the pages
visited into those that can be visited by navigating back and forward
using the back() and forward() functions. The current item can be
obtained by calling currentItem(), and an arbitrary item in the
history can be made the current item by passing it to goToItem().

So, to get the first 'back' item try history->itemAt(
history->currentItemIndex()-1 )

Rich.

On Tue, Aug 17, 2010 at 4:04 PM, Sriram Neelakandan
<sriram.neelakandan at gmail.com> wrote:
> Dear List,
>
> QWebHistoryItem QWebHistory::itemAt(int i) const
> {
>    if (i < 0 || i >= count())
>        priv = new QWebHistoryItemPrivate(0);
> ..
> }
>
> As seen a null item is prepared for any -ve value; which prevents
> probing the Back Entries of WebCore::BackForwardList
>
> I did look up the latest code on GIT
> http://www.qt.gitorious.org/qt/qt/blobs/4.7/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp#line444
> It has the check still in place;
> Same at http://trac.webkit.org/browser/trunk/WebKit/qt/Api/qwebhistory.cpp
>
> However Qt-4.5.2 did not have this check
> I think it should be  something like
>
> QWebHistoryItem QWebHistory::itemAt(int i) const
> {
>   if (i < -count() || i >= count())
>        priv = new QWebHistoryItemPrivate(0);
> ...
> }
>
> Is this a bug ? should i report this on bugs.webkit.org ?
> Or am i missing something obvious here ?
> thanks
> --
> Sriram Neelakandan
> Author - Embedded Linux System Design And Development
> (http://tinyurl.com/2doosu)
> _______________________________________________
> webkit-qt mailing list
> webkit-qt at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
>


More information about the webkit-qt mailing list