summaryrefslogtreecommitdiff
path: root/src/bookmarks
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-03-25 12:22:04 +0100
committerYoann Laissus <yoann.laissus@gmail.com>2010-03-25 12:22:04 +0100
commit9ede70edadea14f3a1ee4d66ca03ec20a6133f72 (patch)
tree7afde06ad86d37f1c652901aaa3108dd93d7e31c /src/bookmarks
parentAdd missing files (diff)
downloadrekonq-9ede70edadea14f3a1ee4d66ca03ec20a6133f72.tar.xz
Add tests for the bookmark before toGroup()
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/bookmarkspanel.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp
index c50ebcdb..fdf1b3d8 100644
--- a/src/bookmarks/bookmarkspanel.cpp
+++ b/src/bookmarks/bookmarkspanel.cpp
@@ -157,13 +157,16 @@ void BookmarksPanel::autoExpand(const QModelIndex &root)
{
int count = m_treeView->model()->rowCount(root);
- QModelIndex temp;
+ QModelIndex index;
for(int i = 0; i < count; i++)
{
- temp = m_treeView->model()->index(i,0,root);
- m_treeView->setExpanded(temp, bookmarkForIndex(temp).toGroup().isOpen());
- autoExpand(temp);
+ index = m_treeView->model()->index(i, 0, root);
+ if(index.isValid() && bookmarkForIndex(index).isGroup())
+ {
+ m_treeView->setExpanded(index, bookmarkForIndex(index).toGroup().isOpen());
+ autoExpand(index);
+ }
}
}
@@ -369,7 +372,7 @@ void BookmarksPanel::editBookmark()
void BookmarksPanel::openAll()
{
QModelIndex index = m_treeView->currentIndex();
- if(!index.isValid())
+ if(!index.isValid() || !bookmarkForIndex(index).isGroup())
return;
QList<KUrl> allChild = bookmarkForIndex(index).toGroup().groupUrlList();