diff options
author | Adam Kallai <kadam@inf.u-szeged.hu> | 2015-01-21 07:35:19 -0800 |
---|---|---|
committer | Adam Kallai <kadam@inf.u-szeged.hu> | 2015-01-22 07:36:26 +0100 |
commit | 9c852a048ebce776fba08a668e4e45251f987d10 (patch) | |
tree | 00c579b07748dd6a25c630374f7891e9c745d2e8 | |
parent | f059f40e33be775a6ebf4cfdf61eb981657649f7 (diff) |
Fix the tst_navigationHistory QML testcase
When the ListView component is created from the QQuickWebEngineHistoryListModel model.
It requires an adapter to get the currentNavigationEntryIndex and navigationEntryCount
for the QQuickWebEngineHistoryListModel::rowCount.
Add the default rowCount value while the adapter is not unavailable because of the lazy
adapter initialization.
Change-Id: Id80d6f56adfea613bdc2c13d9caa1a12f50fddca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
-rw-r--r-- | src/webengine/api/qquickwebenginehistory.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp index ffb857791..7924dbc5e 100644 --- a/src/webengine/api/qquickwebenginehistory.cpp +++ b/src/webengine/api/qquickwebenginehistory.cpp @@ -63,6 +63,8 @@ QQuickWebEngineBackHistoryListModelPrivate::QQuickWebEngineBackHistoryListModelP int QQuickWebEngineBackHistoryListModelPrivate::count() const { + if (!adapter()) + return -1; return adapter()->currentNavigationEntryIndex(); } @@ -79,6 +81,8 @@ QQuickWebEngineForwardHistoryListModelPrivate::QQuickWebEngineForwardHistoryList int QQuickWebEngineForwardHistoryListModelPrivate::count() const { + if (!adapter()) + return -1; return adapter()->navigationEntryCount() - adapter()->currentNavigationEntryIndex() - 1; } |