From d326c746bc8a475370bfbed9fc217d16501567b5 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 28 May 2008 20:48:40 +0000 Subject: [PATCH] Assure that tabs always have a text. If the file name is empty, use the protocol instead. This fixes the issue that for "trash://" no text is shown in the tab. svn path=/trunk/KDE/kdebase/apps/; revision=813844 --- src/dolphinmainwindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 21ef3a984..85ff9f7f5 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1188,7 +1188,16 @@ void DolphinMainWindow::updateSplitAction() QString DolphinMainWindow::tabName(const KUrl& url) const { - return url.equals(KUrl("file:///")) ? "/" : url.fileName(); + QString name; + if (url.equals(KUrl("file:///"))) { + name = "/"; + } else { + name = url.fileName(); + if (name.isEmpty()) { + name = url.protocol(); + } + } + return name; } DolphinMainWindow::UndoUiInterface::UndoUiInterface() : -- 2.47.3