From: Peter Penz Date: Wed, 28 May 2008 20:48:40 +0000 (+0000) Subject: Assure that tabs always have a text. If the file name is empty, use the protocol... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d326c746bc8a475370bfbed9fc217d16501567b5 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 --- 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() :