]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that tabs always have a text. If the file name is empty, use the protocol...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 28 May 2008 20:48:40 +0000 (20:48 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 28 May 2008 20:48:40 +0000 (20:48 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=813844

src/dolphinmainwindow.cpp

index 21ef3a984a386fc67266e7f024e6da0beb6a7158..85ff9f7f5eb51d8e44da87fbf92a03d6c34ba4eb 100644 (file)
@@ -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() :