Commit 4d34879e authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

When a user creates a new bookmark folder make that the current item.

BUG: 152158
REVIEW: 114479
FIXED-IN: 4.12.1
parent a6b0da5a
......@@ -99,12 +99,16 @@ void KBookmarkDialogPrivate::initLayoutPrivate()
layout = true;
}
void KBookmarkDialogPrivate::fillGroup(QTreeWidgetItem *parentItem, const KBookmarkGroup &group)
void KBookmarkDialogPrivate::fillGroup(QTreeWidgetItem *parentItem, const KBookmarkGroup &group, const KBookmarkGroup &selectGroup)
{
for (KBookmark bk = group.first(); !bk.isNull(); bk = group.next(bk)) {
if (bk.isGroup()) {
QTreeWidgetItem *item = new KBookmarkTreeItem(parentItem, folderTree, bk.toGroup());
fillGroup(item, bk.toGroup());
const KBookmarkGroup bkGroup = bk.toGroup();
QTreeWidgetItem* item = new KBookmarkTreeItem(parentItem, m_folderTree, bkGroup);
if (selectGroup == bkGroup) {
m_folderTree->setCurrentItem(item);
}
fillGroup(item, bkGroup, selectGroup);
}
}
}
......@@ -370,7 +374,7 @@ void KBookmarkDialog::newFolderButton()
d->mgr->emitChanged(parentGroup);
d->folderTree->clear();
QTreeWidgetItem *root = new KBookmarkTreeItem(d->folderTree);
d->fillGroup(root, d->mgr->root());
d->fillGroup(root, d->mgr->root(), group);
}
}
......
......@@ -43,7 +43,7 @@ public:
// selects the specified bookmark in the folder tree
void setParentBookmark(const KBookmark &bm);
KBookmarkGroup parentBookmark();
void fillGroup(QTreeWidgetItem *parentItem, const KBookmarkGroup &group);
void fillGroup(QTreeWidgetItem *parentItem, const KBookmarkGroup &group, const KBookmarkGroup &selectGroup = KBookmarkGroup());
KBookmarkDialog *q;
BookmarkDialogMode mode;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment