┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2009-05-05 21:49:03 +0000
committerFrank Reininghaus <[email protected]>2009-05-05 21:49:03 +0000
commitcc8a62ff160c0619b09fe7827c6fd6f38e023866 (patch)
tree09d9c19dc69310a27d816453afd344a32475da0f /src/dolphinmainwindow.cpp
parent0738c273ce927a32db0be2fa6e29f15a554a947d (diff)
Don't show an empty window caption when browsing "/", "trash:", etc.
BUG: 190783 svn path=/trunk/KDE/kdebase/apps/; revision=964061
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 64aba63a5..3ce1e9f2d 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -236,7 +236,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
updateEditActions();
updateViewActions();
updateGoActions();
- setCaption(url.fileName());
+ setUrlAsCaption(url);
if (m_viewTab.count() > 1) {
m_tabBar->setTabText(m_tabIndex, tabName(url));
}
@@ -987,7 +987,7 @@ void DolphinMainWindow::init()
setupActions();
const KUrl& homeUrl = generalSettings->homeUrl();
- setCaption(homeUrl.fileName());
+ setUrlAsCaption(homeUrl);
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
@@ -1096,7 +1096,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
updateGoActions();
const KUrl& url = m_activeViewContainer->url();
- setCaption(url.fileName());
+ setUrlAsCaption(url);
if (m_viewTab.count() > 1 && m_viewTab[m_tabIndex].secondaryView != 0) {
m_tabBar->setTabText(m_tabIndex, tabName(url));
m_tabBar->setTabIcon(m_tabIndex, KIcon(KMimeType::iconNameForUrl(url)));
@@ -1555,6 +1555,21 @@ QString DolphinMainWindow::tabProperty(const QString& property, int tabIndex) co
return "Tab " + QString::number(tabIndex) + ' ' + property;
}
+void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+{
+ QString caption;
+ if (url.equals(KUrl("file:///"))) {
+ caption = '/';
+ } else {
+ caption = url.fileName();
+ if (caption.isEmpty()) {
+ caption = url.protocol();
+ }
+ }
+
+ setCaption(caption);
+}
+
DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
KIO::FileUndoManager::UiInterface()
{