diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-04-26 00:11:53 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-04-26 00:11:53 +0200 |
commit | 43f03cea2dbf75966b3e7a239a821646d6cfee6c (patch) | |
tree | a70a497e6669eb27f41a6506a693bf16c366e4be /src/bookmarks/bookmarksmanager.cpp | |
parent | Merge branch 'NetworkRequestImprovements' (diff) | |
download | rekonq-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.cpp | 54 |
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)); + } } } |