summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarksmanager.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-08-20 15:30:03 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-08-20 15:30:03 +0200
commit79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c (patch)
tree9740b7d4de3c1c78e0a8cf2e31b554e954090db5 /src/bookmarks/bookmarksmanager.cpp
parentFixed tooltip in the bookmarks panel (diff)
downloadrekonq-79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c.tar.xz
- The bookmark toolbar is now a real toolbar, not an action.
It fixes the problem of the submenu if there are too much items to fit on the bar - Improve a bit the new redesign of BookmarkOwner - Reenable the bookmark menu by default (because the icon in the bar is on the left)
Diffstat (limited to 'src/bookmarks/bookmarksmanager.cpp')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 0c3284bb..dc545698 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -95,7 +95,7 @@ BookmarkProvider::~BookmarkProvider()
}
-void BookmarkProvider::setupBookmarkBar(BookmarkToolBar *toolbar)
+void BookmarkProvider::registerBookmarkBar(BookmarkToolBar *toolbar)
{
if (m_bookmarkToolBars.contains(toolbar))
return;
@@ -103,8 +103,8 @@ void BookmarkProvider::setupBookmarkBar(BookmarkToolBar *toolbar)
kDebug() << "new bookmark bar...";
m_bookmarkToolBars.append(toolbar);
- toolbar->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(toolbar, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenu(const QPoint &)));
+ toolbar->toolBar()->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(toolbar->toolBar(), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenu(const QPoint &)));
kDebug() << "new bookmark bar... DONE!";
}
@@ -125,7 +125,7 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString
{
if (bookmarkToolBar)
{
- bookmarkToolBar->clear();
+ bookmarkToolBar->toolBar()->clear();
fillBookmarkBar(bookmarkToolBar);
}
}
@@ -146,7 +146,7 @@ void BookmarkProvider::contextMenu(const QPoint &point)
if (m_bookmarkToolBars.isEmpty())
return;
- KToolBar *bookmarkToolBar = m_bookmarkToolBars.at(0);
+ KToolBar *bookmarkToolBar = m_bookmarkToolBars.at(0)->toolBar();
if (!bookmarkToolBar)
return;
@@ -174,16 +174,6 @@ KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent)
}
-KAction* BookmarkProvider::bookmarkToolBarAction(KToolBar *t)
-{
- KAction *bookmarkToolBarAction = new KAction(this);
- bookmarkToolBarAction->setDefaultWidget(t); // The ownership is transferred to action
- bookmarkToolBarAction->setText(i18n("Bookmarks Bar"));
- bookmarkToolBarAction->setShortcutConfigurable(false);
- return bookmarkToolBarAction;
-}
-
-
void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
{
KBookmarkGroup root = m_manager->toolbar();
@@ -199,12 +189,12 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address());
connect(menuAction->menu(), SIGNAL(aboutToShow()), toolBar, SLOT(menuDisplayed()));
connect(menuAction->menu(), SIGNAL(aboutToHide()), toolBar, SLOT(menuHidden()));
- toolBar->addAction(menuAction);
+ toolBar->toolBar()->addAction(menuAction);
}
else if (bookmark.isSeparator())
{
- toolBar->addSeparator();
+ toolBar->toolBar()->addSeparator();
}
else
@@ -212,7 +202,8 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
KBookmarkAction* action = new KBookmarkAction(bookmark, m_owner, this);
action->setIconText(action->iconText().replace('&', "&&"));
connect(action, SIGNAL(hovered()), toolBar, SLOT(actionHovered()));
- toolBar->addAction(action);
+ toolBar->toolBar()->addAction(action);
+ toolBar->toolBar()->widgetForAction(action)->installEventFilter(toolBar);
}
}
}