summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarksmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarksmanager.cpp')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 396d5bdc..4b4e127a 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -142,9 +142,6 @@ BookmarkMenu::BookmarkMenu(KBookmarkManager *manager,
KActionCollection* actionCollection)
: KBookmarkMenu(manager, owner, menu, actionCollection)
{
- KAction *a = KStandardAction::addBookmark(this, SLOT(slotAddBookmark()), this);
- actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
-
refill();
}
@@ -174,22 +171,6 @@ KMenu * BookmarkMenu::contextMenu(QAction *act)
}
-void BookmarkMenu::slotAddBookmark()
-{
- KAction *action = qobject_cast<KAction *>(sender());
- if (action && !action->data().isNull())
- {
- KBookmarkGroup parentBookmark = manager()->findByAddress(parentAddress()).toGroup();
- /// TODO Add bookmark Icon
- parentBookmark.addBookmark(owner()->currentTitle(), action->data().toUrl());
- manager()->emitChanged();
- return;
- }
-
- KBookmarkMenu::slotAddBookmark();
-}
-
-
QAction * BookmarkMenu::actionForBookmark(const KBookmark &bookmark)
{
if (bookmark.isGroup())
@@ -303,6 +284,9 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
m_owner = new BookmarkOwner(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);
+ m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
+
kDebug() << "Loading Bookmarks Manager... DONE!";
}
@@ -491,3 +475,11 @@ QString BookmarkProvider::titleForBookmarkUrl(const KBookmark &bookmark, QString
return title;
}
+
+
+void BookmarkProvider::slotAddBookmark()
+{
+ KBookmarkGroup parentBookmark = rootGroup();
+ parentBookmark.addBookmark(bookmarkOwner()->currentTitle(), bookmarkOwner()->currentUrl());
+ bookmarkManager()->emitChanged();
+}