From f320652966b0b31f8838004a31798592de4b71c5 Mon Sep 17 00:00:00 2001 From: Shaun Reich Date: Tue, 10 Mar 2009 00:35:59 +0000 Subject: The tab icon now obeys the icon of the folder that it is currently browsing. Before it would just use the "folder" icon, but it now finds the icon of that folder, and uses it. BUG: 182702 svn path=/trunk/KDE/kdebase/apps/; revision=937595 --- src/dolphinmainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index c0910e274..271d8edec 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -237,6 +237,8 @@ void DolphinMainWindow::changeUrl(const KUrl& url) if (m_viewTab.count() > 1) { m_tabBar->setTabText(m_tabIndex, tabName(url)); } + const QString iconName = KMimeType::iconNameForUrl(url); + m_tabBar->setTabIcon(m_tabIndex, KIcon(iconName)); emit urlChanged(url); } } @@ -331,14 +333,15 @@ void DolphinMainWindow::openNewTab() void DolphinMainWindow::openNewTab(const KUrl& url) { + const KIcon icon = KIcon(KMimeType::iconNameForUrl(m_activeViewContainer->url())); if (m_viewTab.count() == 1) { // Only one view is open currently and hence no tab is shown at // all. Before creating a tab for 'url', provide a tab for the current URL. - m_tabBar->addTab(KIcon("folder"), tabName(m_activeViewContainer->url())); + m_tabBar->addTab(icon, tabName(m_activeViewContainer->url())); m_tabBar->blockSignals(false); } - m_tabBar->addTab(KIcon("folder"), tabName(url)); + m_tabBar->addTab(icon, tabName(url)); ViewTab viewTab; viewTab.splitter = new QSplitter(this); -- cgit v1.3