summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarksmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-26 00:42:35 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-26 00:42:35 +0200
commitdfe4eefa64ba7d1c6f27b8da33b292c6c3274759 (patch)
treeb65c4452e56d949c36caf6f535bcc03e4e52b9de /src/bookmarks/bookmarksmanager.cpp
parentMerge commit 'refs/merge-requests/2252' of git://gitorious.org/rekonq/mainlin... (diff)
parentCorrectly display separators in the bookmark toolbar (diff)
downloadrekonq-dfe4eefa64ba7d1c6f27b8da33b292c6c3274759.tar.xz
Merge commit 'refs/merge-requests/2253' of git://gitorious.org/rekonq/mainline into m2253
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));
+ }
}
}