summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-03-26 11:26:10 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-03-26 11:26:10 +0100
commit3380e966b5dc82ee99f136a17a4728b51d5ff385 (patch)
tree3a4b8c0e9e1c4a99ffe1252a79aaf3adb096c7f1 /src
parentMerge commit 'refs/merge-requests/107' of git://gitorious.org/rekonq/mainline... (diff)
parentAdd tests for the bookmark before toGroup() (diff)
downloadrekonq-3380e966b5dc82ee99f136a17a4728b51d5ff385.tar.xz
Merge commit 'refs/merge-requests/107' of git://gitorious.org/rekonq/mainline into HistoryBookmarksImprovements
Diffstat (limited to 'src')
-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();