summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkprovider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarkprovider.cpp')
-rw-r--r--src/bookmarks/bookmarkprovider.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp
index f5021916..cc11e463 100644
--- a/src/bookmarks/bookmarkprovider.cpp
+++ b/src/bookmarks/bookmarkprovider.cpp
@@ -35,11 +35,11 @@
#include "bookmarkspanel.h"
#include "bookmarkstoolbar.h"
#include "bookmarkowner.h"
+#include <iconmanager.h>
// KDE Includes
#include <KActionCollection>
#include <KStandardDirs>
-#include <KMimeType>
// Qt Includes
#include <QtCore/QFile>
@@ -79,14 +79,14 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
m_manager = KBookmarkManager::managerForFile(bookfile.path(), "rekonq");
connect(m_manager, SIGNAL(changed(const QString &, const QString &)),
- this, SLOT(slotBookmarksChanged(const QString &, const QString &)));
+ this, SLOT(slotBookmarksChanged()));
// setup menu
m_owner = new BookmarkOwner(m_manager, this);
connect(m_owner, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)),
this, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)));
- KAction *a = KStandardAction::addBookmark(this, SLOT(slotAddBookmark()), this);
+ KAction *a = KStandardAction::addBookmark(bookmarkOwner(), SLOT(bookmarkCurrentPage()), this);
m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
kDebug() << "Loading Bookmarks Manager... DONE!";
@@ -195,7 +195,7 @@ KBookmark BookmarkProvider::bookmarkForUrl(const KUrl &url)
}
-void BookmarkProvider::slotBookmarksChanged(const QString& /*groupAddress*/, const QString& /*caller*/)
+void BookmarkProvider::slotBookmarksChanged()
{
foreach(BookmarkToolBar *bookmarkToolBar, m_bookmarkToolBars)
{
@@ -235,6 +235,7 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
{
KBookmarkAction *action = new KBookmarkAction(bookmark, m_owner, this);
action->setIconText(action->iconText().replace('&', "&&"));
+ action->setIcon(KIcon(Application::iconManager()->iconForUrl(bookmark.url())));
connect(action, SIGNAL(hovered()), toolBar, SLOT(actionHovered()));
toolBar->toolBar()->addAction(action);
toolBar->toolBar()->widgetForAction(action)->installEventFilter(toolBar);
@@ -243,14 +244,6 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
}
-void BookmarkProvider::slotAddBookmark()
-{
- QString url = bookmarkOwner()->currentUrl();
- rootGroup().addBookmark(bookmarkOwner()->currentTitle(), url, KMimeType::favIconForUrl( KUrl(url) ) );
- bookmarkManager()->emitChanged();
-}
-
-
void BookmarkProvider::slotPanelChanged()
{
foreach (BookmarksPanel *panel, m_bookmarkPanels)