summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-08-21 20:34:12 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-08-21 20:34:12 +0200
commit1030df8da3c2e6a0ff7fac177a64cc44e4dd2517 (patch)
tree65d134ad112adbf48f678fe05fb150dca2b34baa /src
parentRestore bk icon on the right (diff)
downloadrekonq-1030df8da3c2e6a0ff7fac177a64cc44e4dd2517.tar.xz
Don't add open folder in tabs if there are only folders
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/bookmarkscontextmenu.cpp18
-rw-r--r--src/bookmarks/bookmarkstoolbar.cpp1
2 files changed, 16 insertions, 3 deletions
diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp
index a473966a..da986fd2 100644
--- a/src/bookmarks/bookmarkscontextmenu.cpp
+++ b/src/bookmarks/bookmarkscontextmenu.cpp
@@ -69,10 +69,22 @@ void BookmarksContextMenu::addBookmarkActions()
void BookmarksContextMenu::addFolderActions()
{
- if (!bookmark().toGroup().first().isNull())
+ KBookmarkGroup group = bookmark().toGroup();
+
+ if (!group.first().isNull())
{
- addAction(bmOwner->action(BookmarkOwner::OPEN_FOLDER));
- addSeparator();
+ KBookmark child = group.first();
+
+ while (child.isGroup() || child.isSeparator())
+ {
+ child = group.next(child);
+ }
+
+ if (!child.isNull())
+ {
+ addAction(bmOwner->action(BookmarkOwner::OPEN_FOLDER));
+ addSeparator();
+ }
}
addAction(bmOwner->action(BookmarkOwner::BOOKMARK_PAGE));
diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp
index 64e9c3b9..8d35cb8a 100644
--- a/src/bookmarks/bookmarkstoolbar.cpp
+++ b/src/bookmarks/bookmarkstoolbar.cpp
@@ -124,6 +124,7 @@ void BookmarkMenu::refill()
void BookmarkMenu::addOpenFolderInTabs()
{
+ // TODO: Needs to be ported to the new BookmarkOwner API
KAction *action;
KBookmarkGroup group = manager()->findByAddress(parentAddress()).toGroup();