From: Shaun Reich Date: Tue, 10 Mar 2009 00:35:59 +0000 (+0000) Subject: The tab icon now obeys the icon of the folder that it is currently browsing. Before... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/f320652966b0b31f8838004a31798592de4b71c5 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 --- 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);