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

Sriram Neelakandan sriram.neelakandan at gmail.com
Tue Aug 17 09:29:02 PDT 2010


Richard Thanks;

The earlier implemtation just used  WebCore::BackForwardList
->itemAtIndex() which works with -ve to +ve
see: http://trac.webkit.org/browser/trunk/WebCore/history/BackForwardListImpl.cpp#L228

My app used to work fine for -ve values earlier.
So that leads to another doubt; is this a 4.7 specific change ?


On 8/17/10, Richard Moore <rich at kde.org> wrote:
> 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
>>
>


-- 
Sriram Neelakandan
Author - Embedded Linux System Design And Development
(http://tinyurl.com/2doosu)


More information about the webkit-qt mailing list