summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkprovider.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-09-02 12:20:21 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-09-02 12:20:21 +0200
commit8830c32f2c4aea542003f71e14a43c712e2d91e0 (patch)
treebf7a8b859abffc1ecc33898a58a5baeea46dc27f /src/bookmarks/bookmarkprovider.cpp
parentThis should improve adblock retrieving by NOT asking for SSL confirmations (diff)
downloadrekonq-8830c32f2c4aea542003f71e14a43c712e2d91e0.tar.xz
A little bunch of fixes :
- Bookmarks saved with KMimeType::iconNameForUrl are now correctly displayed in the BK bar - Folder icons in the BK panel are fixed - Unset the current bookmark after a context menu deletition to avoid some bugs - Cleanup
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)