From 5f099967b0c7b25684fa2f0704ee1a81d712bbaa Mon Sep 17 00:00:00 2001 From: Furkan Uzumcu Date: Sun, 21 Aug 2011 18:25:14 +0200 Subject: Fix icon update When "use the favicon of the current web site as the window icon" option is enabled, the window icon used to have problems changing on new tab page. Wrong icons or no icon. This patch fixes this problem. REVIEW: 102310 REVIEWED-BY: adjam --- src/newtabpage.cpp | 11 +++++++++++ src/newtabpage.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 761bccd8..f1cddc5e 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -135,26 +135,31 @@ void NewTabPage::generate(const KUrl &url) if (encodedUrl == QByteArray("about:favorites")) { favoritesPage(); + updateWindowIcon(); title = i18n("Favorites"); } else if (encodedUrl == QByteArray("about:closedTabs")) { closedTabsPage(); + updateWindowIcon(); title = i18n("Closed Tabs"); } else if (encodedUrl == QByteArray("about:history")) { historyPage(); + updateWindowIcon(); title = i18n("History"); } else if (encodedUrl == QByteArray("about:bookmarks")) { bookmarksPage(); + updateWindowIcon(); title = i18n("Bookmarks"); } else if (encodedUrl == QByteArray("about:downloads")) { downloadsPage(); + updateWindowIcon(); title = i18n("Downloads"); } @@ -619,3 +624,9 @@ QWebElement NewTabPage::createLinkItem(const QString &title, const QString &urlS nav.findFirst(QL1S("span")).appendInside(title); return nav; } + +void NewTabPage::updateWindowIcon() +{ + int currentIndex = rApp->mainWindow()->mainView()->currentIndex(); + rApp->mainWindow()->changeWindowIcon(currentIndex); +} \ No newline at end of file diff --git a/src/newtabpage.h b/src/newtabpage.h index 482eb9ae..7a608deb 100644 --- a/src/newtabpage.h +++ b/src/newtabpage.h @@ -112,6 +112,8 @@ private: QString checkTitle(const QString &title); + void updateWindowIcon(); + private: QWebElement createLinkItem(const QString &title, const QString &urlString, const QString &iconPath, int groupOrSize) const; -- cgit v1.2.1