From 08ca2545eede86a0f6de42be596b063de1321ddb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 10 Aug 2012 17:34:04 +0200 Subject: Manage Bookmarks Toolbar show/hide (&& create/delete) --- src/bookmarks/bookmarkmanager.cpp | 4 ++-- src/bookmarks/bookmarkstoolbar.cpp | 6 ++++++ src/bookmarks/bookmarkstoolbar.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/bookmarkmanager.cpp b/src/bookmarks/bookmarkmanager.cpp index 7e1b5d90..57464846 100644 --- a/src/bookmarks/bookmarkmanager.cpp +++ b/src/bookmarks/bookmarkmanager.cpp @@ -181,7 +181,7 @@ void BookmarkManager::fillBookmarkBar(BookmarkToolBar *toolBar) { if (bookmark.isGroup()) { - KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this); + KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), toolBar); menuAction->setDelayed(false); BookmarkMenu *bMenu = new BookmarkMenu(m_manager, m_owner, menuAction->menu(), bookmark.address()); bMenu->setParent(menuAction->menu()); @@ -198,7 +198,7 @@ void BookmarkManager::fillBookmarkBar(BookmarkToolBar *toolBar) } else { - KBookmarkAction *action = new KBookmarkAction(bookmark, m_owner, this); + KBookmarkAction *action = new KBookmarkAction(bookmark, m_owner, toolBar); action->setIcon(IconManager::self()->iconForUrl(KUrl(bookmark.url()))); toolBar->addAction(action); toolBar->widgetForAction(action)->installEventFilter(toolBar); diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index 2ecb0e35..7a904ef5 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -170,6 +170,12 @@ BookmarkToolBar::BookmarkToolBar(QWidget *parent) } +BookmarkToolBar::~BookmarkToolBar() +{ + clear(); +} + + void BookmarkToolBar::contextMenu(const QPoint &point) { KBookmarkActionInterface *action = dynamic_cast(actionAt(point)); diff --git a/src/bookmarks/bookmarkstoolbar.h b/src/bookmarks/bookmarkstoolbar.h index 97fd7a8f..4098f2a3 100644 --- a/src/bookmarks/bookmarkstoolbar.h +++ b/src/bookmarks/bookmarkstoolbar.h @@ -83,6 +83,7 @@ class BookmarkToolBar : public KToolBar public: BookmarkToolBar(QWidget *parent); + ~BookmarkToolBar(); protected: bool eventFilter(QObject *watched, QEvent *event); -- cgit v1.2.1