diff options
Diffstat (limited to 'src/bookmarks.cpp')
-rw-r--r-- | src/bookmarks.cpp | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 70afc29e..568759a8 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -27,6 +27,7 @@ // Local Includes #include "mainwindow.h" #include "webview.h" +#include "application.h" // KDE Includes #include <KActionCollection> @@ -54,14 +55,14 @@ BookmarkOwner::BookmarkOwner(QObject *parent) } -void BookmarkOwner::openBookmark(const KBookmark &bookmark, - Qt::MouseButtons mouseButtons, +void BookmarkOwner::openBookmark(const KBookmark & bookmark, + Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers) { - Q_UNUSED(mouseButtons) + Q_UNUSED(mouseButtons) Q_UNUSED(keyboardModifiers) - emit openUrl(bookmark.url(), Rekonq::Current); + emit openUrl(bookmark.url()); } @@ -77,15 +78,6 @@ QString BookmarkOwner::currentTitle() const } -void BookmarkOwner::openFolderinTabs(const KBookmarkGroup &bm) -{ - QList<KUrl> urlList = bm.groupUrlList(); - //kDebug() << urlList; - QList<KUrl>::iterator url; - for(url = urlList.begin(); url != urlList.end(); ++url) - emit openUrl(*url, Rekonq::Background); -} - // ------------------------------------------------------------------------------------------------------ @@ -93,10 +85,11 @@ BookmarkMenu::BookmarkMenu(KBookmarkManager *manager, KBookmarkOwner *owner, KMenu *menu, KActionCollection* actionCollection) - : KBookmarkMenu(manager, owner, menu, actionCollection) + : KBookmarkMenu(manager, owner, menu, actionCollection) + { actionCollection->addAction(KStandardAction::AddBookmark, - QLatin1String("add_bookmark_payload"), + QLatin1String("add_bookmark_payload"), this, SLOT(slotAddBookmark())); } @@ -105,7 +98,7 @@ BookmarkMenu::~BookmarkMenu() { } - + KMenu *BookmarkMenu::viewContextMenu(QAction *action) { return contextMenu(action); @@ -123,7 +116,7 @@ void BookmarkMenu::slotAddBookmark() manager()->emitChanged(); return; } - + KBookmarkMenu::slotAddBookmark(); } @@ -158,13 +151,12 @@ BookmarkProvider::BookmarkProvider(QWidget *parent) } } m_manager = KBookmarkManager::managerForExternalFile(bookfile.path()); - connect(m_manager, SIGNAL(changed(const QString &, const QString &)), + connect(m_manager, SIGNAL(changed(const QString &, const QString &)), this, SLOT(slotBookmarksChanged(const QString &, const QString &))); // setup menu m_owner = new BookmarkOwner(this); - connect(m_owner, SIGNAL(openUrl(const KUrl &, Rekonq::OpenType)), - this, SIGNAL(openUrl(const KUrl &, Rekonq::OpenType))); + connect(m_owner, SIGNAL(openUrl(const KUrl& )), this, SIGNAL(openUrl(const KUrl& ))); m_bookmarkMenu = new BookmarkMenu(m_manager, m_owner, m_menu, m_actionCollection); // setup toolbar @@ -192,9 +184,9 @@ void BookmarkProvider::setupToolBar() m_bookmarkToolBar->setContentsMargins(0, 0, 0, 0); m_bookmarkToolBar->setMinimumHeight(16); m_bookmarkToolBar->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_bookmarkToolBar, SIGNAL(customContextMenuRequested(const QPoint &)), + connect(m_bookmarkToolBar, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenu(const QPoint &))); - + slotBookmarksChanged("", ""); } @@ -209,13 +201,13 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString kWarning() << "There is no bookmark toolbar"; return; } - + KActionCollection bookmarkCollection(this); - + KBookmarkGroup toolBarGroup = m_manager->toolbar(); if (toolBarGroup.isNull()) return; - + KBookmark bookmark = toolBarGroup.first(); while (!bookmark.isNull()) { if (!bookmark.isGroup()) @@ -232,7 +224,7 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString QAction *BookmarkProvider::actionByName(const QString &name) -{ +{ QAction *action = m_actionCollection->action(name); if (action) return action; |