summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarksmanager.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-04-26 00:11:53 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-04-26 00:11:53 +0200
commit43f03cea2dbf75966b3e7a239a821646d6cfee6c (patch)
treea70a497e6669eb27f41a6506a693bf16c366e4be /src/bookmarks/bookmarksmanager.cpp
parentMerge branch 'NetworkRequestImprovements' (diff)
downloadrekonq-43f03cea2dbf75966b3e7a239a821646d6cfee6c.tar.xz
Correctly display separators in the bookmark toolbar
BUG: 235108
Diffstat (limited to 'src/bookmarks/bookmarksmanager.cpp')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp54
1 files changed, 24 insertions, 30 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index df6bc54b..b3354c57 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -335,18 +335,8 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString
{
if (bookmarkToolBar)
{
- KBookmarkGroup toolBarGroup = m_manager->toolbar();
- if (toolBarGroup.isNull())
- return;
-
bookmarkToolBar->clear();
-
- KBookmark bookmark = toolBarGroup.first();
- while (!bookmark.isNull())
- {
- bookmarkToolBar->addAction(fillBookmarkBar(bookmark));
- bookmark = toolBarGroup.next(bookmark);
- }
+ fillBookmarkBar(bookmarkToolBar);
}
}
}
@@ -393,28 +383,32 @@ KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent)
}
-KAction *BookmarkProvider::fillBookmarkBar(const KBookmark &bookmark)
+void BookmarkProvider::fillBookmarkBar(KToolBar *toolBar)
{
- if (bookmark.isGroup())
- {
- KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this);
- menuAction->setDelayed(false);
- new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address());
+ KBookmarkGroup root = m_manager->toolbar();
+ if(root.isNull())
+ return;
- return menuAction;
- }
-
- if(bookmark.isSeparator())
- {
- KAction *a = new KBookmarkAction(bookmark, m_owner, this);
- a->setText("");
- a->setIcon(QIcon());
- a->setSeparator(true);
- return a;
- }
- else
+ for(KBookmark bookmark = root.first(); !bookmark.isNull(); bookmark = root.next(bookmark))
{
- return new KBookmarkAction(bookmark, m_owner, this);
+ if (bookmark.isGroup())
+ {
+ KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this);
+ menuAction->setDelayed(false);
+ new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address());
+
+ toolBar->addAction(menuAction);
+ }
+
+ else if(bookmark.isSeparator())
+ {
+ toolBar->addSeparator();
+ }
+
+ else
+ {
+ toolBar->addAction(new KBookmarkAction(bookmark, m_owner, this));
+ }
}
}