┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorShaun Reich <[email protected]>2009-03-10 00:35:59 +0000
committerShaun Reich <[email protected]>2009-03-10 00:35:59 +0000
commitf320652966b0b31f8838004a31798592de4b71c5 (patch)
tree3a21af19e46848394228aaacfe5aa531973693ed /src/dolphinmainwindow.cpp
parent0945eb5bc2878882adbd90c99e44d2cc40fbcddf (diff)
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
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp7
1 files changed, 5 insertions, 2 deletions
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);