summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp2
-rw-r--r--src/bookmarks.cpp17
-rw-r--r--src/bookmarks.h9
-rw-r--r--src/mainwindow.cpp2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 5aefb4fb..69ba2d28 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -191,7 +191,7 @@ BookmarkProvider *Application::bookmarkProvider()
{
if (!s_bookmarkProvider)
{
- s_bookmarkProvider = new BookmarkProvider(instance()->mainWindow());
+ s_bookmarkProvider = new BookmarkProvider(instance());
}
return s_bookmarkProvider;
}
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index d8298478..69f6c945 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -65,9 +65,13 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark,
Qt::KeyboardModifiers keyboardModifiers)
{
if (keyboardModifiers & Qt::ControlModifier || mouseButtons == Qt::MidButton)
+ {
emit openUrl(bookmark.url(), Rekonq::SettingOpenTab);
+ }
else
+ {
emit openUrl(bookmark.url(), Rekonq::CurrentTab);
+ }
}
@@ -150,11 +154,10 @@ void BookmarkMenu::slotAddBookmark()
// ------------------------------------------------------------------------------------------------------
-BookmarkProvider::BookmarkProvider(QWidget *parent)
+BookmarkProvider::BookmarkProvider(QObject *parent)
: QObject(parent)
, m_manager(0)
, m_owner(0)
- , m_menu(new KMenu(parent))
, m_actionCollection(new KActionCollection(this))
, m_bookmarkMenu(0)
, m_bookmarkToolBar(0)
@@ -183,7 +186,6 @@ BookmarkProvider::BookmarkProvider(QWidget *parent)
// setup menu
m_owner = new BookmarkOwner(this);
connect(m_owner, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)), this, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)));
- m_bookmarkMenu = new BookmarkMenu(m_manager, m_owner, m_menu, m_actionCollection);
}
@@ -191,7 +193,6 @@ BookmarkProvider::~BookmarkProvider()
{
delete m_bookmarkMenu;
delete m_actionCollection;
- delete m_menu;
delete m_owner;
delete m_manager;
}
@@ -256,10 +257,12 @@ void BookmarkProvider::contextMenu(const QPoint &point)
}
-KActionMenu* BookmarkProvider::bookmarkActionMenu()
+KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent)
{
- KActionMenu *bookmarkActionMenu = new KActionMenu(this);
- bookmarkActionMenu->setMenu(m_menu);
+ KMenu *menu = new KMenu(parent);
+ m_bookmarkMenu = new BookmarkMenu(m_manager, m_owner, menu, m_actionCollection);
+ KActionMenu *bookmarkActionMenu = new KActionMenu(parent);
+ bookmarkActionMenu->setMenu(menu);
bookmarkActionMenu->setText(i18n("&Bookmarks"));
return bookmarkActionMenu;
}
diff --git a/src/bookmarks.h b/src/bookmarks.h
index 9e901e11..df6a8767 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -119,9 +119,6 @@ signals:
*
*/
void openUrl(const KUrl &, const Rekonq::OpenType &);
-
-private:
-
};
// ------------------------------------------------------------------------------
@@ -177,14 +174,15 @@ public:
* @param parent The MainWindow to provide bookmarks objects
*
*/
- BookmarkProvider(QWidget* parent = 0);
+ BookmarkProvider(QObject* parent = 0);
~BookmarkProvider();
/**
* @short Get the Bookmarks Menu Action
+ * @param the parent widget
* @return the Bookmarks Menu
*/
- KActionMenu *bookmarkActionMenu();
+ KActionMenu *bookmarkActionMenu(QWidget *parent);
/**
@@ -233,7 +231,6 @@ private:
KBookmarkManager *m_manager;
BookmarkOwner *m_owner;
- KMenu *m_menu;
KActionCollection *m_actionCollection;
BookmarkMenu *m_bookmarkMenu;
KToolBar *m_bookmarkToolBar;
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8d288ff9..8f5b3fc0 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -125,7 +125,7 @@ MainWindow::MainWindow()
setupActions();
// Bookmark Menu
- KActionMenu *bmMenu = Application::bookmarkProvider()->bookmarkActionMenu();
+ KActionMenu *bmMenu = Application::bookmarkProvider()->bookmarkActionMenu(this);
bmMenu->setIcon(KIcon("rating"));
actionCollection()->addAction(QLatin1String("bookmarksActionMenu"), bmMenu);
((KActionMenu *)actionByName("bookmarksActionMenu"))->setDelayed(false);