summaryrefslogtreecommitdiff
path: root/src/webengine/api/qquickwebenginehistory.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-18 16:56:06 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-18 16:56:06 +0100
commit440fbed83646f16bf002749f7cecf6ad6fc59bbf (patch)
tree231874f011a96d23061822d97bf70f52fc23617d /src/webengine/api/qquickwebenginehistory.cpp
parentbc315ce05298cf500f45f3a897b0f7c0408fd611 (diff)
parentc506d1d867f827dbff405d8e789ab4810410079a (diff)
downloadqtwebengine-440fbed83646f16bf002749f7cecf6ad6fc59bbf.tar.gz
Merge branch '5.6' into dev
Change-Id: I038f3544785862f3a2e2f35b8fab0b163e75d542
Diffstat (limited to 'src/webengine/api/qquickwebenginehistory.cpp')
-rw-r--r--src/webengine/api/qquickwebenginehistory.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp
index d790093a4..050833b28 100644
--- a/src/webengine/api/qquickwebenginehistory.cpp
+++ b/src/webengine/api/qquickwebenginehistory.cpp
@@ -54,7 +54,7 @@ QQuickWebEngineHistoryListModelPrivate::~QQuickWebEngineHistoryListModelPrivate(
int QQuickWebEngineHistoryListModelPrivate::count() const
{
if (!adapter())
- return -1;
+ return 0;
return adapter()->navigationEntryCount();
}
@@ -65,6 +65,8 @@ int QQuickWebEngineHistoryListModelPrivate::index(int index) const
int QQuickWebEngineHistoryListModelPrivate::offsetForIndex(int index) const
{
+ if (!adapter())
+ return index;
return index - adapter()->currentNavigationEntryIndex();
}
@@ -81,7 +83,7 @@ QQuickWebEngineBackHistoryListModelPrivate::QQuickWebEngineBackHistoryListModelP
int QQuickWebEngineBackHistoryListModelPrivate::count() const
{
if (!adapter())
- return -1;
+ return 0;
return adapter()->currentNavigationEntryIndex();
}
@@ -104,12 +106,14 @@ QQuickWebEngineForwardHistoryListModelPrivate::QQuickWebEngineForwardHistoryList
int QQuickWebEngineForwardHistoryListModelPrivate::count() const
{
if (!adapter())
- return -1;
+ return 0;
return adapter()->navigationEntryCount() - adapter()->currentNavigationEntryIndex() - 1;
}
int QQuickWebEngineForwardHistoryListModelPrivate::index(int i) const
{
+ if (!adapter())
+ return i + 1;
return adapter()->currentNavigationEntryIndex() + i + 1;
}