diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-03-27 10:57:05 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-03-27 10:57:05 +0200 |
commit | fba0b940cb63f83425ff978bab9774adfbc04f88 (patch) | |
tree | 7995797283ebe19a930ad5e68601e034b53949e8 /src | |
parent | Never execute deprecated code (diff) | |
download | rekonq-fba0b940cb63f83425ff978bab9774adfbc04f88.tar.xz |
Untrack the bookmarks menu list and set a parent to automagically
delete it as object child
CCBUG:269490
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/bookmarkprovider.cpp | 17 | ||||
-rw-r--r-- | src/bookmarks/bookmarkprovider.h | 1 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp index 9049c305..cef6eaeb 100644 --- a/src/bookmarks/bookmarkprovider.cpp +++ b/src/bookmarks/bookmarkprovider.cpp @@ -49,10 +49,10 @@ BookmarkProvider::BookmarkProvider(QObject *parent) - : QObject(parent) - , m_manager(0) - , m_owner(0) - , m_actionCollection(new KActionCollection(this)) + : QObject(parent) + , m_manager(0) + , m_owner(0) + , m_actionCollection(new KActionCollection(this)) { // NOTE // This hackish code is needed to continue sharing bookmarks with konqueror, @@ -95,7 +95,6 @@ BookmarkProvider::BookmarkProvider(QObject *parent) BookmarkProvider::~BookmarkProvider() { - qDeleteAll(m_bookmarkMenus); delete m_manager; } @@ -109,8 +108,8 @@ KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent) bookmarkActionMenu->setMenu(menu); bookmarkActionMenu->setText(i18n("&Bookmarks")); BookmarkMenu *bMenu = new BookmarkMenu(m_manager, m_owner, menu, m_actionCollection); - m_bookmarkMenus.append(bMenu); - + bMenu->setParent(menu); + return bookmarkActionMenu; } @@ -219,8 +218,8 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this); menuAction->setDelayed(false); BookmarkMenu *bMenu = new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address()); - m_bookmarkMenus.append(bMenu); - + bMenu->setParent(menuAction->menu()); + connect(menuAction->menu(), SIGNAL(aboutToShow()), toolBar, SLOT(menuDisplayed())); connect(menuAction->menu(), SIGNAL(aboutToHide()), toolBar, SLOT(menuHidden())); diff --git a/src/bookmarks/bookmarkprovider.h b/src/bookmarks/bookmarkprovider.h index e0dee7a5..4af97ef7 100644 --- a/src/bookmarks/bookmarkprovider.h +++ b/src/bookmarks/bookmarkprovider.h @@ -150,7 +150,6 @@ private: KActionCollection *m_actionCollection; QList<BookmarkToolBar *> m_bookmarkToolBars; QList<BookmarksPanel *> m_bookmarkPanels; - QList<BookmarkMenu *> m_bookmarkMenus; }; |