From eb82df9aefe531fa52a54d2faf989e8c02677cd2 Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 14 Sep 2012 22:09:58 +0200 Subject: [PATCH] Coding style: Moved showing BookmarksWidget into LocationBar --- src/lib/bookmarks/bookmarkicon.cpp | 8 -------- src/lib/bookmarks/bookmarkicon.h | 1 - src/lib/navigation/locationbar.cpp | 8 ++++++++ src/lib/navigation/locationbar.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/bookmarks/bookmarkicon.cpp b/src/lib/bookmarks/bookmarkicon.cpp index 8d5a532d9..ec8be1763 100644 --- a/src/lib/bookmarks/bookmarkicon.cpp +++ b/src/lib/bookmarks/bookmarkicon.cpp @@ -21,7 +21,6 @@ #include "tabbedwebview.h" #include "locationbar.h" #include "bookmarksmodel.h" -#include "bookmarkswidget.h" #include "pluginproxy.h" #include "speeddial.h" @@ -40,18 +39,11 @@ BookmarkIcon::BookmarkIcon(QupZilla* mainClass, QWidget* parent) setFocusPolicy(Qt::ClickFocus); m_bookmarksModel = mApp->bookmarksModel(); - connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked())); connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(bookmarkAdded(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(bookmarkDeleted(BookmarksModel::Bookmark))); connect(m_speedDial, SIGNAL(pagesChanged()), this, SLOT(speedDialChanged())); } -void BookmarkIcon::iconClicked() -{ - BookmarksWidget* menu = new BookmarksWidget(p_QupZilla, p_QupZilla->weView(), p_QupZilla->locationBar()); - menu->showAt(this); -} - void BookmarkIcon::checkBookmark(const QUrl &url, bool forceCheck) { if (!forceCheck && m_lastUrl == url) { diff --git a/src/lib/bookmarks/bookmarkicon.h b/src/lib/bookmarks/bookmarkicon.h index e4c3a582e..b618ff8bc 100644 --- a/src/lib/bookmarks/bookmarkicon.h +++ b/src/lib/bookmarks/bookmarkicon.h @@ -35,7 +35,6 @@ public: void checkBookmark(const QUrl &url, bool forceCheck = false); private slots: - void iconClicked(); void bookmarkAdded(const BookmarksModel::Bookmark &bookmark); void bookmarkDeleted(const BookmarksModel::Bookmark &bookmark); void speedDialChanged(); diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 5be4d9ffa..549b13f2b 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -26,6 +26,7 @@ #include "webpage.h" #include "tabwidget.h" #include "bookmarkicon.h" +#include "bookmarkswidget.h" #include "progressbar.h" #include "statusbarmessage.h" #include "toolbutton.h" @@ -83,6 +84,7 @@ LocationBar::LocationBar(QupZilla* mainClass) connect(m_siteIcon, SIGNAL(clicked()), this, SLOT(showSiteInfo())); connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(urlEnter())); connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked())); + connect(m_bookmarkIcon, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked())); connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showMostVisited())); connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); @@ -228,6 +230,12 @@ void LocationBar::rssIconClicked() rss->showAt(this); } +void LocationBar::bookmarkIconClicked() +{ + BookmarksWidget* bWidget = new BookmarksWidget(p_QupZilla, m_webView, this); + bWidget->showAt(this); +} + void LocationBar::showRSSIcon(bool state) { m_rssIcon->setVisible(state); diff --git a/src/lib/navigation/locationbar.h b/src/lib/navigation/locationbar.h index 3e1cf6ac5..c1cd07b73 100644 --- a/src/lib/navigation/locationbar.h +++ b/src/lib/navigation/locationbar.h @@ -65,6 +65,7 @@ private slots: void showMostVisited(); void showSiteInfo(); void rssIconClicked(); + void bookmarkIconClicked(); void urlEnter(); void clearIcon(); void showRSSIcon(bool state);