From 9b4b9d048968dcc670344f5c24fa212c5428aec3 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 11 Aug 2010 13:45:34 +0200 Subject: Refactor NewTabPage::browsingMenu() to clean the creation of item Almost identical code was copied 5 times. It has been replaced by a private function. --- src/newtabpage.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/newtabpage.h') diff --git a/src/newtabpage.h b/src/newtabpage.h index ad4941d3..c4e48f5c 100644 --- a/src/newtabpage.h +++ b/src/newtabpage.h @@ -107,7 +107,7 @@ private: * It works for all elements defined here. * */ - inline QWebElement markup(const QString &selector) + inline QWebElement markup(const QString &selector) const { return m_root.document().findFirst("#models > " + selector).clone(); } @@ -115,6 +115,8 @@ private: QString checkTitle(const QString &title); private: + QWebElement createNavItem(const QString &title, const QString &urlString, const QString &iconPath) const; + QString m_html; QWebElement m_root; }; -- cgit v1.2.1 From 89ac1b7f00b1632f655ade8daf34cc3d49df93f3 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 11 Aug 2010 14:34:22 +0200 Subject: Refactor createNavItem to use it everywhere .link items are used Change createNavItem() to a more generic createLinkItem() capable of generating icon of any type. Use the new createLinkItem() in every position where .link items are created. Fix the flags used for icons. The flags were specified with a boolean or operator: KIconLoader::SizeSmall || KIconLoader::Small -> one | All the icon flags have been changed to KIconLoader::Toolbar in order to keep the same behavior as before (Toolbar value equals 1). --- src/newtabpage.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/newtabpage.h') diff --git a/src/newtabpage.h b/src/newtabpage.h index c4e48f5c..2560beb2 100644 --- a/src/newtabpage.h +++ b/src/newtabpage.h @@ -33,6 +33,7 @@ #include "rekonq_defines.h" // KDE Includes +#include #include // Qt Includes @@ -115,7 +116,7 @@ private: QString checkTitle(const QString &title); private: - QWebElement createNavItem(const QString &title, const QString &urlString, const QString &iconPath) const; + QWebElement createLinkItem(const QString &title, const QString &urlString, const QString &iconPath, int groupOrSize) const; QString m_html; QWebElement m_root; -- cgit v1.2.1