diff options
| author | Amandeep Singh <[email protected]> | 2012-09-22 23:44:42 +0530 |
|---|---|---|
| committer | Amandeep Singh <[email protected]> | 2012-09-22 23:47:18 +0530 |
| commit | 990c7d260ffdca52496d05b88b763ab4566b8c0a (patch) | |
| tree | 3265bd0a62758a2ec446b575d990c2a021db327c | |
| parent | 4196026cd8a625e8c091f149a9cef0aded416fe7 (diff) | |
Returning correct rowCount.
| -rw-r--r-- | src/kitemviews/kitemlistviewaccessible.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistviewaccessible.cpp b/src/kitemviews/kitemlistviewaccessible.cpp index 48bafc39a..80a6d1cf9 100644 --- a/src/kitemviews/kitemlistviewaccessible.cpp +++ b/src/kitemviews/kitemlistviewaccessible.cpp @@ -66,8 +66,14 @@ int KItemListViewAccessible::columnCount() const int KItemListViewAccessible::rowCount() const { + if(columnCount()<=0) { + return 0; + } int itemCount = view()->model()->count(); int rowCount = itemCount / columnCount(); + if(rowCount <= 0){ + return 0; + } if (itemCount % rowCount) { ++rowCount; } @@ -257,7 +263,7 @@ KItemListAccessibleCell::KItemListAccessibleCell(KItemListView* view, int index) m_view(view), m_index(index) { - Q_ASSERT(index > 0); + Q_ASSERT(index >= 0); } int KItemListAccessibleCell::columnExtent() const |
