diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-26 00:42:35 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-26 00:42:35 +0200 |
commit | dfe4eefa64ba7d1c6f27b8da33b292c6c3274759 (patch) | |
tree | b65c4452e56d949c36caf6f535bcc03e4e52b9de /src | |
parent | Merge commit 'refs/merge-requests/2252' of git://gitorious.org/rekonq/mainlin... (diff) | |
parent | Correctly display separators in the bookmark toolbar (diff) | |
download | rekonq-dfe4eefa64ba7d1c6f27b8da33b292c6c3274759.tar.xz |
Merge commit 'refs/merge-requests/2253' of git://gitorious.org/rekonq/mainline into m2253
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/bookmarksmanager.cpp | 54 | ||||
-rw-r--r-- | src/bookmarks/bookmarksmanager.h | 2 |
2 files changed, 25 insertions, 31 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)); + } } } diff --git a/src/bookmarks/bookmarksmanager.h b/src/bookmarks/bookmarksmanager.h index 8d09e122..38726724 100644 --- a/src/bookmarks/bookmarksmanager.h +++ b/src/bookmarks/bookmarksmanager.h @@ -262,7 +262,7 @@ public slots: private: - KAction *fillBookmarkBar(const KBookmark &bookmark); + void fillBookmarkBar(KToolBar *toolBar); QString titleForBookmarkUrl(const KBookmark &bookmark, QString url); KBookmarkManager *m_manager; |