1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Coding style: Moved showing BookmarksWidget into LocationBar

This commit is contained in:
nowrep 2012-09-14 22:09:58 +02:00
parent 2b6de8182b
commit eb82df9aef
4 changed files with 9 additions and 9 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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);

View File

@ -65,6 +65,7 @@ private slots:
void showMostVisited();
void showSiteInfo();
void rssIconClicked();
void bookmarkIconClicked();
void urlEnter();
void clearIcon();
void showRSSIcon(bool state);